mIRC Home    About    Download    Register    News    Help

Print Thread
#272417 19/02/24 12:27 PM
Joined: Nov 2021
Posts: 93
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 93
greetings folks,

i have been using this alias for mass voicing with works fine except on some ircds dont allow mass voicing so i wonder how to add a delay of like 5 seconds between the voices in this alias

Code

alias vall {
  if ($nick(#,$me,!@%&~)  || o isin $usermode) {
    var %x = $nick(#,0,r) | while (%x) {
      if ($nick(#,%x,r) != $me && !$nick(#,$v1,!~&@%)) {  var %r = %r $nick(#,%x,r) }
      if ($numtok(%r,32) = $modespl) { mode # + $+ $str(v,$modespl) %r | unset %r }
      dec %x
    }
    if (%r) { mode # + $+ $str(v,$numtok(%r,32)) %r }
  }
}


thanks in advance.

Joined: Nov 2021
Posts: 93
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 93
i came up with this only it doesnt seem to do the mass voices in alphabetical order it starts from z to a instead of other way around:


Code

Alias vall {
  var %chan = $iif(($1),#$1,$active)
  if ($nick( %chan ,$me,!@%&~)  || o isin $usermode) {
    var %timer 1
    var %x = $nick( %chan ,0,r) , %lines = 0 | while (%x) {
      if ($nick( %chan ,%x,r) != $me && !$nick( %chan ,$v1,!~&@%)) {  var %r = %r $nick( %chan ,%x,r) }
      if ($numtok(%r,32) = $modespl) { 
        .timer -md 1 $calc(%lines * 5000) .mode %chan  + $+ $str(v,$modespl) %r
        unset %r 
        inc %lines
      }
      dec %x 
    }
    if (%r) { .timer -md 1 $calc(%lines * 5000) .mode %chan + $+ $str(v,$numtok(%r,32)) %r }
  }
}



Last edited by Simo; 21/02/24 04:01 PM.
Joined: Jan 2012
Posts: 301
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 301
For mass set the mode +v (voice) on channel with a delay of 5 seconds, try using this code:
Code
alias vall {
  if ($me !isop $active) { echo -a Your nickname must have an @ status on the channel $active | return }
  var %users $nick($active,0,r) | var %i 1 | while (%i <= %users) {
    var %user $nick($active,%i,r)
    if (%user != $me) { var %nm = %nm %user }
    if ($numtok(%nm,32) == $modespl) { $timerdelay mode $active $+(+,$str(v,$modespl)) %nm | unset %nm }
    inc %i
  }
  if (%nm) { $timerdelay mode $active $+(+,$str(v,$numtok(%nm,32))) %nm }
  if ($var(%va_sec)) { unset %va_sec }
}
alias -l timerdelay { if (!%va_sec) { set %va_sec 0 } | else { set %va_sec 5 } | return .timerVALL $+ $ticks 1 %va_sec }

To check, enter the command: /vall

Note: Your nickname must have an @ status on the channel.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 93
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 93
thanks epic, ive tested your posted code and it sets the first line ( $modespl ) instant followed by a line less then $modespl and after that nothing and ive tested with like 60 test nicks

Joined: Nov 2021
Posts: 93
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 93
ive tested your code again and it seems to be fine now thanks epic apreciated.

Joined: Jan 2012
Posts: 301
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 301
There were some errors in the code that I provided you earlier because I made it in a hurry and I did not have the opportunity to test the code on a channel with a large number of users.
Logically, the first line with the command to set the modes should be without delay, and all subsequent ones should be sent every 5 seconds, one after the other.
I made some changes that should correct all the shortcomings. This should now work correctly.

Try using this code:
Code
alias vall {
  var %chan $active | if (%chan !ischan) { echo -a This command can only be done on a channel. | return }
  if ($me !isop %chan) { echo -a Your nickname must have an @ status on the channel %chan | return }
  var %users $nick(%chan,0,r), %i 1 | while (%i <= %users) {
    var %user $nick(%chan,%i,r) | if (%user != $me) { var %nm = %nm %user }
    if ($numtok(%nm,32) == $modespl) { inc %va_count | $timerdelay(%chan,%va_count) mode %chan $+(+,$str(v,$modespl)) %nm | unset %nm }
    inc %i
  }
  if (%nm) { inc %va_count | $timerdelay(%chan,%va_count) mode %chan $+(+,$str(v,$numtok(%nm,32))) %nm } | unset %va_count
}
alias -l timerdelay { return .timerVALL $+ $+(_,$1,_,$2) 1 $calc(5 * $2 - 5) }


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 93
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 93
thanks Epic this seems to work proper now all the time, apreciated


Link Copied to Clipboard