Admin checker

By WannaKnow on Oct 01, 2008

I have created a script with can check if someone is @ % & * + ~ is on the channel

Why i have made it? I have seen a post from Maintaindew (Sorry if i typ your bad) and he said: Mayby you can if a admin is Owner in the channel, but i don't know how, So that's a reason why i posted it. (I had it already for a few weeks :P)

$check($chan,$nick)

can return:

5 = ~
4 = &
3 = @
2 = %
1 = +
0 = Nothing

Edit:

Now you can use $check($chan,$nick) >= 3) Then can @ & and ~ use the command

when you have $check($chan,$nick) == 3) Only @ can use the command

alias check {
  if ($left($1,1) == $chr(35)) {
    if ($2 ison $1) {
      %a = $left($nick($1,$2).pnick,1)
      if (%a == $chr(126)) !return 5
      elseif (%a == $chr(38)) !return 4
      elseif (%a == $chr(64)) !return 3
      elseif (%a == $chr(37)) !return 2
      elseif (%a == $chr(43)) !return 1
      else !return 0

    }
    else !return $color(info) -ae * /check: insufficient parameters
  }
  else !return $color(info) -ae * /check: insufficient parameters
}
on *:TEXT:*:#: {
  if ($1 == !test) {
    if ($check($chan,$nick) == 5) {
      msg $chan You are owner of the chan
    }
    if ($check($chan,$nick) == 4) {
      msg $chan You are Admin on the chan
    }
    if ($check($chan,$nick) == 3) {
      msg $chan You are an Op this chan
    }
    if ($check($chan,$nick) == 2) {
      msg $chan You are Half-Op
    }
    if ($check($chan,$nick) == 1) {
      msg $chan You have just a voice here
    }
    if ($check($chan,$nick) == 0) {
      msg $chan You dont have any status in this chan or you must login
    }
  }
}

Comments

Sign in to comment.
WannaKnow   -  Oct 02, 2008

Ok

 Respond  
Scakk   -  Oct 02, 2008

Works fine for me

[05:49] <WaiterJohn> !testing
[05:49] <Goofy|AFK> You dont have any status in this chan or you must login

WaiterJohn has no ops.

 Respond  
WannaKnow   -  Oct 02, 2008

It isent returnning anything when the user don't have a level

 Respond  
Scakk   -  Oct 01, 2008

Fixed that NIGathan. Thanks.

 Respond  
NIGathan   -  Oct 01, 2008

Except theres no v in pnick... Its a +.

 Respond  
Scakk   -  Oct 01, 2008

This does the same thing and uses the current channel as default.

alias check {
  if ($active ischan) { 
    var %a $pos(+%@&~,$left($nick($chan,$1).pnick,1),1)
    return $iif(%a,%a,$null)
  }
}
on *:TEXT:*:#: {
  if ($1 == !testing) {
    if ($check($nick) == 5) { msg $chan You are owner of the chan }
    if ($check($nick) == 4) { msg $chan You are Admin on the chan }
    if ($check($nick) == 3) { msg $chan You are an Op this chan }
    if ($check($nick) == 2) { msg $chan You are Half-Op }
    if ($check($nick) == 1) { msg $chan You have just a voice here }
    if (!$check($nick)) { msg $chan You dont have any status in this chan or you must login }
  }
}
 Respond  
NIGathan   -  Oct 01, 2008

Ah, I see. Sorry.

 Respond  
WannaKnow   -  Oct 01, 2008

NIGathan

I don't want to return the highest status, I want to return If they are owner or Admin so you dont only can use if ($nick isop $chan) {

Now you even can use this for Only & or ~

 Respond  
NIGathan   -  Oct 01, 2008

Nice script, I just a use this little identifier I wrote up for nIRC.

alias disnick {
  if (!$isid) halt
  if (!$2) {
    if ($cnick($1)) return  $+ $cnick($1).color $+ $1 $+ 
    else return  $+ $cnick(*).color $+ $1 $+ 
  }
  if ($left($nick($2,$1).pnick,1) != $left($1,1)) return  $+ $nick($2,$1).color $+ $left($nick($2,$1).pnick,1) $+ $1 $+ 
  else return  $+ $nick($2,$1).color $+  $+ $1 $+ 
}

Use: $disnick($nick,$chan) $chan is optional.
It returns the nick prefixed with their highest mode, it will also be colored according to your nick color setup.

Edit: Hmm, the control+* chars arent showing up :/

I rate it a 7.

 Respond  
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.