View previous topic :: View next topic |
Author |
Message |
RageRBoy Newbie cheater Reputation: 0
Joined: 04 Jan 2018 Posts: 10
|
Posted: Fri Mar 09, 2018 11:50 am Post subject: Checkbox dont seem to work. |
|
|
I did everything right but checkbox seems to not work.
I have 40 checkboxes on my trainer and the first ones work but other dont.
function CECheckBox20Change(sender)
if (checkbox_getState(Wigo.CECheckBox20) == 1) then
autoAssemble([[
"Growtopia.exe"+1DFEB5:
db 74
]])
else
autoAssemble([[
"Growtopia.exe"+1DFEB5:
db 75
]])
end
end
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Fri Mar 09, 2018 5:21 pm Post subject: |
|
|
seems like it should work... add some print statements to see if the code is being reached and if (return) values are as expected.
_________________
|
|
Back to top |
|
|
RageRBoy Newbie cheater Reputation: 0
Joined: 04 Jan 2018 Posts: 10
|
Posted: Sat Mar 10, 2018 6:50 am Post subject: |
|
|
FreeER wrote: | seems like it should work... add some print statements to see if the code is being reached and if (return) values are as expected. |
Im kinda new at cheat engine so what do u mean? What should i do to fix it??
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Mar 10, 2018 9:31 am Post subject: |
|
|
"add some print statements to see if the code is being reached and if (return) values are as expected."
can't really explain it any differently. There's a function called print that prints the stuff you pass to it. You can use that to check if code is being reached or not, if it prints then the print statement was reached if not it wasn't.
Similarly you can print values to check that they are what you'd expect, though you may need to use tostring first particularly in the case of booleans (true/false) and when the value is nil.
eg.
Code: |
someEventHandler(sender)
print("someClickHandler was called")
print("sender is", sender)
print(sender.ClassName) -- eg. CECheckBox
print(sender.Name) -- eg. CECheckBox20
print("sender is checked:", tostring(sender.Checked))
print("sender state is:", sender.state)
-- the script output window doesn't like just line feed for new lines
-- so use carriage return + line feed when printing via gsub/global substitute
print("Assembling", someScript:gsub('\n',\r\n'))
local success, info = AutoAssemble(someScript)
print("Success:", tostring(success))
if success then
for k,v in ipairs(info) do
print(k,v)
end
else print(tostring(info)) -- CE6.7 should return an error string
end
end
|
if something wasn't as expected, eg you called the handler manually without passing anything so sender was nil etc. then you're going to get errors because it tries to use them, that's fine, it's still doing it's job of telling you what's going on, you'll fix the issues that you find and remove the prints that are unnecessary as you go.
_________________
|
|
Back to top |
|
|
|