Advertisement
Guest User

willymon2

a guest
Jan 26th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.73 KB | None | 0 0
  1. # Feb 13, 2018
  2.  
  3. #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?
  4. #<@willy> depends
  5. #<@mondino> on?
  6. #<@willy> I'm not good with scripts that go put and fetch on the web
  7. #<@willy> so... type it, and let's find out
  8. #<@willy> heh
  9. #<@mondino> I just want my eggdrop to... "when kicked/banned, deop the kicker by chanserv, delete it's access and come back"
  10. #<@willy> deop the kicker by chanserv, <<< bot's nick is on some SOP list already, or something? so that it CAN do this?
  11. #<@willy> delete it's access <<< same question, again
  12. #<@mondino> yes, the bot is a founder :)
  13. #<@willy> ok
  14.  
  15.  
  16. ######
  17.  
  18. # March 19, 2019
  19.  
  20. # Learned from chatting with mondino that channels on Dalnet have founder, manager, sop, and aop.
  21. # and therefore need to have bot determine which type was the one that kicked bot.
  22.  
  23.  
  24.  
  25. # bot owner might like to visit: http://www.egghelp.org/commands/channels.htm#chaninfo and text search for revenge and revengebot
  26. # and read about those built in functions, too. :)
  27. # while there, text search and read about : need-unban channel setting too. You might want to use it, too.
  28.  
  29.  
  30.  
  31. #### Important ! ###
  32. #
  33. # This script was written by request of mondino, of DALnet - by willy of DALnet (jack3 on other networks)
  34. # 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
  35. # willy (jack3) about it.
  36. # mondino has agreed to this.
  37. #
  38.  
  39.  
  40.  
  41. ############################## End of notes #########################################################
  42.  
  43.  
  44.  
  45.  
  46. ###### Configuration #########
  47. #
  48. ## set the chan here - (this script is designed for use on only one channel)
  49. set revenge_chan "#CafeChat"
  50.  
  51. ############# end of Configuration ###############
  52.  
  53.  
  54.  
  55.  
  56. ###
  57.  
  58. bind kick - "$revenge_chan $botnick *" send_why_command
  59. bind mode - "$revenge_chan +b" bot_was_banned
  60.  
  61. ###
  62.  
  63. ############
  64. proc send_why_command {nick uhost handle chan target reason} {
  65. global revenge_chan
  66.  
  67. bind notc - "*" got_cs_why_return
  68. utimer 20 [list unbind notc - "*" got_cs_why_return]
  69. putserv "privmsg ChanServ@services.dal.net :why $revenge_chan $nick"
  70. }
  71. ############
  72.  
  73.  
  74. ############
  75. proc got_cs_why_return {nick uhost handle text dest} {
  76. global botnick revenge_chan
  77.  
  78. set small_check [stripcodes * [string tolower [lrange [split $text] 3 5] ] ]
  79. set small_check [string trimright $small_check .]
  80.  
  81. if {$small_check ne "access to $revenge_chan"} {
  82. return 0
  83. }
  84.  
  85.  
  86. set why [stripcodes * [string tolower [lindex [split $text] 2]]]
  87. set who [stripcodes * [lindex [split $text] 0]]
  88.  
  89.  
  90. if {$why eq "founder"} {
  91. putserv "notice $who :Oww! I was kicked by channel Founder"
  92. return 0
  93. }
  94.  
  95.  
  96.  
  97. # The below three if conditions could be eliminated. Since it was done this way while working it up and debugging it, I just
  98. # left it this way. Doesn't hurt anything. :)
  99.  
  100.  
  101. if {$why eq "manager"} {
  102. putquick "privmsg ChanServ@services.dal.net :MANAGER $revenge_chan del $who"
  103. putquick "privmsg ChanServ@services.dal.net :DEOP $revenge_chan $who"
  104. putquick "privmsg ChanServ@services.dal.net :UNBAN $revenge_chan $botnick"
  105. utimer 2 [list putserv "join $revenge_chan" ]
  106. utimer 4 [list say_stuff_after_return $who $why]
  107. return 0
  108. }
  109.  
  110.  
  111.  
  112. if {$why eq "sop"} {
  113. putquick "privmsg ChanServ@services.dal.net :SOP $revenge_chan del $who"
  114. putquick "privmsg ChanServ@services.dal.net :DEOP $revenge_chan $who"
  115. putquick "privmsg ChanServ@services.dal.net :UNBAN $revenge_chan $botnick"
  116. utimer 2 [list putserv "join $revenge_chan" ]
  117. utimer 4 [list say_stuff_after_return $who $why]
  118. return 0
  119. }
  120.  
  121.  
  122. if {$why eq "aop"} {
  123. putquick "privmsg ChanServ@services.dal.net :AOP $revenge_chan del $who"
  124. putquick "privmsg ChanServ@services.dal.net :DEOP $revenge_chan $who"
  125. putquick "privmsg ChanServ@services.dal.net :UNBAN $revenge_chan $botnick"
  126. utimer 2 [list putserv "join $revenge_chan" ]
  127. utimer 4 [list say_stuff_after_return $who $why]
  128. return 0
  129. }
  130. }
  131. ###########
  132.  
  133. ############
  134. proc say_stuff_after_return {kicker list_type} {
  135. global botnick revenge_chan
  136.  
  137. if {![botonchan $revenge_chan]} {
  138. putquick "join $revenge_chan"
  139. }
  140.  
  141. set list_type [string toupper $list_type]
  142.  
  143. if {![botisop $revenge_chan]} {
  144. putquick "privmsg ChanServ@services.dal.net :OP $revenge_chan $botnick"
  145. ###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." ]
  146. 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!" ]
  147. return 0
  148. }
  149.  
  150. #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.
  151. ###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."
  152. 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!"
  153. }
  154. #################
  155.  
  156.  
  157. ################ All this does, is call the same proc as when kicked, if bot was banned
  158. proc bot_was_banned {nick uhost handle chan mode-ch target} {
  159. global botnick revenge_chan
  160.  
  161. if {$target eq $botnick} {
  162. send_why_command $nick $uhost $handle $chan $target banned
  163. }
  164. }
  165. ################
  166.  
  167.  
  168.  
  169. putlog " "
  170. putlog "Kick Revenger script loaded! :) by willy (of DALnet) written for mondino (of DALnet)"
  171. putlog " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement