This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bot kick to ops

Old posts that have not been replied to for several years.
f
forever79
Voice
Posts: 18
Joined: Sat Jun 21, 2003 6:12 pm

bot kick to ops

Post by forever79 »

plase help me
my bot kicking to ops on channel,
what is the true code ?

Code: Select all

bind msgm - * pv_kick

proc pv_kick {nick uhost hand text} {
global botnick spambantime

##  i think u dont need to change anything below 
##  the bot will kickban if someone private message bot said words with "#" , "join" ,"channel" .etc 
##  if u want change please make sure you cannot put "*words*" . "*" or "?" will make the tcl didn`t work

if {[regexp -nocase "" $text] > 0} { 
  foreach kickchan [channels] {
    if {![isop $nick $kickchan] || ![isvoice $nick $kickchan]} {    
      if {[onchan $nick $kickchan]} {   
         set bmask "*!*[string range $uhost [string first "@" $uhost] end]"
         if {![ischanban $bmask $kickchan] || [botisop $kickchan]} {
               set kickmsg "\00312\002\037Cause\037:\002 Mass-Msg/Invite/Adv/Trojan Send\00312"  
               putquick "KICK $kickchan $nick :$kickmsg"
               newchanban $kickchan $bmask $botnick Mass-Msg $spambantime
             }
       }
    }
}
}
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

this script exempts ops and voices from being kicked for private spam, the problem is not from this script.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Re: bot kick to ops

Post by arcane »

forever79 wrote:

Code: Select all

if {![isop $nick $kickchan] || ![isvoice $nick $kickchan]} { 
change the || to &&. this code only extempts ops who have op AND voice. ops without voice get kicked.
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actualy no, by changing from || to && will make it test: if the user is oped AND voiced skip it.. the || dose the OR part, not viceversa.
Once the game is over, the king and the pawn go back in the same box.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

caesar wrote:Actualy no, by changing from || to && will make it test: if the user is oped AND voiced skip it.. the || dose the OR part, not viceversa.
Actually, no, you missed the !'s...

It will be, if NOT opped _AND_ NOT voiced, then do the following...
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

And what I've said?
Once the game is over, the king and the pawn go back in the same box.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

caesar wrote:And what I've said?
You did not say the "NOT"'s....
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

|| means or and && and.. I've said if the || is replaced by an && then will be if something AND something then do.. not if something OR something else then do.. :P It's exactly what you've said that I've said wrong.
Once the game is over, the king and the pawn go back in the same box.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

caesar wrote:|| means or and && and.. I've said if the || is replaced by an && then will be if something AND something then do.. not if something OR something else then do.. :P It's exactly what you've said that I've said wrong.
poor caesar... maybe you don't understand what "NOT" is...
Again, here is EXACTLY what you said:
Actualy no, by changing from || to && will make it test: if the user is oped AND voiced skip it.. the || dose the OR part, not viceversa.
see the part where you said: if the user is oped AND voiced skip it

that is NOT what it would become... it would become if the user is NOT opped AND NOT voiced then do the following

or if you are determined to say when it won't occur, then it would be:

if the user IS opped OR the user IS voiced then skip it...

Arcane is correct, either way you want to read it.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Umm.. yes, duno why I haven't seen the ! before them.. mea culpa :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

caesar wrote:Umm.. yes, duno why I haven't seen the ! before them.. mea culpa :P
It's okay, your eyes must be strained from working on a large TCL project, I'm sure :wink:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I dont know why this whole discussion occured, but what caesar said is correct but explained it in another way.

caesar said: if the user is oped AND voiced skip it
strikelight said: if the user is NOT opped AND NOT voiced then do the following

also, if its && then if the user is oped or voiced then it won't skip it, he must be oped AND voiced in order for the bot to skip it. So I guess || is whats needed ?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Sir_Fz wrote:I dont know why this whole discussion occured, but what caesar said is correct but explained it in another way.

caesar said: if the user is oped AND voiced skip it
strikelight said: if the user is NOT opped AND NOT voiced then do the following

also, if its && then if the user is oped or voiced then it won't skip it, he must be oped AND voiced in order for the bot to skip it. So I guess || is whats needed ?
OMG NO! NOT AGAIN! I JUST GOT CAESAR TO SEE THE ERROR OF HIS WAYS!! NOT YOU NOW! SIR FZ THAT IS WRONG!@!@##!@#
READ ALL THE COMMENTS I SAID TO CAESAR!!!

I know, typing in caps is annoying, but so is repeating one's self...
heh... oy vay...

Moral of story: Arcane is correct, && is needed.. please someone lock this topic before anyone else gets more confused :-?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

if {![isop $nick $kickchan] || ![isvoice $nick $kickchan]} { 
means:
if $nick is NOT oped in $kickchan OR if $nick is NOT voiced in $kickchan continue with the proc..
the:

Code: Select all

if {![isop $nick $kickchan] && ![isvoice $nick $kickchan]} { 
means:
if $nick is NOT oped in $kickchan AND if $nick is NOT voiced in $kickchan continue with the proc..

and yes, I was working on a repeat and on a stats TCL script. :P sorry for the confusion I've accidentaly made. My appologies for that.
Once the game is over, the king and the pawn go back in the same box.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

wohooo... of course i'm right. i thought 5 mins about it before posting :P
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
Locked