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 


Change and freeze a value

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

Joined: 22 May 2012
Posts: 26

PostPosted: Fri Aug 03, 2012 3:18 pm    Post subject: Change and freeze a value Reply with quote

Hello, i'm trying to change a value type array of bytes, and then freeze it.
I change the value with:

Code:
local scan = AOBScan("x");
if scan ~= nil and strings_getCount(scan) > 0 then
local scan_num = strings_getCount(scan);
for n = 0, scan_num - 1 do
local addr = strings_getString(scan, 0)
writeBytes( addr, y)
end
object_destroy(scan);
end


But now i don't know how i can freeze that with lua, and add in the script with the hotkey. You can help me please?


Last edited by Firered on Sun Aug 05, 2012 9:02 pm; edited 2 times in total
Back to top
View user's profile Send private message
Firered
Cheater
Reputation: 0

Joined: 22 May 2012
Posts: 26

PostPosted: Sun Aug 05, 2012 2:17 am    Post subject: Reply with quote

i need help =/
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Aug 05, 2012 8:27 am    Post subject: Reply with quote

don't use auto assemble
Use lua's AOBScan(....) function

then read the results using strings_getCount (probably one) and strings_getString (index 0 of the stringlist aobscan returned)

then add the text "+1" to that string

Now there are multiple options.
Easiest is to just create a timer with an interval of 200 ms or less, (not too low) where you call writeBytes(thataddressinstringform, 00, 00)

Alternatively, add this address to the addresslist, and set the memrec to frozen

_________________
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
Firered
Cheater
Reputation: 0

Joined: 22 May 2012
Posts: 26

PostPosted: Sun Aug 05, 2012 1:01 pm    Post subject: Reply with quote

I make do, more this aob not freezes, it changes only once and returns to the original. what is wrong?

Code:
local scan = AOBScan("x");
if scan ~= nil and strings_getCount(scan) > 0 then
local scan_num = strings_getCount(scan);
for n = 0, scan_num - 1 do
local addr = strings_getString(scan, 0)
writeBytes( addr, y)
end
object_destroy(scan);
end
function myattach(timer)
t=createTimer(f);
timer_setInterval(t,200)
timer_onTimer(t,myattach)
end


Last edited by Firered on Sun Aug 05, 2012 9:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Aug 05, 2012 3:12 pm    Post subject: Reply with quote

timer_onTimer must point to a function that writes the bytes.
Currently, you have set it to a function that creates a timer

_________________
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
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