|
Delay function in VBScript
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Heathen
(8 posts) bio
|
| Date |
Thu 09 Sep 2004 05:44 PM (UTC) [ quote
] |
| Message |
I'm doing a simple 'read from file and output to mud' script, that's no problem at all, however, I want to be able to add a delay between each line being sent to the MUD, however, I'd like to be able to do it by milliseconds rather than seconds (which is what I'm doing at the moment). Here's what I have right now:
Alias: readfile * *
dim nST, nTT, nX
dim objFS
dim objTS
dim file
set objFS = CreateObject("Scripting.FileSystemObject")
if objFS.FileExists(world.getinfo (57) & "%1") then
set objTS = objFS.OpenTextFile(world.getinfo (57) & "%1")
do until objTS.AtEndOfStream
world.sendimmediate objTS.ReadLine
nST=Second(Now)
nTT=nST + %2
if nTT>=60 then nTT=nTT-60
do
nST=Second(Now)
loop until nST>=nTT
loop
else
world.colournote "red", "black", "This file doesn't exist in your worlds folder."
end if
(Send to script of course)
Any thoughts? I've seen several examples in VB using the rundll32 library to put the application in freeze for a certain amount of time but not only do they not work, that's not exactly what I'm after.
Thanks,
-Heathen | top |
|
| Posted by |
Flannel
USA (1,230 posts) bio
|
| Date |
Reply #1 on Thu 09 Sep 2004 06:30 PM (UTC) [ quote
] |
| Message |
| Why dont you just use the speedwalk queue? Its delay is in ms. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | top |
|
| Posted by |
Heathen
(8 posts) bio
|
| Date |
Reply #2 on Thu 09 Sep 2004 06:34 PM (UTC) [ quote
] |
| Message |
Because what I'm reading in is a script file which frequently uses ( ) symbols and errors out the speedwalk system. I tried what you sugested without success for that reason :-\
-Heathen | top |
|
| Posted by |
Heathen
(8 posts) bio
|
| Date |
Reply #3 on Thu 09 Sep 2004 07:09 PM (UTC) [ quote
] |
| Message |
Just found the world.queue function, works like a charm.
Thanks,
-Heathen | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
11,121 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )