mIRC Home    About    Download    Register    News    Help

Print Thread
#21653 30/04/03 01:50 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Help me with this script. It shold not voice it self, and X! How to make this work? (eg: If X, myself and a other dude don't have voice, then just voice the dude. Since X and me allready have op, we don't need voice..

Code:
alias check-no-voice {
  ; name of the channel
  /set -u0 %chan #mychan
  ;we are on the channel, and have the power 
  if ($me ison %chan) && (($me isop %chan) || ($me ishop %chan)) {
    ; users without a voice exist 
    if ($nick(%chan, 0, a, v) > 0) {
      ; voice the users
      /set -u0 %a 1
      while (%a <= $nick(%chan, 0, a, v)) {
        /set -u0 %nicks $addtok(%nicks, $nick(%chan, %a, a, v), 32)
        ; group voice statements
        if ($numtok(%nicks, 32) == $modespl) || (%a == $nick(%chan, 0, a, v)) {
          /mode %chan + [ $+ [ $str(v, $modespl) ] ] %nicks
          /unset %nicks
        }
        /inc -u0 %a
      }
    }
  }
}


Do you understand me?

#21654 30/04/03 09:37 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Use /check-no-voice #channel
Code:
alias check-no-voice {
  if $me isop $$1 {
    var %i = 1,%a
    while $nick($1,%i,r) {
      %a = %a $ifmatch
      if $modespl == $numtok(%a,32) {
        mode $1 + $+ $str(v,$modespl) %a
        var %a
      }
      inc %i
    }
    if %a { mode $1 + $+ $str(v,$numtok(%a,32)) %a }
  }
}

#21655 30/04/03 11:27 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
alias check-no-voice {
  ; name of the channel
  /set -u0 %chan #mychan
  ;we are on the channel, and have the power
  if ($me ison %chan) && (($me isop %chan) || ($me ishop %chan)) {
    ; users without a voice and op exist
    if ($nick(%chan, 0, a, vo) > 0) {
      ; voice the users with no op
      /set -u0 %a 1
      while (%a <= $nick(%chan, 0, a, vo)) {
        /set -u0 %nicks $addtok(%nicks, $nick(%chan, %a, a, vo), 32)
        ; group voice statements
        if ($numtok(%nicks, 32) == $modespl) || (%a == $nick(%chan, 0, a, vo)) {
          /mode %chan + [ $+ [ $str(v, $modespl) ] ] %nicks
          /unset %nicks
        }
        /inc -u0 %a
      }
    }
  }
}


Not to get off topic, but does anyone have a problem with pasting code from the code /code tab and pasting in mirc? It seems my carrage returns don't carry over. Never really bothered me b4, 'til i tryed to help with a 50 line script..


-KingTomato
#21656 30/04/03 11:49 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
1. Untidy.
2. Slower.
3.
  - The "if $me ison %chan" check is redundant, if you are op|hop on a channel you are definitely on it.
  - The script is for undernet, so the ishop check is meaningless.
  - "if ($nick(%chan, 0, a, vo) > 0)" is pointless. "while $nick($1,%i,r)" includes that.

#21657 02/05/03 03:44 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
yezz, pasting into mirc is a problem.. so i past it into wordpad and then into the mirc.. laugh that works nice!


Link Copied to Clipboard