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 


Ctrl edit value

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

Joined: 27 Jul 2016
Posts: 124

PostPosted: Mon May 22, 2017 6:02 am    Post subject: Ctrl edit value Reply with quote

Hello. My idea is that example my value is 0011. If I choose Ctrl, value will be 0012. Then If I don't choose Ctrl, value will come back first value
Can anybody help me make the above idea? Very Happy
Back to top
View user's profile Send private message
NotJustSomeGuy
How do I cheat?
Reputation: 0

Joined: 21 May 2017
Posts: 7
Location: UK

PostPosted: Mon May 22, 2017 6:38 am    Post subject: Reply with quote

Couldn't you see what writes to the address then edit the instruction (or something similar) so when [Enabled] it adds 1 (or mov's 12 into it) and when [Disabled] it mov's 11 into it. When you save it to the address table, right click it and set a hotkey to Toggle it.

There's probably an easier way which just involves the address and no assembly but in the hotkey menu i can't see an increase when toggled and decrease when untoggled option.
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Mon May 22, 2017 8:04 am    Post subject: Reply with quote

Freeze it, set value to desired value, when desired value changes then change the value and CE will keep that value set. If you want a GUI then when your checkbox or whatever is selected/enabled you set the value to 12 and when it's deselected/disabled you set the value to 11.

For a checkbox you get code like this:
Code:
mr = getAddressList().getMemoryRecordByID(1)
function CECheckbox1Change(sender)
  mr.Active = true -- make sure it's frozen (really could do outside function)
  mr.value = sender.Checked and 12 or 11 -- remember lua is decimal by default
end


Here's an example for step 2 of the tutorial: https://www.dropbox.com/s/f569ne9akwkhhk6/set%20to%20x%20on%20enabled%20or%20y%20on%20disabled%20-%20Tutorial-i386.CT?dl=0

If that's not good enough then you'd need to use a script like NotJustSomeGuy mentioned (in the gui code you'd set mr.Active to sender.Checked and not mess with mr.value since scripts don't have a value for you to change).
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 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