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 


How do I timer/freeze a value with AA when it's modified?

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

Joined: 10 Oct 2015
Posts: 38

PostPosted: Thu Mar 23, 2017 12:49 am    Post subject: How do I timer/freeze a value with AA when it's modified? Reply with quote

hello, I'd like to know how to freeze a 16 byte value in my AA script right after it has modified the necessary bytes. (Thanks to ++METHOS for helping with the pointer requirements)

Here is the script:
Code:
[ENABLE]
alloc(newmemb,32)
registersymbol(newmemb)

newmemb:
readmem([[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8,16)

[[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8:
db FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

[DISABLE]
dealloc(newmemb)
[[[[[[[["DBXV2.exe"+01099E70]+3698]+1800]+C0]+8]+CC0]+8]+240]+2C8:
readmem(newmemb,16)


The script works and it changes the default value to "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF", but how would it be possible to timer/freeze this value (right after) it has been written? It doesn't matter how long it's frozen for, it could even be every 5 seconds.

I understand at the least that toggling the freeze option in the cheat engine window assigns a 250ms freeze timer, so how would it be possible to include this ability in the AA script so that when the button is pressed, it modifies the 16 byte row and also freezes it at the same time or afterwards?

I've tried using the debugger to locate the source code of the operation, but since it's an XOR/cmp/XOR it would disable the function entirely, so it would not work for this script, as I need the script to work in order to unlock a menu.

'nop'ing the script completely disables the menu, so it needs to be a timer instead, so that the menu stays unlocked, as it is only temporary when it is not frozen.

Thanks for the help.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3665

PostPosted: Thu Mar 23, 2017 1:26 am    Post subject: Reply with quote

You can add this pointer to your table and set a hotkey to freeze the value. You can also adjust CE's freeze/update intervals. You can assign the same hotkey for toggle-freezing the pointer as you do for toggling the script.

If you use toggle as opposed to having two different hotkeys for enable/disable, then I would recommend that you also alter your keypoll interval and hotkey delay under hotkey settings. That said, probably better to use multiple hotkeys in the event that the freeze writes after the original bytes are set.


Last edited by ++METHOS on Thu Mar 23, 2017 1:31 am; edited 1 time in total
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Thu Mar 23, 2017 1:29 am    Post subject: Reply with quote

++METHOS wrote:
You can add this pointer to your table and set a hotkey to freeze the value. You can also adjust CE's freeze/update intervals. You can assign the same hotkey for freezing the pointer as you do for toggling the script.

Thanks for the reply.

How would it be done so that it works with a checkbox, instead of a hotkey?
Would it be easier to to enable the checkbox option on the hotkeys instead?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3665

PostPosted: Thu Mar 23, 2017 1:33 am    Post subject: Reply with quote

You can use hotkeys or the checkbox. You can create parent/child entries, then right-click for group config options to allow the child entries to mirror the parent.

Or, write a Lua script with a timer.
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Thu Mar 23, 2017 1:59 am    Post subject: Reply with quote

++METHOS wrote:
You can use hotkeys or the checkbox. You can create parent/child entries, then right-click for group config options to allow the child entries to mirror the parent.

Or, write a Lua script with a timer.

How would a timer be implemented into the existing script?
Not sure exactly how to go about doing the parent/child option with an AA script...
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3665

PostPosted: Thu Mar 23, 2017 2:41 am    Post subject: Reply with quote

You can use Lua, but someone else will have to assist with that.

Regarding parent/child entries, it is really easy. Just set up the pointer address inside your table. Then, drag the script on to the pointer address and it will be set up as a child entry under the pointer address. Right-click on the pointer address and select group config options. Here, you can set it so that activating and deactivating the parent will do the same for the child entries.

You may be able to set up a timer using createthread if you do not want to use traditional injection, but I am not sure how to do that without crashing the target.
Back to top
View user's profile Send private message
CPUzX
Cheater
Reputation: 0

Joined: 10 Oct 2015
Posts: 38

PostPosted: Thu Mar 23, 2017 3:15 am    Post subject: Reply with quote

++METHOS wrote:
You can use Lua, but someone else will have to assist with that.

Regarding parent/child entries, it is really easy. Just set up the pointer address inside your table. Then, drag the script on to the pointer address and it will be set up as a child entry under the pointer address. Right-click on the pointer address and select group config options. Here, you can set it so that activating and deactivating the parent will do the same for the child entries.

You may be able to set up a timer using createthread if you do not want to use traditional injection, but I am not sure how to do that without crashing the target.

ahh, right. So I did do that correctly after all, but it was in the reverse order, so the script was activating but not the pointer.

Thanks again!
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