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 


iterating lots of addresses

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
qwertym30
How do I cheat?
Reputation: 0

Joined: 17 Apr 2021
Posts: 1

PostPosted: Sat Apr 17, 2021 7:44 am    Post subject: iterating lots of addresses Reply with quote

Heya i want to read around 3m addresses and store them into clipboard and then load them back to the addresses. Currently i have only the storing part

a = "0x15F38AAE340"
b = ""
for i=0, 3000000 do
a = a + 4*i
b = print(b .. print(readBytes(a, 3)))
end
writeToClipboard(print(b))

but if i use print it adds up and crashes so im not sure how to save readbytes into a string and add to it every loop.
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sat Apr 17, 2021 10:23 am    Post subject: Reply with quote

You're reading lots of addresses, so CE goes into unresponsive state (until the loop completes), so it might take a few minutes.
It would be better to store them in a table and then print.
Code:
a = 0x15F38AAE340
local t = {}

for i=0,3000000,4 do
   local value = ("%X"):format(readInteger(a+i));
   t[#t+1] = value
   processMessages()
   -- print(value); -- better to print everything at once than each value
end

local s = table.concat(t,'\r\n');
print(s);
writeToClipboard(s);

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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