BoT cOmMaNdS

By PyThOn on Jul 18, 2011

This is a simple bot script use it as needed

on @*:TEXT:*:#:{
  if ($nick(#,$nick,oh)) {
    tokenize 32 $strip($1-)
    if ($1 = .kick) { 
      kick # $2 $iif($3-,$v1,No Reason) 
      .notice $nick $2 Has been kicked! 
    }
    elseif ($1 = .ban) {
      mode # +b $address($2,2)
      .notice $nick $2 Has been Banned
    }
    elseif ($1 = .kb) {
      ban -k # $2 2 $iif($3-,$v1,No Reason) 
      .notice $nick $2 Has been kicked and banned. 
    }
    elseif ($1 = .Mod) {
      mode # +m 
      .msg # This Channel is + strick moderet voice only 
    }
    elseif ($1 = .unMod) { 
      mode # -m 
      .msg # The moderation voice has now been de active. 
    }
  }
} 

Comments

Sign in to comment.
PyThOn   -  Aug 22, 2011

Whats homo ThE ViPeR

 Respond  
ThE ViPeR   -  Aug 21, 2011

O_o thats so homo but this is mark so it's to be expected

 Respond  
PyThOn   -  Jul 19, 2011

Ok we will see what he does.

 Respond  
blackvenomm666   -  Jul 19, 2011

well let me know when its up again. if he won't do it via the control pannel i can set it up but your gonna have to temp admin me

 Respond  
PyThOn   -  Jul 19, 2011

Its The Tails.
im trying to tell him we should set it up like that so it makes a point of us regging rooms.
Right now he is fixing database probs.
But either way the users dont know how to reg rooms so we end up doing it.
Also, Having a server when people can reg there own rooms makes it pointless to keep up with
security wise.

 Respond  
blackvenomm666   -  Jul 19, 2011

what frickin server you on?

 Respond  
PyThOn   -  Jul 19, 2011

I have no access of the control panel

 Respond  
PyThOn   -  Jul 19, 2011

well some dumbass wont listen Smh.

 Respond  
blackvenomm666   -  Jul 19, 2011

python you can do that in the server configuration. you don't need a snippet to do that

 Respond  
PyThOn   -  Jul 19, 2011

Can anyone make a Snippet that can stop regular users from reging There own room, and only allow Admin to reg the rooms on a server,

 Respond  
extremity   -  Jul 19, 2011

Yeah I saw that based upon your code. I was offering assistance on his coding style of the snippet. Nice shortening.

 Respond  
napa182   -  Jul 19, 2011

Jethro_ is an net admin on most ircd servers =P

An to extremity and python using

on @*:TEXT:*:#:{
  if ($nick(#,$nick,oh)) {

the @ in the text event takes care of the checking if the bot/client running the code is +o in the chan, and the if ($nick(#,$nick,oh)) { makes sure the client triggering the code is either +o or +h in the chan.

 Respond  
PyThOn   -  Jul 19, 2011

ok

 Respond  
Jethro   -  Jul 19, 2011

PyThOn, to answer your question above, the answer is no. I'm simply a volunteer helper and commentator.

 Respond  
PyThOn   -  Jul 19, 2011

extremity Thanks.i thought by doing if ( $nick isop $chan || $me isop $chan ) it would mean is nick is Op Or $me=bot is Op then it would work so in a way im not quite sure what u mean :. By || i thought that means And if -_-. lmao
Eh.

 Respond  
PyThOn   -  Jul 19, 2011

Jethro are you a admin on a site?

 Respond  
Jethro   -  Jul 19, 2011

OH, my bad. I reread the code now. Yes, it makes sense to use && in place of || in the original code. :P I thought they were both $nick

 Respond  
Jethro   -  Jul 19, 2011

Thanks napa182, I'm still on semi-vacation :P

extremity, if you use && operator, that will mean a user has to be an op AND halfop simultaneously. In other words, you can't be a halfop to trigger the code without being an op.

The || opeator tells mIRC a user is either an op OR halfop.

 Respond  
extremity   -  Jul 19, 2011

I think the first if statement should be && and not ||. If user is op AND you are op, versus If user is op OR you are op.. otherwise it still tries to work if you are not op.

There are a few other things beyond what napa and jethro are suggesting (which are very valid), but not relevant to functionality.

Ask away if you need help adding what they suggested. Keep up the work!

 Respond  
napa182   -  Jul 19, 2011

yep I am glad to see you back making comments once again Jethro_ . Welcome back...

 Respond  
Jethro   -  Jul 19, 2011

Like napa stated, implementing some checks are recommended. The crucial one has to be

if ($2 ison $chan) {

because if someone mistypes or enters something else other than an actual nickname in the channel where you have the code run, you'll get an error. Last but not least, a trigger flood check is advised, just in case an op or halfop gets bananas for whatever reason to screw up the client that runs the code by way of flooding. Better safe than sorry!

 Respond  
PyThOn   -  Jul 19, 2011

Thanks

 Respond  
napa182   -  Jul 19, 2011

you have missed placed brackets an have things in the wrong place in ur snippet.
In keeping with your original code, and so you can understand here is an working example an nothing more then that.
you may want to add error checks to it as well

on @*:TEXT:*:#:{
  if ($nick(#,$nick,oh)) {
    tokenize 32 $strip($1-)
    if ($1 = .kick) { 
      kick # $2 $iif($3-,$v1,No Reason) 
      .notice $nick $2 Has been kicked! 
    }
    elseif ($1 = .ban) {
      mode # +b $address($2,2)
      .notice $nick $2 Has been Banned
    }
    elseif ($1 = .kb) {
      ban -k # $2 2 $iif($3-,$v1,No Reason) 
      .notice $nick $2 Has been kicked and banned. 
    }
    elseif ($1 = .Mod) {
      mode # +m 
      .msg # This Channel is + strick moderet voice only 
    }
    elseif ($1 = .unMod) { 
      mode # -m 
      .msg # The moderation voice has now been de active. 
    }
  }
}
 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.