Guest User

Untitled

a guest
Jun 10th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. # pubchancomm.tcl - a modified version of public.tcl v1.00
  2. # PubChanComm v1.82 - 7 Jun 04
  3. # this is modification of existing code by joaquin
  4. # modified by glide (glide@uo.sk)
  5. ###########################################
  6. #
  7. # INSTALLATION (script tested on DiVERSE, VoiD, Eggdrop)
  8. # 1. Place the file into scripts directory
  9. # 2. Add the following line into bots config file
  10. # source scripts/pcc.tcl
  11. # 3. Find the following line in pubchancomm.tcl
  12. # set znak "!" and define your own character or use ! as default
  13. # (this line is located in the script 2 times: first line of code, and HELP section)
  14. # 4. Edit flags in Commands section or use defaults
  15. # (+o needed for opping +Q for other commands)
  16. # 5. Rehash the bot
  17. # 6. should work now ;)
  18. #
  19. ###########################################
  20. #
  21. #Original header follows:
  22.  
  23. #########################################
  24. #author - joaquin@centrum.sk (joaquin) #
  25. #editor - joaquin@centrum.sk (joaquin) #
  26. #########################################
  27.  
  28. #code:
  29.  
  30.  
  31. set znak "!"
  32.  
  33. ############
  34. # Commands #
  35. ############
  36.  
  37. bind pub o|o ${znak}op op
  38. bind pub o|o ${znak}deop deop
  39.  
  40. bind pub o|o ${znak}voice voice
  41. bind pub o|o ${znak}devoice devoice
  42.  
  43. bind pub Q|Q ${znak}kick ckick
  44. bind pub Q|Q ${znak}ban ban
  45. bind pub Q|Q ${znak}unban unban
  46. bind pub Q|Q ${znak}kban kban
  47.  
  48. bind pub Q|Q ${znak}topic topic
  49. bind pub o|o ${znak}mode mode
  50. #bind pub Q|Q ${znak}help help
  51. bind pub o|o ${znak}about about
  52.  
  53.  
  54. ####################################################################
  55. # Don't change anything below this line except: set znak "" #
  56. # in the Help section !!! unless you know what you're doing #
  57. # (if changing anything, pls keep the entire header with script) #
  58. #__________________________________________________________________#
  59.  
  60. proc op {nick host hand chan text} {
  61. set target [lindex $text 0]
  62. set target1 [lindex $text 1]
  63. set target2 [lindex $text 2]
  64. if {$target == ""} {
  65. putserv "MODE $chan +o $nick"
  66. } else {
  67. putserv "MODE $chan +ooo $target $target1 $target2"
  68. }
  69. }
  70.  
  71. proc deop {nick host hand chan text} {
  72. global botnick
  73. set target [lindex $text 0]
  74. set target1 [lindex $text 1]
  75. set target2 [lindex $text 2]
  76. if {$target == ""} {
  77. putserv "MODE $chan -o $nick"
  78. } elseif {[matchattr $nick n|-] == "1"} {
  79. putserv "MODE $chan -ooo $target $target1 $target2"
  80. } elseif {$target != $botnick} {
  81. if {[matchattr $target n|-] == "0"} {
  82. if {[matchattr $nick -|o $chan] == 1} {
  83. putserv "MODE $chan -ooo $target $target1 $target2"
  84. } elseif {[matchattr $target -|o $chan] == 0} {
  85. putserv "MODE $chan -ooo $target $target1 $target2"
  86. } else {
  87. putserv "NOTICE $nick : You don`t have permission to deop the Op $target"
  88. }
  89. } elseif {[matchattr $target n|-] == 1} {
  90. putserv "NOTICE $nick : You don`t have permission to deop the Op $target"
  91. }
  92. } else {
  93. putquick "NOTICE $nick : Fuck you"
  94. }
  95. }
  96.  
  97. proc voice {nick host hand chan text} {
  98. set target [lindex $text 0]
  99. set target1 [lindex $text 1]
  100. set target2 [lindex $text 2]
  101. if {$target == ""} {
  102. putserv "MODE $chan +v $nick"
  103. } else {
  104. putserv "MODE $chan +vvv $target $target1 $target2"
  105. }
  106. }
  107.  
  108. proc devoice {nick host hand chan text} {
  109. set target [lindex $text 0]
  110. set target1 [lindex $text 1]
  111. set target2 [lindex $text 2]
  112. if {$target == ""} {
  113. putserv "MODE $chan -v $nick"
  114. } else {
  115. putserv "MODE $chan -vvv $target $target1 $target2"
  116. }
  117. }
  118.  
  119. proc ckick {nick host hand chan text} {
  120. global botnick
  121. set target [lindex $text 0]
  122. set reason [lrange $text 1 end]
  123. if {[matchattr $nick n|-] == "1"} {
  124. putserv "KICK $chan $target :$reason"
  125. } elseif {$target != $botnick} {
  126. if {[matchattr $target n|-] == "0"} {
  127. if {[matchattr $nick -|o $chan] == "1"} {
  128. putserv "KICK $chan $target :$reason"
  129. } elseif {[matchattr $target -|o $chan] == "0"} {
  130. putserv "KICK $chan $target :$reason"
  131. } else {
  132. putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
  133. }
  134. } elseif {[matchattr $target n|-] == 1} {
  135. putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
  136. }
  137. } else {
  138. putquick "NOTICE $nick : Fuck you"
  139. }
  140. }
  141.  
  142. proc ban {nick host hand chan text} {
  143. global botnick
  144. set target [lindex $text 0]
  145. set bhost [getchanhost $target $chan]
  146. set banmask "*!*[string trimleft [string range $bhost [string first "!" $bhost] end] ?^~-_+?]"
  147. if {[matchattr $nick n|-] == "1"} {
  148. putserv "MODE $chan +b $banmask"
  149. } elseif {$target != $botnick} {
  150. if {[matchattr $target n|-] == "0"} {
  151. if {[matchattr $nick -|o $chan] == 1} {
  152. putserv "MODE $chan +b $banmask"
  153. } elseif {[matchattr $target -|o $chan] == 0} {
  154. putserv "MODE $chan +b $banmask"
  155. } else {
  156. putserv "NOTICE $nick : You don`t have permission to ban the Op $target"
  157. }
  158. } elseif {[matchattr $target n|-] == 1} {
  159. putserv "NOTICE $nick : You don`t have permission to ban the Op $target"
  160. }
  161. } else {
  162. putquick "NOTICE $nick : Fuck you"
  163. }
  164. }
  165.  
  166. proc unban {nick host hand chan text} {
  167. set target [lindex $text 0]
  168. putserv "MODE $chan -b $target"
  169. }
  170.  
  171. proc kban {nick host hand chan text} {
  172. global botnick
  173. set target [lindex $text 0]
  174. set reason [lrange $text 0 end]
  175. set bhost [getchanhost $target $chan]
  176. set banmask "*!*[string trimleft [string range $bhost [string first "!" $bhost] end] ?^~-_+?]"
  177. if {[matchattr $nick n|-] == "1"} {
  178. putserv "MODE $chan +b $banmask"
  179. putserv "KICK $chan $target :$reason"
  180. } elseif {$target != $botnick} {
  181. if {[matchattr $target n|-] == "0"} {
  182. if {[matchattr $nick -|o $chan] == 1} {
  183. putserv "MODE $chan +b $banmask"
  184. putserv "KICK $chan $target :$reason"
  185. } elseif {[matchattr $target -|o $chan] == 0} {
  186. putserv "MODE $chan +b $banmask"
  187. putserv "KICK $chan $target :$reason"
  188. } else {
  189. putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
  190. }
  191. } elseif {[matchattr $target n|-] == 1} {
  192. putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
  193. }
  194. } else {
  195. putquick "NOTICE $nick : Fuck you"
  196. }
  197. }
  198.  
  199. proc topic {nick host hand chan text} {
  200. putserv "TOPIC $chan :$text"
  201. }
  202.  
  203. proc mode {nick host hand chan text} {
  204. set mode [lrange $text 0 6]
  205. putserv "MODE $chan :$mode"
  206. }
  207.  
  208. ################
  209. # HELP SECTION #
  210. ################
  211.  
  212. proc about {nick host hand chan text} {
  213. set ver "1.82"
  214. putserv "PRIVMSG $nick :Script: Public Channel Commands, v${ver}"
  215. putserv "PRIVMSG $nick :Author: joaquin, glide"
  216. putserv "PRIVMSG $nick :joaquin (joaquin@centrum.sk) - written the original code -> true author"
  217. putserv "PRIVMSG $nick :glide (glide@uo.sk) - improved banning, added - multiple target support, topic, mode, help, about"
  218. putserv "PRIVMSG $nick ---------------------------------------------------------------------------------------------------"
  219. putserv "PRIVMSG $nick :E-Mail: glide@uo.sk"
  220. putserv "PRIVMSG $nick :For any bug reports, suggestions, or comments use supported email address"
  221. putserv "PRIVMSG $nick --------------------------------------------------------------------------"
  222. putserv "PRIVMSG $nick :Special thanx to: Logosys (tcl help), _ViPeR_ (testing)"
  223. putserv "PRIVMSG $nick "
  224. putserv "PRIVMSG $nick :I know that !mode command doesn't work on 100%, I will make it in the next update"
  225. }
  226.  
  227. set ver "1.82"
  228. putlog "Public Channel Commands ${ver} Created by joaquin, edited by glide"
  229. putlog "For help type: !help on the channel"
Add Comment
Please, Sign In to add comment