|
Joined: Feb 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2004
Posts: 5 |
sorry if it has been posted before, but I couldnt find it in search. would it be possible, or is there, a command to pause scripts? so that it gives a little time before going to the next part, like
on *:text:!opall:#:{
var %oa 0
:nextop
inc %oa
if ($nick(#,%oa) == $null) { halt }
mode # +o $nick(#,%oa)
pause 5
goto nextop
}
where pause 5 would be pause for 5 seconds, then goto nextop to avoid flooding off and such? I know that could be wrote differently to avoid flooding, but other scripts (that I cannot think of at this moment) are either hard to do, or impossible.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Look here for how to op multiple users iin one line. on @*:text:!opall:#:{
var %i = 1,%a
while $nick(#,%i,a,o) {
var %a = %a $ifmatch
if $modespl // %i {
mode # $str(o,$modespl) %a
var %a
}
inc %i
}
if $numtok(%a,32) { mode # $str(o,$ifmatch) %a }
} That's a pretty dangerous command to have posted in open channel with no nick|address|whatever checks for who is using it.
|
|
|
|
Joined: Feb 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2004
Posts: 5 |
I know that it isnt a good command for public, it was an example script, srry. I meant for the script to pause processing for the time in seconds after /pause N and if it is possible, or already in there somewhere
ty anyway
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Yeah I just thought maybe decreasing the lines sent might have suited your purpose. It would cut down the risk of flooding. mIRC doesn't have a pause command, perhaps you could make use of /sleep by OnlineYou could use a timer to call an alias. This timer ops one person then resets, to do the same again in 5 secs. on *:text:!opall:#:opall #
alias -l opall {
if $nick($1,1,a,o) {
mode $1 +o $ifmatch
.timer 1 5 opall $1
}
} Or you could use a timer in a different way This could potentially result in a lot of timers being set. on *:text:!opall:#:{
var %i = 1,%t = 0
while $nick(#,%i,a,o) {
.timer 1 %t mode # +o $ifmatch
inc %i
inc %t 5
}
}
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
mirc handles lots of timers well <grin> Once I pressed ctrl-v twice with ".timer 0 1 " buffered and didnt notice it. got this... .timer 0 1 .timer 0 1 somealaishere 30 seconds after starting it im like going WHAT WHAT WHAT!?!!!?!??!?!
|
|
|
|
Joined: Feb 2004
Posts: 206
Fjord artisan
|
Fjord artisan
Joined: Feb 2004
Posts: 206 |
I found myself in the need of a pause command. In some instances, timers would not work - all it does is set the timer, and then the rest of the script executes (in my experience).
alias pause { %currentticks = $ticks %delay = $iif($1,$1,1) %endticks = $calc( %currentticks + (1000 * %delay )) while ($ticks < %endticks) { } }
Usage: /pause <seconds>
a default value of 1 second (%delay = $iif($1,$1,1)) is set. I have not done any error checking for nonsensical input (very large numbers, text etc). A negative number will effectively give a pause of 0 !
It may not be accurate to the millisecond - it will depend on what sort of workload your PC is under.
Cheers!
Darwin_Koala
Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
the problem with that pause is it pauses everything in mirc, including downloads, no other activity well occur during it.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
all hes trying to do is op a few nicks, he only needed to put timer and the delay in front of the op command.
on *:text:!opall:#:{ var %oa 0 :nextop inc %oa if ($nick(#,%oa) == $null) { halt } .timer 1 $calc((%ao - 1) * 5) mode # +o $nick(#,%oa) goto nextop }
|
|
|
|
|