View previous topic :: View next topic |
Author |
Message |
theboy181 Advanced Cheater Reputation: 0
Joined: 26 Jan 2018 Posts: 90
|
Posted: Fri Mar 08, 2024 10:11 pm Post subject: What am I doing wrong? This even possible? |
|
|
Code: |
[ENABLE]
alloc(newmem,2048)
label(code)
label(return)
newmem:
code:
cmp [8003B9E0],1 // Compare the value at address 8003B9E0 with 1
jne short return // If not equal, jump to return
mov [8003B9E0],2 // If equal, move 2 into the address
return:
jmp newmem // Jump back to newmem to loop the check
// Register the thread that will run our code
CreateThread(newmem)
[DISABLE]
dealloc(newmem)
// If you had registered any symbols, unregister them here
|
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 147
Joined: 06 Jul 2014 Posts: 4518
|
Posted: Fri Mar 08, 2024 10:44 pm Post subject: |
|
|
What are you even trying to do...?
If you're concerned about the crash that happens when the script is disabled, well, that's what happens when you deallocate memory a thread is using.
See this for more information:
https://forum.cheatengine.org/viewtopic.php?t=619046
You're probably better off using a timer anyway. I highly doubt you need to dedicate an entire hardware thread to this single task in a busy loop.
Code: | {$lua}
if syntaxcheck then return end
if myTimer then myTimer.destroy(); myTimer = nil end
[ENABLE]
myTimer = createTimer()
myTimer.Interval = 100
myTimer.OnTimer = function(t)
if readInteger(0x8003B9E0) == 1 then
writeInteger(0x8003B9E0, 2)
end
end
[DISABLE] |
If a timer isn't fast enough, try using code injection to modify what writes to the address.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
theboy181 Advanced Cheater Reputation: 0
Joined: 26 Jan 2018 Posts: 90
|
Posted: Fri Mar 08, 2024 11:47 pm Post subject: |
|
|
Thanks this was helpful.
This is to make RR64 for the N64 60fps.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 465
Joined: 09 May 2003 Posts: 25509 Location: The netherlands
|
Posted: Sat Mar 09, 2024 2:17 am Post subject: |
|
|
You can also freeze the value and set the value to:
Code: |
value==1 and 2 or value
|
you can also put this in a hotkey. 1 hotkey that freezes, and then another hotkey with the same key to set the value
_________________
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 |
|
|
theboy181 Advanced Cheater Reputation: 0
Joined: 26 Jan 2018 Posts: 90
|
Posted: Sat Mar 09, 2024 12:14 pm Post subject: |
|
|
Dark Byte wrote: | You can also freeze the value and set the value to:
Code: |
value==1 and 2 or value
|
you can also put this in a hotkey. 1 hotkey that freezes, and then another hotkey with the same key to set the value |
How would this script look?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 465
Joined: 09 May 2003 Posts: 25509 Location: The netherlands
|
Posted: Sat Mar 09, 2024 1:59 pm Post subject: |
|
|
just a normal address entry with 2 hotkeys assigned
_________________
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 |
|
|
|