 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
dreamfancys Newbie cheater
Reputation: 0
Joined: 09 May 2020 Posts: 13
|
Posted: Sun May 10, 2020 8:16 pm Post subject: Lua Script [I want to turn ON/OFF] |
|
|
I have a lua script. I want it to be active when I press the Delete key. And if you press the Delete key again, if it is active, get deactivated. Is this possible?
So when I press Delete, "pointer_on" will work. When I press Delete button for the second time, "pointer_off" will work if it is active. Do you understand what I mean? So I want to make On / Off with a single button.
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="18">
<CheatEntries/>
<UserdefinedSymbols/>
<LuaScript>
x = getMainForm()
x.WindowState = 'wsMinimized'
function myattach(timer)
if getProcessIDFromProcessName("test.exe") ~= nil then
object_destroy(timer)
openProcess("test.exe")
end
end
t=createTimer(nil);
timer_setInterval(t,10)
timer_onTimer(t,myattach)
function WriteSignatures(targetSignature, overrideSignature, codePage)
local byteLine = overrideSignature:gsub("%w+", "0x%0,"):sub(1,-2)
local results = AOBScan(targetSignature, codePage)
if (results == nil) then return end
for i = 0, results.Count-1 do
local address = getAddress(results.getString(i))
local lineCode = 'writeBytes('..address..','.. byteLine..')'
loadstring(lineCode)()
end
results.destroy()
end
function pointer_on()
local targetSignature = '54 73 6C 52 65 63 6F 69 6C 43 6F 6D 70 6F 6E 65 6E 74'
local overrideSignature = '91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91'
local codePage = '-X*C*W'
WriteSignatures(targetSignature, overrideSignature, codePage)
end
function pointer_off()
local targetSignature = '91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91'
local overrideSignature = '54 73 6C 52 65 63 6F 69 6C 43 6F 6D 70 6F 6E 65 6E 74'
local codePage = '-X*C*W'
WriteSignatures(targetSignature, overrideSignature, codePage)
end
createHotkey(pointer_on, VK_DELETE)
createHotkey(pointer_off, VK_DELETE)
</LuaScript>
</CheatTable>
|
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1516
|
Posted: Mon May 11, 2020 12:47 am Post subject: |
|
|
Code: | local state = 0
function pointer_on()
state = 1
local targetSignature = '54 73 6C 52 65 63 6F 69 6C 43 6F 6D 70 6F 6E 65 6E 74'
local overrideSignature = '91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91'
local codePage = '-X*C*W'
WriteSignatures(targetSignature, overrideSignature, codePage)
end
function pointer_off()
state = 0
local targetSignature = '91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91'
local overrideSignature = '54 73 6C 52 65 63 6F 69 6C 43 6F 6D 70 6F 6E 65 6E 74'
local codePage = '-X*C*W'
WriteSignatures(targetSignature, overrideSignature, codePage)
end
function pointer_on_off()
if state==0 then
pointer_on()
else
pointer_off()
end
end
createHotkey(pointer_on_off, VK_DELETE) |
_________________
|
|
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
|
|