Mirc script, sockread
I'm trying to make a script which will take data from a webpage and post it on irc.
I've managed to do it, but im not able to开发者_JAVA技巧 make it repeat its job multiple times.
This is what i tried:
alias mib {
var %i = 0
%bitka = $1
while (%i <= 4) {
$myb(%bitka)
inc %i 1
}
}
Alias "myb" works, it gets the data and posts it.
I tried to make it repeat what alias "myb" does 5 times, but it does it only once. Idealy i want it to keep posting that data until i turn it off, but i wanted to go with baby steps. Not successfuly though.
Help is appreciated. Thanks.
Value-returning functions in mIRC are called identifiers, they are prefixed with the $ sigil. A non-value returning function is called a command and their syntax is a bit different to that of identifiers. If alias "myb" is not supposed to return anything, as understood by your code, it should be changed to command syntax. If your alias returns something, as your code is, it will be executed by mIRC as if it was a command, which can result in undesired behavior.
alias mib {
var %i = 0
while (%i < 5) {
myb $1-
inc %i
}
}
No recursion at mIRC. Try using Signals.
/timer 1 4 $myb(%bitka)
This does repeat it 4 times with 1 second delay in between. I gues this is what you want. You can also check my website for another sockread script.
精彩评论