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 


are there any easier to deal with pointer reference in lua?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
happyreadygo
Advanced Cheater
Reputation: 1

Joined: 14 Sep 2011
Posts: 87

PostPosted: Thu Aug 30, 2012 8:13 pm    Post subject: are there any easier to deal with pointer reference in lua? Reply with quote

are there any easier to deal with pointer?

I think lua don't have *ptr like C launguage.

when I want to copy mem1value to mem2, i do like this

Code:
 totalUnitInGroup=readInteger(readInteger(0x96d978)+0x1764)


When I put units ID into groupUnit , I reference to it like this

Code:
  if groupUnit[1] ~= nil then
    baseAddress=0x96d6dc

    for i=1,totalUnitInGroup do
      writeInteger(baseAddress,groupUnit[i])
      baseAddress=baseAddress+0x8
     end
    groupUnit={}
  end


It seems like there are others easier way to go.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Aug 31, 2012 3:43 am    Post subject: Reply with quote

If you know the path you could use a ce notation like this:
readInteger("[96d97b]+1764")

As for the second part, not sure. A integer is 4 bytes, but you do +8 (skipping 4 bytes), so it's not a region copy, so not sure how to make this more efficient.

_________________
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
happyreadygo
Advanced Cheater
Reputation: 1

Joined: 14 Sep 2011
Posts: 87

PostPosted: Fri Aug 31, 2012 7:54 am    Post subject: Reply with quote

thank you Smile
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