Posted: Thu Mar 26, 2020 5:43 pm Post subject: Hotkeys made with lua not working...
I am a newbie who's just started using cheat engine and lua.
I'm currently making my own trainer and trying to bind a hotkey to function but it doesn't work for some reason.
If anyone could help me, it would be greatly appreciated.
Thank you in advance!
Code:
Code:
UDF1.Show()
function UDF1_CEPanel8Click(sender)
openProcess('blablabla.exe')
autoAssemble[[
alloc(newmem,2048,"blablabla.exe"+1E005E)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
//.jne blablabla.exe+1E0068
test ecx,ecx
jne blablabla.exe+1E00F4
function UDF1_CEPanel6Click(sender)
if sender.showhint == false then
sender.showhint = true
sender.color = '$0009FF09'
autoAssemble[[
"blablabla.exe"+30D1F7:
jne 7FF7C6BFD2AA
"blablabla.exe"+2BA677:
jne 7FF7C6BAA6F7
"blablabla.exe"+2B9034:
jne 7FF7C6BA9129
"blablabla.exe"+2FC777:
db 90 90
"blablabla.exe"+30D993:
je 7FF7C6BFD9F2
{$LUA}
memrec = getAddressList().getMemoryRecordByDescription
memrec( 'counter' ).Value = "2"
memrec( 'counter' ).Active = true
{$ASM}
]]
else
sender.showhint = false
sender.color = '$000000D9'
autoAssemble[[
"blablabla.exe"+30D1F7:
je 7FF7C6BFD2AA
"blablabla.exe"+2BA677:
je 7FF7C6BAA6F7
"blablabla.exe"+2B9034:
je 7FF7C6BA9129
"blablabla.exe"+2FC777:
db 75 0C
"blablabla.exe"+30D993:
jne 7FF7C6BFD9F2
{$LUA}
memrec = getAddressList().getMemoryRecordByDescription
memrec( 'counter' ).Value = "1699966543"
memrec( 'counter' ).Active = false
{$ASM}
]]
end
end
function UDF1_CEPanel7Click(sender)
if sender.showhint == false then
sender.showhint = true
sender.color = '$0009FF09'
autoAssemble[[
"blablabla.exe"+30D993:
je 7FF7C6BFD9F2
]]
else
sender.showhint = false
sender.color = '$000000D9'
autoAssemble[[
"blablabla.exe"+30D993:
jne 7FF7C6BFD9F2
]]
end
end
function UDF1_CEPanel5Click(sender)
if sender.showhint == false then
sender.showhint = true
sender.color = '$0009FF09'
autoAssemble[[
"blablabla.exe"+30D1F7:
jne 7FF7C6BFD2AA
]]
else
sender.showhint = false
sender.color = '$000000D9'
autoAssemble[[
"blablabla.exe"+30D1F7:
je 7FF7C6BFD2AA
]]
end
end
function UDF1_CEPanel10Click(sender)
closeCE()
end
function UDF1_CEPanel1MouseDown(sender, button, x, y)
UDF1.DragNow()
end
The sender parameter isn't set to GUI elements when invoked from the hotkey function- it's set to the timer, which doesn't have the expected properties.
Make an anonymous wrapper function and invoke the callback with passing the GUI element:
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