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 


Toggle boolean hotkey without AA

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Tue Nov 09, 2021 9:24 am    Post subject: Toggle boolean hotkey without AA Reply with quote

I haven't seen many people use this feature, so just showing it:

If you have a boolean value memoryrecord, you can use a set value hotkey and give it the value
Code:

[value ~ 1]


which will xor the current value with 1, which results in an effective toggle on/off

_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Tue Nov 09, 2021 10:04 am    Post subject: Reply with quote

Excellent tip. Will keep that in the memory bank. Thanks!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Tue Nov 09, 2021 12:20 pm    Post subject: Reply with quote

In general, setting the value of a memory record to a string wrapped in square brackets will evaluate the inside of the square brackets as a Lua expression and use the result as the value. The variables "value" and "oldvalue" are both set to the current value.

Right now, setting the value to "[LuaCodeHere]" will basically execute this code:
Code:
local oldValue = memoryrecord.getValue()
local value=oldvalue
return LuaCodeHere

I'm sure this could be used for more advanced stuff without needing to use createHotkey directly.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
÷÷Ben÷÷
How do I cheat?
Reputation: 0

Joined: 16 Nov 2021
Posts: 4

PostPosted: Tue Nov 16, 2021 10:43 am    Post subject: Reply with quote

Thanks for the tip !
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 Tutorials 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