Hello. I am trying to create a delay before i post a line from a read file. What I am trying to do, exactly, is to read a line, decide whether it is a delay token, and if it is, to set the delay time accordingly. However, if it is a normal line of text, then the script should message the line of text to the user.
I hope the idea is clear enough. So in a nutshell.. Read a line..determine if its a speed token..if it is..set new speed.. then.. delay a set time amount..them message a line.. Then do it again until the end of the file..
Here is the code. It worked at first.. But suddenly, now it doesn't..
on *:TEXT:!test:?:{
var %temp 1
while ($read(scripts/test.txt, n, %temp)) {
if (#speed=* iswm $v1) {
var %speed $gettok($v2,2,61))
var %n 0
}
else {
inc %n
timer -m 1 $calc(%speed * n) msg $nick $safe($v2)
}
inc %temp
}
}
alias safe return $!decode( $encode($1-, m) ,m)
So now I am not sure why this is not working.. what is happening, is that it shoots out about 3 lines real quick..pauses for about 500 milliseconds.. then shoots out 3 more lines.. and on and on until the end of the text file.
The command in the text file is as follows..
some text here
#speed=5000
more text here
rest of text here