|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Aziixz Cheater Reputation: 0
Joined: 26 Oct 2021 Posts: 31 Location: Earth
|
Posted: Tue Aug 30, 2022 1:01 pm Post subject: script with pointer and offset |
|
|
I also need help with setting up a scipt regarding pointers,
I have this pointer that points to a an address with a value that changes each time the game is booted up , now i need a script to hotkey toggle that value + 480 when hitting mouse button 4 and revert back to the original value when hitting mouse button 5, how would i go about doing this
|
|
Back to top |
|
|
Kvist How do I cheat? Reputation: 0
Joined: 11 Aug 2022 Posts: 6
|
Posted: Tue Aug 30, 2022 2:24 pm Post subject: |
|
|
Edit: Removed the part of the answer that had literally nothing to do with the question
To toggle, you'd need an AA script somewhat like this
Code: |
{$lua}
if syntaxcheck then return end
[ENABLE]
local record = AddressList.getMemoryRecordByDescription("My Value")
if record then
original = record.NumberValue
record:setValue(original + 480)
end
[DISABLE]
local record = AddressList.getMemoryRecordByDescription("My Value")
if record then
record:setValue(original)
original = nil -- not strictly necessary
end
|
The original value needs to be globally accessible in some way to have it available to both the enable and the disable section of the script. The record variable could also be moved out of the sections to the top and then be declared global if desired.
Then, for the hotkeys, I find it's best to set these through CE directly (press Ctrl+H with the script selected). However, if you want to do it in Lua:
Code: |
local script = AddressList.getMemoryRecordByDescription("My Toggle")
if script and script.HotkeyCount == 0 then
script.createHotkey({ VK_XBUTTON1 }, mrhActivate)
script.createHotkey({ VK_XBUTTON2 }, mrhDeactivate)
end
|
|
|
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
|
|