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 


When using the Togglebox button in a trainer..

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Fri Sep 25, 2015 4:02 pm    Post subject: When using the Togglebox button in a trainer.. Reply with quote

When using the Togglebox button in a trainer, let's say once I click it it'll set a breakpoint on an address, I've done that. But how would I revert the breakpoint when clicking on the button again? Like disable, revert the script that happens once it's clicked... help
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Sep 25, 2015 9:04 pm    Post subject: Reply with quote

Code:
if checkbox.Checked then
  -- enable
else
  -- disable
end

Code:
if myvar then
  -- disable
else
  -- enable
  myvar = true
end
Back to top
View user's profile Send private message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Sat Sep 26, 2015 8:22 pm    Post subject: Reply with quote

In fact, I meant a toggle button not the checkbox. The button you click on and it'll appear grey till you click it again.

The script you listed didn't work either way.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Sep 26, 2015 11:36 pm    Post subject: Reply with quote

If you're executing the function with each click, this script would work.
Code:
if myvar then
  -- disable
  myvar = false
else
  -- enable
  myvar = true
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25815
Location: The netherlands

PostPosted: Sun Sep 27, 2015 3:59 am    Post subject: Reply with quote

this works just fine in the onChange event
Code:

  if dumpy.flufflewufflemegabox.Checked then
    print("down")
  else
    print("up")
  end


You do have to change the objectname. (e.g if you never rename things, then instead of "dumpy" use UDF1, and instead of flufflewufflemegabox use CEToggleBox1 )

or use the sender parameter instead

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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