View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Mon Apr 04, 2016 11:12 am Post subject: Creating and attaching a constant timer to a game. |
|
|
I have three questions:
1. How to create a timer every time when the game starts, not in Lua but in ASM?
2. If I want to constantly checking some memory addresses while the game is running, and then do some actions based on the results, how do I do that?
3. As an alternative, can all the above be done in Lua? I don't know Lua very well, but I just know even less about assembly language. I wish I could use Lua instead of ASM. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Apr 04, 2016 5:35 pm Post subject: |
|
|
Code: | mytimer=createTimer(nil, false)
mytimer.Interval=1000
mytimer.OnTimer=function(timer)
if readInteger("address") < 100 then
writeInteger("address", 100)
end
end
mytimer.Enabled=true |
|
|
Back to top |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Mon Apr 04, 2016 9:33 pm Post subject: |
|
|
Zanzer wrote: | Code: | mytimer=createTimer(nil, false)
mytimer.Interval=1000
mytimer.OnTimer=function(timer)
if readInteger("address") < 100 then
writeInteger("address", 100)
end
end
mytimer.Enabled=true |
|
Got it, read and write integers... I should have known that.
Thanks Zaner as usual. |
|
Back to top |
|
|
|