Hidden Mod

By scorps on Feb 07, 2011

This is a script developed by myself and a good friend for our bots. We use it in several channels and it's a great way to minimize the amount of chatter to mod number. You choose the nicks you want to have the ability to use simple mod commands and the rest is very self explanatory. Hope you find it handy for yourselves.

Add into your bots remote Insert as many allowed USERNAMEs you feel necessary, seperated by a comma, no spaces Tell your chosen users to type in BOTNAME COMMAND NICK.

I tell them to set it up as a nick menu to make it faster and easier

**Updated with Jethros suggestion. Thanks heaps for the heads up

alias allowednicks return USERNAME,USERNAME
on @*:text:*:#:{
  tokenize 32 $strip($1-)
  if ($1 == $me) && ($istok($allowednicks,$nick,44)) {
    if ($istok(kick boot,$2,32)) && ($3 ison #) { kick # $3 Blame $nick }
 elseif (ban == $2) && ($address($3,2) !isban #) { ban # $3 2 }
 elseif (voice == $2) && ($3 !isvoice #) { mode # +v $3 }
 elseif (unvoice == $2) && ($3 isvoice #) { mode # -v $3) }
 elseif (punish == $2) && ($3 ison #) { ban -k # $3 2 }
  }
}

Comments

Sign in to comment.
scorps   -  Feb 09, 2011

Done

More
 Respond  
Jethro   -  Feb 08, 2011

Now I agree with you on that matter. Thanks for the input. :-)

Sorps, let's replace this part with this one below instead:

 if ($istok(kick boot,$2,32)) && ($3 ison #) { kick # $3 Blame $nick }
 elseif (ban == $2) && ($address($3,2) !isban #) { ban # $3 2 }
 elseif (voice == $2) && ($3 !isvoice #) { mode # +v $3 }
 elseif (unvoice == $2) && ($3 isvoice #) { mode # -v $3) }
 elseif (punish == $2) && ($3 ison #) { ban -k # $3 2 }
More
 Respond  
sunslayer   -  Feb 08, 2011

it works the same but if $3 !ison #, then your doing the same thing as

if (blah) { }

making the entire statement unnecessary and in older versions of mIRC would cause the code to fail

More
 Respond  
Jethro   -  Feb 08, 2011

That may be so if I constructed it this way:> if ($istok(kick boot,$2,32)) { kick # $iif($3 ison #,$3 Blame $nick) }But I made the kick # bit inside the $iif:> if ($istok(kick boot,$2,32)) { $iif($3 ison #,kick # $3 Blame $nick) }So the way I see it, it works pretty much the same thing as:> if ($istok(kick boot,$2,32)) && ($3 ison #) { kick # $3 Blame $nick }

More
 Respond  
sunslayer   -  Feb 08, 2011

speed is rarely an issue in msl, but $iif() can return $null giving you an empty command

More
 Respond  
Jethro   -  Feb 07, 2011

sunslayer, I know you can do it with && for each condition, but you can also get away with $iif(). I won't get into the speed matter though 'cause that won't make much of a difference.

More
 Respond  
sunslayer   -  Feb 07, 2011

theres no need for $iif()

if ($istok(kick boot,$2,32) && $3 ison #) { kick # $3 Blame $nick }
More
 Respond  
scorps   -  Feb 07, 2011

Oh so we did lol. Thanks Jethro

More
 Respond  
Jethro   -  Feb 07, 2011

I realize the $3 needn't be checked for the invite, and I've edited my above code to reflect the change.

More
 Respond  
Jethro   -  Feb 07, 2011

It's a waste of $istok engine when you use it for one word. You should strip all the tokens, not just $me, adapt the use of && operator, use the isvoice and isban check, and lastly, you should make sure the client that runs the code is opped by adding a @ prefix to the event:

alias allowednicks return USERNAME,USERNAME
on @*:text:*:#:{
  tokenize 32 $strip($1-)
  if ($1 == $me) && ($istok($allowednicks,$nick,44)) {
    if ($istok(kick boot,$2,32)) { $iif($3 ison #,kick # $3 Blame $nick) }
    elseif (ban == $2) { $iif($address($3,2) !isban #,ban # $3 2) }
    elseif (voice == $2) { $iif($3 !isvoice #,mode # +v $3) }
    elseif (unvoice == $2) { $iif($3 isvoice #,mode # -v $3) }
    elseif (punish == $2) { $iif($3 ison #,ban -k # $3 2) }
    elseif (invite == $2) { invite $3 # }
  }
}

P.S. Your original code has an error. You put a curly bracket instead of the regular parenthesis for the command punish. And you misused the invite command.

Using those operators diminish the likelihood of mode flood.

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