Posted: Thu May 23, 2019 6:26 pm Post subject: Basic Lua script ( Need help)
I have been trying to do the auto pot function but it does not work. Here is my code
This code will cause CE not working after execute the code, after that it keeps repeating 111111 even hp is higher than 400 and keep typing 1 every where
Code:
local hp = 'nano.exe+2C67830'
local hpvalue = readInteger(hp)
print(hpvalue)
checkIntT = createTimer()
checkIntT.Interval = 100
checkIntT.OnTimer = function(sender)
if hpvalue < 400 then
doKeyPress("1")
checkIntT.Enabled = false
end
Another code that does not work
Code:
local hp = 'nano.exe+2C67830'
local hpvalue = readInteger(hp)
local stop = 0
print(hpvalue)
while stop == 0 do
sleep(50)
if hpvalue < 400 then
doKeyPress("1")
end
end
What I want is just making it looks for HP then press 1 if hp below 400 and keep repeating until i press ESC
local hp = 'nano.exe+2C67830'
checkIntT = createTimer()
checkIntT.Interval = 100
checkIntT.OnTimer = function(timer) -- The timer itself is passed not the sender.
local hpvalue = readInteger(hp) -- read the value inside the timer function.
if hpvalue < 400 then
doKeyPress(VK_1) -- Needs to be a "Virtual Key Code"
checkIntT.Enabled = false -- This will disable the timer.
end -- Missing an END statement
end
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