Trying to build a trainer and have it run a Lua script by pressing a hotkey.
Is there a way to achieve this?
Most tutorials on YT talk about making trainers from scratch with Lua but could not find anything about this specific task I need for CE.
Any help or pointers will be mostly appreciated!
How to make a hotkey from a lua script?
-
- Expert Cheater
- Posts: 66
- Joined: Sat Sep 21, 2019 4:21 pm
- Reputation: 45
Re: How to make a hotkey from a lua script?
ooopps read that wrong
Re: How to make a hotkey from a lua script?
In the click event of the button on your trainer use if logic to determine which key is pressed:
Code: Select all
if keyCheck then keyCheck.destroy(); keyCheck = nil end
function executeScript(name)
if name == nil then return nil end
local mr = AddressList.getMemoryRecordByDescription(name)
if mr ~= nil then
mr.Active = true
end
end
local keyCheck = createTimer(getMainForm())
keyCheck.Interval = 100
keyCheck.OnTimer = function()
if isKeyPressed(VK_KEY) then
executeScript('my_script_name') -- i.e. the description used on the entry of the script
end
end
Who is online
Users browsing this forum: No registered users