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 


How would I set a button to switch values back and forth

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
ZepherZaper
How do I cheat?
Reputation: 0

Joined: 18 Dec 2013
Posts: 6

PostPosted: Thu Mar 26, 2015 6:55 pm    Post subject: How would I set a button to switch values back and forth Reply with quote

I want to make a hot key that switches from a value to another value and then back again when the button is pressed again how would I do this?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Mar 26, 2015 7:20 pm    Post subject: Reply with quote

Code:
[ENABLE]
{$lua}
getAddressList().getMemoryRecordByID(0).Value = "4"
[DISABLE]
{$lua}
getAddressList().getMemoryRecordByID(0).Value = "2"


You can find the ID of the record by copying it and pasting it into NotePad.
Back to top
View user's profile Send private message
ZepherZaper
How do I cheat?
Reputation: 0

Joined: 18 Dec 2013
Posts: 6

PostPosted: Sun Mar 29, 2015 3:13 am    Post subject: How do I use this script? Reply with quote

I don't know anything about lua script I know pointers and finding addresses and changing them and making a hot key do something in cheat engine I don't have a clue how to use lua script though so could you show me how to use this code?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Mar 29, 2015 8:05 am    Post subject: Reply with quote

You can simply copy that into an auto assembly script.
Use the ID of the pointer you've already setup and this LUA will change its value.

Open Memory View
Tools > Auto Assemble
Paste script
File > Assign to current cheat table
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