Posted: Tue Jun 03, 2014 1:35 pm Post subject: Enable/Disable a lua script via the cheat table
so a while ago I asked for a code for health regen
Code:
function CheckHealth(t)
local al=getAddressList()
local memrec=al.getMemoryRecordByDescription("Health")
if memrec~=nil then
if tonumber(memrec.Value)<100 then
memrec.Value=memrec.Value+1
end
end
end
t=createTimer(nil)
t.OnTimer=CheckHealth
t.Interval=1000 --every 1 second
t.Enabled=true
unfortunately I can only run this once, so it forces me to use it the rest of the game, I've never seen an option to "add to cheat table" so I'm not particularly sure how to do it
in addition, once I click execute script, the only way to stop the script is to close out cheat engine and the game to terminate everything from memory, which is incredibly frustrating
Last edited by Renard10177 on Tue Jun 03, 2014 2:04 pm; edited 1 time in total
Joined: 09 May 2003 Posts: 25784 Location: The netherlands
Posted: Tue Jun 03, 2014 2:34 pm Post subject:
put this in the lua part of the cheat table (table->show cheat table lua script) and execute it (when the table is loaded and it asks, always allow)
Code:
function CheckHealth(t)
local al=getAddressList()
local memrec=al.getMemoryRecordByDescription("Health")
if memrec~=nil then
if tonumber(memrec.Value)<100 then
memrec.Value=memrec.Value+1
end
end
end
function ActivateTimer()
t=createTimer(nil)
t.OnTimer=CheckHealth
t.Interval=1000 --every 1 second
t.Enabled=true
end
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