mIRC Home    About    Download    Register    News    Help

Print Thread
#118811 29/04/05 07:59 AM
Joined: Aug 2004
Posts: 21
S
sCHuTt Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2004
Posts: 21
Lo guys,

Got a wee lil problem here, I know u can do this for op's

ON *:TEXT:*whatever*:#: if $nick isop $chan { /msg $chan What he said... }

Now the server we're on has voice (+), help (%), op (@), admin (&), owner (~).
So if I'd want an admin-only trigger, what would the if command be...?

- sChutt

#118812 29/04/05 08:17 AM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Check if ($nick(#,$nick,&)) {

#118813 29/04/05 08:20 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hi there sCHuTt, correct isop works with operators.
And there is also ishop for half op. Here's a little alias I made to see if they're an admin.

Code:
alias isadmin {
  if ($left($nick($chan,$1).pnick,1) == &) { return $true }
  return $false
}

On *:Text:*whatever*:#: {
  if ($isadmin($nick)) msg $chan ..
}


How it works:

$nick($chan,<Nick>).pnick returns their status in the channel for example: +Andy or @Andy etc. Now we want to check if the first character is a + or an @ or in your case admin (&).

So we use:

$left($nick($chan,<nick>).pnick,1)

@Andy returns @
+Andy returns +

As for the alias if it's confirmed it's an & we get the result $true otherwise $false.

//echo -a $isadmin(AdminNick) returns $true if they're an admin (&)

Hope this helps (even just a little).

-Andy

Edit: Alot simpler above this post and makes mine obsolete. smile


Link Copied to Clipboard