Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Grab Pointer Overkill Style. Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Sun May 08, 2016 4:05 am    Post subject: Grab Pointer Overkill Style. Help Reply with quote

Code:
Mrec = getAddressList().SelectedRecord
tf = Mrec.getAddress()  -- Damn DarkByte thats A bug NO Table is Made or Im RetaRdead
--print(tf)
Offsets = Mrec.getOffsetCount()
--print(Offsets)

B = createStringlist()
T = createStringlist()
T_Reverse = createStringlist()
for In=0,Offsets-1 do
  O = Mrec.getOffset(In)

 -- print(string.format('%X',O).."     Converted Hex Offset "..In)
  yeah = string.format('%X',O)
  T.add(yeah)

  --- Reverse and Prep Concat
  Rev = string.reverse(yeah)
  T_Reverse.add(Rev)

  ---- Cheat Max Entry
  InMax = In
  --- Easy Start Brackets
  B.add("[")

  end

--print(InMax)


F = table.concat (T, ",",0,Offsets-1)
--print(F)

W = table.concat (T_Reverse, "+]",0,Offsets-1)
--print(W)

Brk = table.concat (B, "",0,Offsets-1)
--print(Brk)

G = string.reverse(W)


------  20 Lines 3 Tables & an Arg -------

if Offsets==0
 then
  Finally = tf
 else
  Finally = Brk..tf.."]+"..G
end
  print(Finally)





LOL this is ridiculous there has to be a better way. And it Completely breaks if it finds a Negative Offset. But works perfect otherwise.

Also getAddress() does not create a table for me.

_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sun May 08, 2016 4:33 am    Post subject: Reply with quote

Quote:

tf = Mrec.getAddress() -- Damn DarkByte thats A bug NO Table is Made or Im RetaRdead


should be:
Code:

tf,offsets = Mrec.getAddress()


offsets is then a table containing the offsets (in integer form)


Is this what you want ?
Code:

Mrec=getAddressList().SelectedRecord
if Mrec then
  address,offsets=Mrec.getAddress()

  if offsets then
    pre=''
    post=''
    for i=#offsets,1,-1 do
      pre=pre..'['

      if offsets[i]<0 then
        post=post..']-'..string.format('%x', -offsets[i])
      else
        post=post..']+'..string.format('%x', offsets[i])
      end
    end

    print(pre..address..post)
  else
    print(address)
  end
end

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Sun May 08, 2016 8:50 am    Post subject: Reply with quote

Code:
address,offsets=Mrec.getAddress()


Tried using two entries there too. Must have typed something wrong when trying to access.

Thank you, Dark Byte much more elegant approach of building the pointer.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites