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 


Need script to automatically change

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

Joined: 29 Apr 2016
Posts: 2

PostPosted: Fri Apr 29, 2016 6:31 pm    Post subject: Need script to automatically change Reply with quote

Hi,

Is there a way to automatically change a value in a process at a regular interval?

For example: change a value from 0 to 5000 every 2 minutes.

Thanks in advance!
Back to top
View user's profile Send private message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Fri Apr 29, 2016 6:39 pm    Post subject: Re: Need script to automatically change Reply with quote

zeyuanfu wrote:
Hi,

Is there a way to automatically change a value in a process at a regular interval?

For example: change a value from 0 to 5000 every 2 minutes.

Thanks in advance!


Yes, with Lua or ASM.
Lua: you just create a timer with the interval 120000 (because 2 minutes = 120000 milliseconds), and in the onTimer event,change the value as you want.
Like this, will write the value 123 to the address 00400000 every 2 minutes:

Code:
local t = createTimer(false)
t.Interval,t.onTimer = 120000,function(this)
return writeInteger(0x00400000,123);
end


ASM: You inject some code to the target process that 1) writes the value 5000 to the address. 2) calls sleep with the given duration. 3) jumps back to the beginning, then create a thread on the beginning of that block.

Option 1 is simplier I think.
Back to top
View user's profile Send private message
zeyuanfu
How do I cheat?
Reputation: 0

Joined: 29 Apr 2016
Posts: 2

PostPosted: Fri Apr 29, 2016 6:57 pm    Post subject: Reply with quote

Thanks! I got the script working now.
Is there any way I can commend you or something similar?
Back to top
View user's profile Send private message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Sat Apr 30, 2016 11:22 am    Post subject: Reply with quote

zeyuanfu wrote:
Thanks! I got the script working now.
Is there any way I can commend you or something similar?


You're welcome, on this forum, it's possible to give reputation for helpful posts (by clicking the thumbs up on the top right of the post pad, not sure if a certain post count is required to do it) , but it doesn't really matter for me, the "Thanks" is more than enough Smile.
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