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 


Some one build this loop please

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

Joined: 11 Mar 2016
Posts: 231

PostPosted: Sat Oct 28, 2017 4:56 pm    Post subject: Some one build this loop please Reply with quote

I want to wait 3 seconds every three jumps in the game .



I have counter address which count the jumps increase one for every jump :

_counter

I need some one to build the loop with lua :

ex :
a=read [_counter]
wait 1 sec
b=read [_counter]

if (b-a) >=3
wait three sec

back to loop
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Oct 28, 2017 7:28 pm    Post subject: Reply with quote

Code:
if jumpTimer == nil then
  jumpTimer = createTimer(nil, false)
end
jumpTimer.Interval = 1000
jumpCounter = 0
jumpTimer.OnTimer = function(timer)
  local counter = readInteger("_counter")
  if timer.Interval == 1000 then
    if counter - jumpCounter >= 3 then
      jumpCounter = counter
      print("do something")
      timer.Interval = 3000
    end
  else
    print("done waiting")
    timer.Interval = 1000
  end
end
jumpTimer.Enabled = true
Back to top
View user's profile Send private message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Sun Oct 29, 2017 6:16 am    Post subject: Reply with quote

Thanks again and again ^^ worked
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