mIRC Home    About    Download    Register    News    Help

Print Thread
script pause #72097 19/02/04 09:12 PM
Joined: Feb 2004
Posts: 5
E
eggburt Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
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
Code:
 
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.

Re: script pause #72098 19/02/04 10:25 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Look here for how to op multiple users iin one line.
Code:
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.

Re: script pause #72099 19/02/04 10:39 PM
Joined: Feb 2004
Posts: 5
E
eggburt Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
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

Re: script pause #72100 19/02/04 11:28 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
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 Online

You could use a timer to call an alias.
This timer ops one person then resets, to do the same again in 5 secs.
Code:
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.
Code:
on *:text:!opall:#:{
  var %i = 1,%t = 0
  while $nick(#,%i,a,o) {
    .timer 1 %t mode # +o $ifmatch
    inc %i
    inc %t 5
  }
}

Re: script pause #72101 20/02/04 12:02 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:

lot of timers being set.


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!?!!!?!??!?!

Re: script pause #72102 21/02/04 03:56 AM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
Fjord artisan
Offline
Fjord artisan
D
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!
Re: script pause #72103 21/02/04 07:52 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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.

Re: script pause #72104 21/02/04 12:56 PM
Joined: Sep 2003
Posts: 70
M
madewokherd Offline
Babel fish
Offline
Babel fish
M
Joined: Sep 2003
Posts: 70
You could use /sleep: http://www.mircscripts.org/comments.php?id=1729

Unfortunately, that one has to write to the harddrive to do it. smirk

Re: script pause #72105 21/02/04 02:39 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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
}