 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
DiegoPKV How do I cheat?
Reputation: 0
Joined: 11 Oct 2016 Posts: 1
|
Posted: Tue Oct 11, 2016 7:10 am Post subject: Need help with Lua script in AA and timers |
|
|
I've been a week trying to do a script that regenerates fusion metter to learn Lua and improve my coding skills.
This cheat worked before with sleep() but it did CE or trainers irresponsive, then I started trying to make it work with a derivated code and the use of timers.
This is the new code:
Code: |
[ENABLE]
{$lua}
Fusion_form = readBytes("21C6C901")
Max_fusion = readBytes("21C6C902")
Act_fusion = readBytes("21C6C900")
function regen()
if (Act_fusion < 100) then
Act_fusion = Act_fusion + 1
writeBytes("21C6C900",Act_fusion)
end
if (Act_fusion >= 100) then
if (Act_fusion >= 100 and Fusion_form < Max_fusion) then
inc = Fusion_form + 1
writeBytes("21C6C901",inc)
Act_fusion=0
writeBytes("21C6C900",Act_fusion)
end
if (Act_fusion >= 100 and Fusion_form == Max_fusion) then
Act_fusion=100
writeBytes("21C6C900",Act_fusion)
end
end
if (Act_fusion == 0 and Fusion_form <= Max_fusion) then
end
end
t = createTimer(nil)
timer_onTimer(t,regen)
timer_setInterval(t,100)
timer_setEnabled(t,true)
{$asm}
[DISABLE]
{$lua}
t.destroy()
|
It runs ok until Fusion_form stops the increment and Act_fusion continues endlessly
Description: |
|
Filesize: |
237.24 KB |
Viewed: |
2639 Time(s) |

|
|
|
Back to top |
|
 |
predprey Master Cheater
Reputation: 24
Joined: 08 Oct 2015 Posts: 486
|
Posted: Tue Oct 11, 2016 11:25 am Post subject: |
|
|
Code: | [ENABLE]
{$lua}
function regen()
local Fusion_form = readBytes("21C6C901")
local Max_fusion = readBytes("21C6C902")
local Act_fusion = readBytes("21C6C900")
if (Act_fusion < 100) then
Act_fusion = Act_fusion + 1
writeBytes("21C6C900",Act_fusion)
end
if (Act_fusion >= 100) then
if (Fusion_form < Max_fusion) then
Fusion_form = Fusion_form + 1
writeBytes("21C6C901",Fusion_form)
Act_fusion=0
writeBytes("21C6C900",Act_fusion)
elseif (Fusion_form == Max_fusion) then
Act_fusion=100
writeBytes("21C6C900",Act_fusion)
end
end
end
t = createTimer(nil)
timer_onTimer(t,regen)
timer_setInterval(t,100)
timer_setEnabled(t,true)
{$asm}
[DISABLE]
{$lua}
t.destroy()
{$asm} |
try this?
|
|
Back to top |
|
 |
|
|
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
|
|