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 


Toggling value on freeze/unfreeze

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

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

PostPosted: Thu Jan 13, 2011 6:48 am    Post subject: Toggling value on freeze/unfreeze This post has 1 review(s) Reply with quote

Let's say you have an item in your list called "Energy" and you want to change the value when you press a key and put it back when it's deactivated.


Then just add this lua script to your table and run that (or manually execute it in the lua engine screen)
Code:

oldValue="";
function _memrec_Energy_activated(te)
  oldvalue=memrec_getValue(te)
  memrec_setValue(te,2000);
end

function _memrec_Energy_deactivated(te)
  memrec_setValue(te,oldvalue)
end

And then when it's frozen it sets the value to 2000 and when unfrozen it sets the value back to the original
You can then assign a hotkey to the cheat engine which freezes/unfreezes the entry and you'll be able to toggle the value with a hotkey

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
hack0535
Cheater
Reputation: 2

Joined: 16 Oct 2011
Posts: 29

PostPosted: Wed Jan 18, 2012 2:58 am    Post subject: Reply with quote

i want to ask what is (te)

in memrec_getValue(te)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 341

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

PostPosted: Wed Jan 18, 2012 1:25 pm    Post subject: Reply with quote

that is the given parameter to memrec_Energy_activated
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
tukey
How do I cheat?
Reputation: 0

Joined: 15 Sep 2012
Posts: 6

PostPosted: Wed Sep 19, 2012 12:35 pm    Post subject: Reply with quote

What does the te means? the pointer of Energy? Very Happy
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 23

Joined: 13 Sep 2011
Posts: 1393

PostPosted: Sat Jun 01, 2013 9:33 am    Post subject: Reply with quote

Thanks, never knew there's such easy way!
_________________
www.flashacking.net/
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message Visit poster's website
MindCaged
Newbie cheater
Reputation: 0

Joined: 25 Apr 2013
Posts: 12

PostPosted: Thu Jun 19, 2014 10:01 pm    Post subject: Reply with quote

I have a question. Where in the world is this documented? I can't find it anywhere. I've tried googling and everything and this is the only reference to this functionality. Are there any other events built-in? I love cheat engine, but the Lua documentation seems a bit spotty ATM.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 341

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

PostPosted: Fri Jun 20, 2014 2:11 am    Post subject: Reply with quote

Helpfile in the scripting section. Lua section in the forum, and wiki on the website
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
MindCaged
Newbie cheater
Reputation: 0

Joined: 25 Apr 2013
Posts: 12

PostPosted: Fri Jun 20, 2014 10:28 am    Post subject: Reply with quote

Err, let me clarify. I'm referring to the _activated and _deactivated callbacks. I actually had to download the 6.2 source code (6.4 source download seems to be broken for me.) and search it in order to even find them. I think I also found some _activating and _deactivating callbacks as well, although I'm not certain of the difference. Maybe one is a verification call.
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 -> LUA 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites