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 to change freeze time interval in LUA?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
happyreadygo
Advanced Cheater
Reputation: 1

Joined: 14 Sep 2011
Posts: 87

PostPosted: Tue Oct 30, 2012 2:12 am    Post subject: How to change freeze time interval in LUA? Reply with quote

I need to change freeze inteval to 10ms , currently 100ms is noticed by the game and it make an unwish glitch. It's no problem at 10ms.

I know that I should "find out what write to this address" and changing it there , It 's garantee 100% of the value and lower cpu usage ,but it's not possible in this case . the game crashed whenever the find out function begin.

I changed the cheat engine setting and set freeze time to 10ms. it works when the code is execute but it's not when I save it as trainer. it seems the code is not freeze at all at 10ms when it's trainer.

I am currently using.
Code:
   mr=addresslist_getMemoryRecordByID(addresslist,90)
   memoryrecord_freeze(mr,1)
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue Oct 30, 2012 7:38 am    Post subject: Reply with quote

use your own freeze function and timer:


Code:

address = 0xXXXXXXXX
value = 50

function freeze(sender)
  writeInteger(address,value)
end

FreezeTimer = createTimer(nil,true)
timer_setInterval(FreezeTimer, 10)
timer_onTimer(FreezeTimer, freeze)


OR

Code:

(...)
mr = addresslist_getMemoryRecordByID(addresslist,90)
address = memoryrecord_getAddress(mr)
value = 50

function freeze(sender)
  writeInteger(address,value)
end

FreezeTimer = createTimer(nil,true)
timer_setInterval(FreezeTimer, 10)
timer_onTimer(FreezeTimer, freeze)

_________________
Back to top
View user's profile Send private message MSN Messenger
happyreadygo
Advanced Cheater
Reputation: 1

Joined: 14 Sep 2011
Posts: 87

PostPosted: Wed Oct 31, 2012 12:37 am    Post subject: Reply with quote

thanks mgr.inz.Player


can we just sent parameter to the freeze function like this?
timer_onTimer(FreezeTimer, freeze(parameter1))
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Oct 31, 2012 2:12 am    Post subject: Reply with quote

no, it must be a function (sender) calling method

also, you don't even need to create the timer yourself
Just use getFreezeTimer() to get the freeze timer

_________________
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
akeaglevet
How do I cheat?
Reputation: 0

Joined: 05 Oct 2012
Posts: 4

PostPosted: Fri Nov 02, 2012 1:36 pm    Post subject: Reply with quote

DB: Can you use getFreezeTimer() to change the write interval of the freeze function? Can you give us a little sample of what this looks like?
_________________
Yep, I'm a bird veterinarian and an amateur programmer/hacker...
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Nov 02, 2012 2:22 pm    Post subject: Reply with quote

Once you have the freezetimer object you can use timer_setInterval(freezetimer, interval)

e.g:
timer_setInterval(getFreezeTimer(), 10)

_________________
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
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