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 


HELP WITH THIS FOR - INCREASE ADDRESS BY 1

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
SAMASAL
Newbie cheater
Reputation: 0

Joined: 02 Apr 2015
Posts: 11

PostPosted: Sun Jul 02, 2017 4:43 am    Post subject: HELP WITH THIS FOR - INCREASE ADDRESS BY 1 Reply with quote

Is basically something around this lines:

local addr = "B94B0040"

for xxxxx do
stuff
addr = addr.."+1"
end

Now the script works but the help I need is with:

addr = addr.."+1"

The reason is that as the FOR does several thousands loops. the variable addr is being stored as addrr+1+1+1+1+1 etc instead of increasing the base value B94B0040, this seems to be slowing down the iterations a lot, I am very new to LUA please bear with me, thank you!
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 Jul 02, 2017 5:58 am    Post subject: Reply with quote

addr=getAddressSafe("B94B0040")

for xxxx do
stuff
addr=addr+1
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
SAMASAL
Newbie cheater
Reputation: 0

Joined: 02 Apr 2015
Posts: 11

PostPosted: Mon Jul 03, 2017 12:31 am    Post subject: Reply with quote

Dark I am using val = readInteger(addr) in the middle of the loop, also val2 = readInteger(addr+30), in the middle of the For, however these two seems to no longer give me the results I would expect after using getAddressSafe.

What is getAddressSafe doing, converting my hex address to number? is there a way to keep it as hex?

Thanks for helping a noobie.
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