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 |