$chanchk - Channel Check

By h3lp on Mar 05, 2005

; $chanchk($nick,N) = return same channel value.

; $chanchk($nick,N,s) = return same channel name. eg: #hawkee #mirc #php

; $chanchk($nick,N,s,a) = return same channel name and nick access. eg: @hawkee +#mirc #php

; N = number. 0 means all. 1,2 or 3 return the specific channel

; s = show channel

; a = show channel and nick access

alias chanchk {
  var %2, %3, %m, %n
  if ($1) {
    if ($2 isnum) && ($2 == 0) %2 = $comchan($1,$2)
    elseif ($2 > 0) {
      if ($3) %3 = $comchan($1,$2)
      if ($4) { %m = 1 | while ($mid($prefix,%m,1)) { $iif($nick(%3,$1,$mid($prefix,%m,1)),%3 = $replacecs(%3,$comchan($1,$2),$mid($prefix,%m,1) $+ %3)) | inc %m } }
      return $iif($3 != s || $4 != a,12* insufficient parameters,%3)
    }
    else return 12* insufficient parameters
  }
  if ($3 == s) && (%2) { %n = 1 | while (%n <= %2) { %3 = %3 $+ $comchan($1,%n) $+ $chr(160) | inc %n } }
  if ($4 == a) && (%3) {
    %n = 0
    while ($gettok(%3,%n,160)) {
      %m = 1
      while ($mid($prefix,%m,1)) { $iif($nick($gettok(%3,%n,160),$1,$mid($prefix,%m,1)),%3 = $replacecs(%3,$gettok(%3,%n,160),$mid($prefix,%m,1) $+ $gettok(%3,%n,160))) | inc %m }
      inc %n
    }
  }
  return $iif($2 && $2 !isnum || $3 && $3 != s || $4 && $4 != a,12* insufficient parameters,$iif(%3,%3,$iif(%2,%2)))
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.