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.
Old posts that have not been replied to for several years.
3zzy
Halfop
Posts: 42 Joined: Sun Sep 14, 2003 6:58 am
Post
by 3zzy » Sat Oct 18, 2003 12:47 pm
OK, I need two scripts here. First one should kick a user if he kicked a bot on the first time, the next time the bot will be kicked, it shound ban the abuser of the bot.
The second one is similr, but with users. If someone kicks a protected user, the bot should kick the abuser, and on the second time, ban him.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sat Oct 18, 2003 1:27 pm
Code: Select all
bind mode - "* +b" protect:ban
bind kick - "*" protect:kick
bind mode - "* -o" protect:deop
proc protect:ban {nick uhost hand chan mc ban} {
if {![botisop $chan]} {
return
}
if {[matchattr $hand mn|mn $chan]} {
return
}
foreach luser [chanlist $chan mn|nm] {
if {[string match -nocase $ban $luser![getchanhost $luser $chan]] || [string match -nocase $ban "$::botname"]} {
scan $uhost "%\[^@\]@%s" user host
putquick "MODE $chan -bo+b $ban $nick *!*@$host" -next
newchanban $chan *!*@$host Moron "Don't \002ban\002 me or one of my friends moron!" 1440
}
}
}
proc protect:kick {nick uhost hand chan vict reas} {
if {[matchattr $hand mn|mn $chan]} {
return
}
if {$vict == $::botnick || [matchattr [nick2hand $vict $chan] mn|mn $chan]} {
scan $uhost "%\[^@\]@%s" user host
newchanban $chan *!*@$host Moron "Don't \002kick\002 me or one of my friends moron!" 1440
}
}
proc protect:deop {nick uhost hand chan mc vict} {
if {[matchattr $hand mn|mn $chan]} {
return
}
if {[matchattr [nick2hand $vict $chan] mn|mn $chan] || $vict == $::botnick} {
scan $uhost "%\[^@\]@%s" user host
newchanban $chan *!*@$host Moron "Don't \002deop\002 me or one of my friends moron!" 1440
}
}
there.. this might be your start! .. add arrays to make it *remember* if he had been banned/kicked/deoped before by the same user.
Once the game is over, the king and the pawn go back in the same box.
3zzy
Halfop
Posts: 42 Joined: Sun Sep 14, 2003 6:58 am
Post
by 3zzy » Sat Oct 18, 2003 1:33 pm
As i can see, it will also protect the user from getting banned. But how do i tell the bot to pretect some user? I don't want it to protect averyone, just a few of them.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sat Oct 18, 2003 1:49 pm
with something like this:
Code: Select all
set doprotect "bla foo bar"
if {[lsearch -exact [strlwr $doprotect] [strlwr $nick]]} {
# here it matches.. do your stuff.
}
Once the game is over, the king and the pawn go back in the same box.
3zzy
Halfop
Posts: 42 Joined: Sun Sep 14, 2003 6:58 am
Post
by 3zzy » Sun Oct 19, 2003 5:10 am
Do I add this bit to the other one? and bla foo bar are the nicks to pretect?
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Oct 19, 2003 5:31 am
That was an example, change it to suit your needs.
Once the game is over, the king and the pawn go back in the same box.
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Sun Oct 19, 2003 6:55 am
caesar wrote: That was an example, change it to suit your needs.
i would tend to add a custom flag for users to protect, it's better to edit that a string list