Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Checkbox dont seem to work.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
RageRBoy
Newbie cheater
Reputation: 0

Joined: 04 Jan 2018
Posts: 10

PostPosted: Fri Mar 09, 2018 11:50 am    Post subject: Checkbox dont seem to work. Reply with quote

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
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Fri Mar 09, 2018 5:21 pm    Post subject: Reply with quote

seems like it should work... add some print statements to see if the code is being reached and if (return) values are as expected.
_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
RageRBoy
Newbie cheater
Reputation: 0

Joined: 04 Jan 2018
Posts: 10

PostPosted: Sat Mar 10, 2018 6:50 am    Post subject: Reply with quote

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
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sat Mar 10, 2018 9:31 am    Post subject: Reply with quote

"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.

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites