Guest User

Untitled

a guest
Apr 15th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.84 KB | None | 0 0
  1. # +-------------------+
  2. # | c o p y r i g h t |
  3. # +-------------------+
  4. #
  5. # Copyright (C) 2006 Laurids 'GeeX' W.
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License
  9. # as published by the Free Software Foundation; either version 2
  10. # of the License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. #
  21.  
  22. # Manages your sbnc over irc
  23.  
  24. # configuration
  25.  
  26. # variables
  27.  
  28. set sbnc(trigger) "\$"
  29. set sbnc(version) "2.4"
  30. set sbnc(author) "Laurids 'GeeX' W. (#GeeX at Quakenet) - Edited by zevlink to include userinfo/modex/motd/rules/status/adminlist & improvements (21/5/08)"
  31. set sbnc(chan) "#chan"
  32. set sbnc(ident) "ident"
  33. set sbnc(ircserver) "irc.quakenet.org 6667"
  34. set sbnc(server) "server"
  35. set sbnc(port) "port"
  36. set sbnc(realname) "15sBNC By #chan"
  37. set sbnc(iface) "none"
  38.  
  39.  
  40. # bindings
  41.  
  42. bind PUB n|- $sbnc(trigger)sbnc sbnc:iface
  43.  
  44. # copyright
  45.  
  46. putlog "sBNC Script version $sbnc(version) scripted by $sbnc(author)"
  47.  
  48. # source (again DO NOT change anything if you are not 100% sure)
  49.  
  50. proc sbnc:iface { nick host hand chan arg } {
  51. global sbnc
  52. switch -exact -- [string tolower [lindex [split $arg] 0]] {
  53. "add" {
  54. set ident [lindex [split $arg] 1]
  55. set password [expr {int(rand()*1000000) + 1}]
  56. set bncuser [lindex [split $arg] 2]
  57. if {$ident == ""} {
  58. putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc add 'ident' ?nick?."
  59. return
  60. }
  61. putquick "SBNC ADDUSER $ident $password"
  62. putquick "SBNC SIMUL $ident SBNC SET REALNAME $sbnc(realname)"
  63. putquick "SBNC SIMUL $ident SBNC SET SERVER $sbnc(ircserver)"
  64. putquick "SBNC SIMUL $ident SBNC SET AUTOMODES +ix"
  65. utimer 60 [list putquick "SBNC SIMUL $ident JOIN $sbnc(chan)"]
  66. putquick "NOTICE $nick :New (sBNC) User Added -- Ident $ident --"
  67. putquick "NOTICE $nick :/server -m $sbnc(server):$sbnc(port) $password -i $ident $ident`BNC $ident@moon.valueshells.net -"
  68. putquick "NOTICE $nick :(sBNC) Info Send To $bncuser --"
  69. if {$bncuser == ""} {
  70. return
  71. } elseif {[onchan $bncuser $chan]} {
  72. putserv "PRIVMSG $bncuser :Your BNC data, $bncuser:"
  73. putserv "PRIVMSG $bncuser :server -m $sbnc(server):$sbnc(port) $password -i $ident $ident`BNC $ident@moon.valueshellsnet -- Iface: $sbnc(iface)"
  74. putserv "PRIVMSG $bncuser :If you need help, just join $sbnc(#me.help)."
  75. } else {
  76. putserv "NOTICE $nick :Error. $bncuser is not on $chan."
  77. return
  78. }
  79. }
  80. "del" {
  81. set ident [lindex [split $arg] 1]
  82. if {$ident == ""} {
  83. putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc del 'ident'."
  84. return
  85. } else {
  86. putquick "SBNC DELUSER $ident"
  87. putquick "NOTICE $nick :sBNC Deleted By $nick Ident: ($ident)"
  88. }
  89. }
  90. "password" {
  91. set ident [lindex [split $arg] 1]
  92. set password [expr {int(rand()*1000000) + 1}]
  93. if {$ident == ""} {
  94. putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc password 'ident'."
  95. return
  96. } else {
  97. putquick "SBNC RESETPASS $ident $password"
  98. putquick "NOTICE $nick :Done. New password for user ($ident) created."
  99. putquick "NOTICE $nick :Password: $password"
  100. }
  101. }
  102. "admin" {
  103. set ident [lindex [split $arg] 1]
  104. if {$ident == "$sbnc(ident)"} {
  105. putquick "NOTICE $nick :Error This ident is already an admin"
  106. return
  107. } elseif {$ident == ""} {
  108. putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc admin 'ident'."
  109. return
  110. } else {
  111. putquick "SBNC ADMIN $ident"
  112. putquick "NOTICE $nick :Done. User ($ident) has now admin rights."
  113. }
  114. }
  115. "unadmin" {
  116. set ident [lindex [split $arg] 1]
  117. if {$ident == "$sbnc(ident)"} {
  118. putquick "NOTICE $nick :Error This ident needs admin rights."
  119. return
  120. } elseif {$ident == ""} {
  121. putserv "NOTICE $nick Error Wrong syntax. Use $sbnc(trigger)sbnc unadmin 'ident'."
  122. return
  123. } else {
  124. putquick "SBNC UNADMIN $ident"
  125. putquick "NOTICE $nick :Done Admin Rights For User ($ident) Deleted."
  126. }
  127. }
  128. "global" {
  129. set arg [lrange [split $arg] 1 end]
  130. if {$arg == ""} {
  131. putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc global 'message'."
  132. return
  133. } else {
  134. putquick "SBNC GLOBAL $arg"
  135. putquick "NOTICE $nick :Done Global notice to all bouncer users transmitted."
  136. }
  137. }
  138. "force" {
  139. set sbnc(force) "[lindex [split $arg] 1]"
  140. if {$sbnc(force) == ""} {
  141. putserv "NOTICE $nick :sBNC Forcing All Users To Join #/me By: $nick"
  142. putserv "SBNC tcl :foreach sbnc(user) \[bncuserlist\] {setctx \$sbnc(user) ; putserv \"join #/me\" }"
  143. return
  144. }
  145. }
  146. "part" {
  147. set sbnc(partchan) "[lindex [split $arg] 1]"
  148. if {$sbnc(partchan) == ""} {
  149. putserv "NOTICE $nick :Error. Wrong syntax. Use $sbnc(trigger)sbnc part 'channel'."
  150. return
  151. } elseif {[string first # $sbnc(partchan)] != 0} {
  152. putserv "NOTICE $nick :Error. The channel has to start with a '#'."
  153. return
  154. } else {
  155. putserv "NOTICE $nick :sBNC Forcing All Bouncer To Part $sbnc(partchan) By: $nick"
  156. putserv "SBNC tcl :foreach sbnc(user) \[bncuserlist\] {setctx \$sbnc(user) ; channel remove $sbnc(partchan)}"
  157. return
  158. }
  159. }
  160. "help" {
  161. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Add ident nick ' To add user bnc"
  162. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Del ident ' To delete user bnc"
  163. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Password ident ' To change user password"
  164. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Admin ident ' To give user admin rights"
  165. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Unadmin ident ' Take ident admin rights"
  166. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Global message ' Send message to all sbnc users"
  167. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Force ' Send all user to #/me"
  168. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Part #chan ' Part all users from a #chan"
  169. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Userlist ' So you can check all users in sbnc server"
  170. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Userinfo ident ' Check ident info"
  171. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Status ' To see how much bouncers added"
  172. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Modex ' Set all user mode +x"
  173. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Motd text ' Set message off the day"
  174. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Rules ident ' To send the bnc rules to ident"
  175. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Adminlist ' To see the admin & owner list"
  176. putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Version ' To see sbnc.tcl version"
  177. }
  178. "userlist" {
  179. putquick "sbnc tcl :if \{ \[lrange \[bncuserlist\] 0 49\] != \"\"\} \{ putquick \"NOTICE $nick :(sBNC) - Users - 1-50 - \[lrange \[bncuserlist\] 0 49\]\" \}"
  180. putquick "sbnc tcl :if \{ \[lrange \[bncuserlist\] 50 99\] != \"\"\} \{ putquick \"NOTICE $nick :(sBNC) - Users - 51-100 -> \[lrange \[bncuserlist\] 50 99\]\" \}"
  181.  
  182. }
  183. "userinfo" {
  184. set ident [lindex [split $arg] 1]
  185. if {$ident == ""} {
  186. putserv "NOTICE $nick :Error. Wrong syntax. Use $sbnc(trigger)sbnc userinfo 'ident'."
  187. } else {
  188. putserv "sbnc tcl :putserv \"NOTICE $nick :USER: $ident\""
  189. putserv "sbnc tcl :putserv \"NOTICE $nick :NICK: \[getbncuser $ident nick\]\""
  190. putserv "sbnc tcl :putserv \"NOTICE $nick :CHANNELS: \[getbncuser $ident channels\]\""
  191. putserv "sbnc tcl :putserv \"NOTICE $nick :VHOST: \[getbncuser $ident vhost\]\""
  192. putserv "sbnc tcl :putserv \"NOTICE $nick :CONNECTED: \[getbncuser $ident hasclient\]\""
  193. putserv "sbnc tcl :putserv \"NOTICE $nick :HOST: \[getbncuser $ident client\]\""
  194. putserv "sbnc tcl :putserv \"NOTICE $nick :END OFF USERINFO\""
  195. }
  196. }
  197. "modex" {
  198. putserv "sbnc tcl :foreach bu \[bncuserlist\] \{ simul \$bu \"MODE \[getbncuser \$bu nick\] +x\" \}"
  199. putserv "NOTICE $nick :Done. All sBNC users set mode +x"
  200. return
  201. }
  202. "motd" {
  203. set ident [lrange $arg 1 end]
  204. if {$ident == ""} {
  205. putserv "NOTICE $nick :Error. Wrong Syntax. Use $sbnc(trigger)sbnc Motd 'text'."
  206. } else {
  207. putserv "sbnc motd :$ident"
  208. putserv "NOTICE $nick :Done. The Motd Has Been Set To: $ident"
  209. }
  210. }
  211. "rules" {
  212. set ident [lindex [split $arg] 1]
  213. if {$ident == ""} {
  214. putserv "NOTICE $nick :Error. Wrong syntax. Use $sbnc(trigger)sbnc rules 'ident"
  215. } else {
  216. putquick "NOTICE $nick :Sending sBNC Rules To $ident"
  217. putquick "PRIVMSG $ident :$chan sBNC Rules"
  218. putquick "PRIVMSG $ident :1) You need to be auth'd and have usermode +x active"
  219. putquick "PRIVMSG $ident :2) You are not allowed to change bnc realname"
  220. putquick "PRIVMSG $ident :3) You are not allowed to part #/me"
  221. putquick "PRIVMSG $ident :4) You are not allowed to change your vhost"
  222. putquick "PRIVMSG $ident :5) You are not allowed to spam ² much"
  223. putquick "PRIVMSG $ident :6) You Want To Use This 7CmOr Your sBNC Will Be Suspended"
  224. putquick "PRIVMSG $ident :7) if you need help join #/me.help"
  225. putquick "PRIVMSG $ident :8) /sbnc set quser <Q AUTH NAME>"
  226. putquick "PRIVMSG $ident :9) /sbnc set qpass <Q AUTH PASS>"
  227. putquick "PRIVMSG $ident :10) /sbnc set qx on"
  228. putquick "PRIVMSG $ident :Ended sBNC Rules For $chan"
  229.  
  230. }
  231. }
  232. "status" {
  233. putquick "PRIVMSG -sBNC :tcl :set bncall 0 \; foreach sbnc(user) \[bncuserlist\] \{ incr bncall 1 \} \; putquick \"NOTICE $nick :There Are (\${bncall}) sBNC's Added On This Server. \""
  234. }
  235. "adminlist" {
  236. putquick "NOTICE $nick :Admin list: [userlist -n+m]"
  237. putquick "NOTICE $nick :Owner list: [userlist +n]"
  238. }
  239. "version" {
  240. putserv "NOTICE $nick :sBNC.tcl Version 2.4 Updated (11/6/08) by /me To Include Userinfo/Modex/Motd/Rules/Status/Adminlist & Creator: GeeX'W"
  241. }
  242. "default" {
  243. putserv "NOTICE $nick :Error. Use $sbnc(trigger)sbnc help to see a command overview."
  244. }
  245. }
  246. }
Add Comment
Please, Sign In to add comment