View previous topic :: View next topic |
Author |
Message |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Aug 24, 2007 4:59 pm Post subject: [VB] Insert a delay into a script |
|
|
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 |
|
 |
Xanatos I post too much
Reputation: 18
Joined: 06 May 2007 Posts: 2559 Location: US
|
Posted: Fri Aug 24, 2007 5:22 pm Post subject: |
|
|
I dunno about VB, but its usually like
or
(100 being the parameters for the delay.)
_________________
|
|
Back to top |
|
 |
zart Master Cheater
Reputation: 0
Joined: 20 Aug 2007 Posts: 351 Location: russia
|
Posted: Fri Aug 24, 2007 5:24 pm Post subject: |
|
|
Pause
_________________
0x7A 0x61 0x72 0x74
TEAM RESURRECTiON |
|
Back to top |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Aug 24, 2007 5:26 pm Post subject: |
|
|
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 |
|
 |
XTrinityX Expert Cheater
Reputation: 0
Joined: 18 May 2006 Posts: 123 Location: Connecticut
|
Posted: Fri Aug 24, 2007 5:42 pm Post subject: |
|
|
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 |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Aug 24, 2007 5:58 pm Post subject: |
|
|
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 |
|
 |
XTrinityX Expert Cheater
Reputation: 0
Joined: 18 May 2006 Posts: 123 Location: Connecticut
|
Posted: Fri Aug 24, 2007 7:28 pm Post subject: |
|
|
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 |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Sat Aug 25, 2007 9:06 am Post subject: |
|
|
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 |
|
 |
|