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 


[VB] Insert a delay into a script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
O-RLY
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 170

PostPosted: Fri Aug 24, 2007 4:59 pm    Post subject: [VB] Insert a delay into a script Reply with quote

How do I make the script to stop, then keep runing after specific time.

Example:
Code:

Command1.Caption = "9"
//Stoping here, and keep run the script after 5 seconds
Command1.Caption = "8"
Back to top
View user's profile Send private message
Xanatos
I post too much
Warning
Reputation: 18

Joined: 06 May 2007
Posts: 2559
Location: US

PostPosted: Fri Aug 24, 2007 5:22 pm    Post subject: Reply with quote

I dunno about VB, but its usually like

Code:
Pause 100


or

Code:
Delay 100


(100 being the parameters for the delay.)

_________________
Back to top
View user's profile Send private message
zart
Master Cheater
Reputation: 0

Joined: 20 Aug 2007
Posts: 351
Location: russia

PostPosted: Fri Aug 24, 2007 5:24 pm    Post subject: Reply with quote

Pause
_________________
0x7A 0x61 0x72 0x74

TEAM RESURRECTiON
Back to top
View user's profile Send private message
O-RLY
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 170

PostPosted: Fri Aug 24, 2007 5:26 pm    Post subject: Reply with quote

I've already tried it =]
doesn't working.. that's why I'm asking for help =]

Its VB6.

@zart
thanks.. I will try it now.
Back to top
View user's profile Send private message
XTrinityX
Expert Cheater
Reputation: 0

Joined: 18 May 2006
Posts: 123
Location: Connecticut

PostPosted: Fri Aug 24, 2007 5:42 pm    Post subject: Reply with quote

When I need to do a custom delay, I use this sub that I make myself.
Code:
Public Sub CustomDelay(ByVal Milliseconds as Integer)
dim init as integer
init = GetTickCount()
While init > (GetTickCount() - Milliseconds)
   Application.DoEvents()
End While


You may need to define GetTickCount() at the top of your code.
Code:
Private Declare Function GetTickCount Lib "Kernel32" () As Integer


This procedure is better than Sleeping because your application will still be responsive to other events going on during the delay.
Back to top
View user's profile Send private message AIM Address
O-RLY
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 170

PostPosted: Fri Aug 24, 2007 5:58 pm    Post subject: Reply with quote

Thanks, But I've got the "Sleep" method and its exacly what I need.

Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Code:

Runing...
Sleep 5000
Runing after 5 seconds.



Thanks everybody.

Edit:
Trinity how do I use your script?
Back to top
View user's profile Send private message
XTrinityX
Expert Cheater
Reputation: 0

Joined: 18 May 2006
Posts: 123
Location: Connecticut

PostPosted: Fri Aug 24, 2007 7:28 pm    Post subject: Reply with quote

I am not sure how you do it in VB6. The code I wrote is for VB.NET. If you know enough VB6, you should be able to figure it out.
Back to top
View user's profile Send private message AIM Address
O-RLY
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 170

PostPosted: Sat Aug 25, 2007 9:06 am    Post subject: Reply with quote

Yea but how I making the script to stop runing?
Which command do I use?
And how do I setting the amount of time of the delay??

VB.NET script is fine, I could just write my program with .NET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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