View previous topic :: View next topic |
Author |
Message |
Flux. Advanced Cheater
Reputation: 0
Joined: 10 Nov 2016 Posts: 88 Location: Another World - N5X2 106311411+2123518
|
Posted: Sun Mar 31, 2019 3:53 am Post subject: Have a code disable itself |
|
|
Hello, i am looking for a way to have a code disable itself after 5 seconds.
example -
press hotkey and code changes to
'movss [rax+20],xmm3' and enables the cheat
after 5 seconds code automatically reverts to
'movss [rax+20],xmm2'
Thank you for any help.
|
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25785 Location: The netherlands
|
Posted: Sun Mar 31, 2019 4:05 am Post subject: |
|
|
Add this code to your AA script enable section:
Code: |
{$lua}
if syntaxcheck then return end
local t=createTimer()
t.Interval=5000
t.OnTimer=function()
memrec.Active=false
t.destroy()
end
{$asm}
|
_________________
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 |
|
 |
Flux. Advanced Cheater
Reputation: 0
Joined: 10 Nov 2016 Posts: 88 Location: Another World - N5X2 106311411+2123518
|
Posted: Sun Mar 31, 2019 4:37 am Post subject: |
|
|
Thanks for the help TheyCallMeTim13, have made the table and going to give it a full test.
And thanks Dark Byte, missed your post initially.
Just a quick question,
If a hot key is assigned and you push it say 3 or 5 times, multiple timers are created,
all looking to disable the cheat if enabled,
so is it possible to destroy and reset the timer on each hotkey press and cheat disable.
Not to important as the cheat functions fine as is, was Just wondering.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25785 Location: The netherlands
|
Posted: Sun Mar 31, 2019 6:51 am Post subject: |
|
|
instead of local t make it a global timer with a unique name
then in the script check if it exists, and if so, destroy and nil it
_________________
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 |
|
 |
|