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 


script by time for the trainer is closed?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 24, 2016 2:03 am    Post subject: script by time for the trainer is closed? Reply with quote

script to add airtime to trainer and close?
Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Wed Feb 24, 2016 8:00 am    Post subject: Re: script by time for the trainer is closed? Reply with quote

gallomk wrote:
script to add airtime to trainer and close?


I have trouble understanding what you are looking for, please explicate.
Back to top
View user's profile Send private message
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 24, 2016 8:46 am    Post subject: Re: script by time for the trainer is closed? Reply with quote

chris20194 wrote:
gallomk wrote:
script to add airtime to trainer and close?


I have trouble understanding what you are looking for, please explicate.



use it for some time and it closes.
Sorry for the bad expression.



Untitled 100.jpg
 Description:
 Filesize:  34.97 KB
 Viewed:  6129 Time(s)

Untitled 100.jpg


Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Wed Feb 24, 2016 10:00 am    Post subject: Reply with quote

Ah I get it now:

Code:
sleep(600000)
closeCE()
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Feb 24, 2016 10:24 am    Post subject: Reply with quote

i recommend running that in a thread , else look into the timer object
_________________
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
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 24, 2016 11:34 am    Post subject: Reply with quote

chris20194 wrote:
Ah I get it now:

Code:
sleep(600000)
closeCE()


Thank you!

Dark Byte wrote:
i recommend running that in a thread , else look into the timer object



Code:
function CloseTrainer()
        sleep(600)
   form_hide(MainGUI_1)
   closeCE()
end


when I close the Triner takes that time. as I get it closes automatically after some time?

sorry for my bad English!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Feb 24, 2016 12:04 pm    Post subject: Reply with quote

sleep will freeze the thread it runs for the given amount in milliseconds (600000 ms = 600 seconds = 10 minutes)

calling sleep in the thread that handles user input will stop it from responding to mouse clicks, keyboard input, repaint request, etc... for the given amount of time

that is why i suggest createNativeThread, or the Timer object (interval is in milliseconds as well)

edit:you actually want it to wait after closing?

_________________
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
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 24, 2016 12:48 pm    Post subject: Reply with quote

Dark Byte wrote:
sleep will freeze the thread it runs for the given amount in milliseconds (600000 ms = 600 seconds = 10 minutes)

calling sleep in the thread that handles user input will stop it from responding to mouse clicks, keyboard input, repaint request, etc... for the given amount of time

that is why i suggest createNativeThread, or the Timer object (interval is in milliseconds as well)

edit:you actually want it to wait after closing?



open the trainer and closes 10 minutes only
java example

Code:
<script language="JavaScript">

function cerrar() {
var ventana = window.self;
ventana.opener = window.self;
ventana.close();
}
setTimeout('cerrar()',5000); //5000 = 5 segundos.
</script>
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Feb 24, 2016 1:08 pm    Post subject: Reply with quote

I think he's wanting to make a 10-minute demo trainer. Although, I'm not sure how practical that would be.

Do as DB suggested and use create thread.
Back to top
View user's profile Send private message
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 24, 2016 1:12 pm    Post subject: Reply with quote

++METHOS wrote:
I think he's wanting to make a 10-minute demo trainer. Although, I'm not sure how practical that would be.

Do as DB suggested and use create thread.


10 minutes of use and closes only



Untitled 100.jpg
 Description:
 Filesize:  33.5 KB
 Viewed:  6054 Time(s)

Untitled 100.jpg


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Feb 24, 2016 1:16 pm    Post subject: Reply with quote

Yes...that's a demo trainer. But why? What will stop people from reopening the trainer?
Back to top
View user's profile Send private message
gallomk
Newbie cheater
Reputation: 0

Joined: 13 Feb 2016
Posts: 15

PostPosted: Wed Feb 24, 2016 3:12 pm    Post subject: Reply with quote

++METHOS wrote:
Yes...that's a demo trainer. But why? What will stop people from reopening the trainer?


and why not? ¯\_(ツ)_/¯
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Feb 24, 2016 7:27 pm    Post subject: Reply with quote

Code:
t=createTimer(nil, false)
t.Interval=1000*60*10
t.OnTimer=function(t)
  closeCE()
end
t.Enabled=true
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