| View previous topic :: View next topic |
| Author |
Message |
IraFunesto How do I cheat?
Reputation: 0
Joined: 01 Oct 2021 Posts: 8
|
Posted: Fri Oct 01, 2021 2:36 pm Post subject: Change the value when it is written |
|
|
| I have a value that is written from the address when the layer is loaded. When I exit the level, the value is changed multiple times and if I lock it it creates bugs in other levels in the game. I need a script that when the value becomes 16, it automatically changes it to 21.
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Fri Oct 01, 2021 3:19 pm Post subject: |
|
|
This should work just fine (paste it into an auto assembler script). It searches for the entry 'Entry_name_here' in the cheat table and if it exists then it will create a timer which runs the function checkValue every 50ms. The function will check the value of the entry in the table to see if it matches 16 and if it does, set it to 21.
| Code: |
[ENABLE]
{$LUA}
local al = getAddressList()
local mr = al.getMemoryRecordByDescription('Entry_name_here')
function checkValue()
if mr.Value == 16 then
mr.Value = 21
end
end
if mr ~= nil then
local t = createTimer(getMainForm())
t.Interval = 50
t.OnTimer = checkValue()
end
{$ASM}
[DISABLE]
{$LUA}
if t then
t.destroy()
t = nil
end
|
Last edited by LeFiXER on Sat Oct 02, 2021 8:29 am; edited 1 time in total |
|
| Back to top |
|
 |
IraFunesto How do I cheat?
Reputation: 0
Joined: 01 Oct 2021 Posts: 8
|
Posted: Sat Oct 02, 2021 6:08 am Post subject: |
|
|
I receive this error
| Description: |
|
| Filesize: |
23.64 KB |
| Viewed: |
1632 Time(s) |

|
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sat Oct 02, 2021 8:29 am Post subject: |
|
|
| Below [DISABLE] type {$LUA}
|
|
| Back to top |
|
 |
IraFunesto How do I cheat?
Reputation: 0
Joined: 01 Oct 2021 Posts: 8
|
Posted: Sun Oct 03, 2021 4:33 am Post subject: |
|
|
| I don't get any errors now, but nothing happens.
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Mon Oct 04, 2021 4:10 am Post subject: |
|
|
Try this instead:
| Code: |
[ENABLE]
{$LUA}
function checkValue()
local al = getAddressList()
local mr = al.getMemoryRecordByDescription('Entry_name_here')
if mr ~= nil then
local x = readInteger(mr.address)
if x == 16 then
writeInteger(mr.address, 21)
end
end
end
local t = createTimer(getMainForm())
t.Interval = 50
t.OnTimer = checkValue()
t.Enabled = true
{$ASM}
[DISABLE]
{$LUA}
if t then
t.destroy()
t = nil
end
|
|
|
| Back to top |
|
 |
|