Posted: Mon Aug 24, 2015 4:40 pm Post subject: Having problems with lua trainer
I'm having a problem when I have a trainer with a single checkbox. The checkbox calls maxSpeed onChange and then I check if it's checked inside the function. The problem is that it's doing the full function on checked and unchecked. Am I doing something wrong here? @.@
Code:
function maxSpeed(sender)
if (checkbox_getState(sender) == 1) then
results=AOBScan("08 00 00 00 0F 00 00 00 36 36 36 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 21 24 00")
if (results~=nil) then
count=stringlist_getCount(results)
if (count==1) then
address=stringlist_getString(results,0)
writeFloat(getAddress(address)-384, 20.6399)
end
end
object_destroy(results)
results=nil
end
end
function maxSpeed(sender)
if checkbox_getState(sender) == 1 then
print("true")
else
print("false")
end
end
Make sure you execute the script with your function declaration in it so it's using the latest code.
You sure it's properly set to the checkbox's OnChange event?
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