Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Feb 13, 2018
- #3<@mondino> If I type you a line of how I want a bot to behave, can you translate what you read to a TCL script?
- #<@willy> depends
- #<@mondino> on?
- #<@willy> I'm not good with scripts that go put and fetch on the web
- #<@willy> so... type it, and let's find out
- #<@willy> heh
- #<@mondino> I just want my eggdrop to... "when kicked/banned, deop the kicker by chanserv, delete it's access and come back"
- #<@willy> deop the kicker by chanserv, <<< bot's nick is on some SOP list already, or something? so that it CAN do this?
- #<@willy> delete it's access <<< same question, again
- #<@mondino> yes, the bot is a founder :)
- #<@willy> ok
- ######
- # March 19, 2019
- # Learned from chatting with mondino that channels on Dalnet have founder, manager, sop, and aop.
- # and therefore need to have bot determine which type was the one that kicked bot.
- # bot owner might like to visit: http://www.egghelp.org/commands/channels.htm#chaninfo and text search for revenge and revengebot
- # and read about those built in functions, too. :)
- # while there, text search and read about : need-unban channel setting too. You might want to use it, too.
- #### Important ! ###
- #
- # This script was written by request of mondino, of DALnet - by willy of DALnet (jack3 on other networks)
- # This script is for use by mondino only. It is not to be given to anyone else. (If anyone wants a copy, mondino will simply tell them to ask
- # willy (jack3) about it.
- # mondino has agreed to this.
- #
- ############################## End of notes #########################################################
- ###### Configuration #########
- #
- ## set the chan here - (this script is designed for use on only one channel)
- set revenge_chan "#CafeChat"
- ############# end of Configuration ###############
- ###
- bind kick - "$revenge_chan $botnick *" send_why_command
- bind mode - "$revenge_chan +b" bot_was_banned
- ###
- ############
- proc send_why_command {nick uhost handle chan target reason} {
- global revenge_chan
- bind notc - "*" got_cs_why_return
- utimer 20 [list unbind notc - "*" got_cs_why_return]
- putserv "privmsg ChanServ@services.dal.net :why $revenge_chan $nick"
- }
- ############
- ############
- proc got_cs_why_return {nick uhost handle text dest} {
- global botnick revenge_chan
- set small_check [stripcodes * [string tolower [lrange [split $text] 3 5] ] ]
- set small_check [string trimright $small_check .]
- if {$small_check ne "access to $revenge_chan"} {
- return 0
- }
- set why [stripcodes * [string tolower [lindex [split $text] 2]]]
- set who [stripcodes * [lindex [split $text] 0]]
- if {$why eq "founder"} {
- putserv "notice $who :Oww! I was kicked by channel Founder"
- return 0
- }
- # The below three if conditions could be eliminated. Since it was done this way while working it up and debugging it, I just
- # left it this way. Doesn't hurt anything. :)
- if {$why eq "manager"} {
- putquick "privmsg ChanServ@services.dal.net :MANAGER $revenge_chan del $who"
- putquick "privmsg ChanServ@services.dal.net :DEOP $revenge_chan $who"
- putquick "privmsg ChanServ@services.dal.net :UNBAN $revenge_chan $botnick"
- utimer 2 [list putserv "join $revenge_chan" ]
- utimer 4 [list say_stuff_after_return $who $why]
- return 0
- }
- if {$why eq "sop"} {
- putquick "privmsg ChanServ@services.dal.net :SOP $revenge_chan del $who"
- putquick "privmsg ChanServ@services.dal.net :DEOP $revenge_chan $who"
- putquick "privmsg ChanServ@services.dal.net :UNBAN $revenge_chan $botnick"
- utimer 2 [list putserv "join $revenge_chan" ]
- utimer 4 [list say_stuff_after_return $who $why]
- return 0
- }
- if {$why eq "aop"} {
- putquick "privmsg ChanServ@services.dal.net :AOP $revenge_chan del $who"
- putquick "privmsg ChanServ@services.dal.net :DEOP $revenge_chan $who"
- putquick "privmsg ChanServ@services.dal.net :UNBAN $revenge_chan $botnick"
- utimer 2 [list putserv "join $revenge_chan" ]
- utimer 4 [list say_stuff_after_return $who $why]
- return 0
- }
- }
- ###########
- ############
- proc say_stuff_after_return {kicker list_type} {
- global botnick revenge_chan
- if {![botonchan $revenge_chan]} {
- putquick "join $revenge_chan"
- }
- set list_type [string toupper $list_type]
- if {![botisop $revenge_chan]} {
- putquick "privmsg ChanServ@services.dal.net :OP $revenge_chan $botnick"
- ###utimer 2 [list putserv "notice @$revenge_chan :I just removed \0033$kicker\003 for trying to kick/ban me out of here. He/She must be trying to take over the channel and no one can do that while I'm here." ]
- utimer 2 [list putserv "notice @$revenge_chan :\0033$kicker\003 was removed from the - \0034$list_type\003 - list of $revenge_chan. REASON: Trying to kickban \002ME\002!" ]
- return 0
- }
- #Note: see the @ in the channel name given to the notice command. That is supposed to make the notice go to channel ops only. Test it, to be sure.
- ###putserv "notice @$revenge_chan :I just removed \0031$kicker\003 for trying to kick/ban me out of here. He/She must be trying to take over the channel and no one can do that while I'm here."
- putserv "notice @$revenge_chan ::\0031$kicker\003 was removed from the - \0034$list_type\003 - list of $revenge_chan. REASON: Trying to kickban \002ME\002!"
- }
- #################
- ################ All this does, is call the same proc as when kicked, if bot was banned
- proc bot_was_banned {nick uhost handle chan mode-ch target} {
- global botnick revenge_chan
- if {$target eq $botnick} {
- send_why_command $nick $uhost $handle $chan $target banned
- }
- }
- ################
- putlog " "
- putlog "Kick Revenger script loaded! :) by willy (of DALnet) written for mondino (of DALnet)"
- putlog " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement