Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # +-------------------+
- # | c o p y r i g h t |
- # +-------------------+
- #
- # Copyright (C) 2006 Laurids 'GeeX' W.
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- #
- # Manages your sbnc over irc
- # configuration
- # variables
- set sbnc(trigger) "\$"
- set sbnc(version) "2.4"
- set sbnc(author) "Laurids 'GeeX' W. (#GeeX at Quakenet) - Edited by zevlink to include userinfo/modex/motd/rules/status/adminlist & improvements (21/5/08)"
- set sbnc(chan) "#chan"
- set sbnc(ident) "ident"
- set sbnc(ircserver) "irc.quakenet.org 6667"
- set sbnc(server) "server"
- set sbnc(port) "port"
- set sbnc(realname) "15sBNC By #chan"
- set sbnc(iface) "none"
- # bindings
- bind PUB n|- $sbnc(trigger)sbnc sbnc:iface
- # copyright
- putlog "sBNC Script version $sbnc(version) scripted by $sbnc(author)"
- # source (again DO NOT change anything if you are not 100% sure)
- proc sbnc:iface { nick host hand chan arg } {
- global sbnc
- switch -exact -- [string tolower [lindex [split $arg] 0]] {
- "add" {
- set ident [lindex [split $arg] 1]
- set password [expr {int(rand()*1000000) + 1}]
- set bncuser [lindex [split $arg] 2]
- if {$ident == ""} {
- putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc add 'ident' ?nick?."
- return
- }
- putquick "SBNC ADDUSER $ident $password"
- putquick "SBNC SIMUL $ident SBNC SET REALNAME $sbnc(realname)"
- putquick "SBNC SIMUL $ident SBNC SET SERVER $sbnc(ircserver)"
- putquick "SBNC SIMUL $ident SBNC SET AUTOMODES +ix"
- utimer 60 [list putquick "SBNC SIMUL $ident JOIN $sbnc(chan)"]
- putquick "NOTICE $nick :New (sBNC) User Added -- Ident $ident --"
- putquick "NOTICE $nick :/server -m $sbnc(server):$sbnc(port) $password -i $ident $ident`BNC $ident@moon.valueshells.net -"
- putquick "NOTICE $nick :(sBNC) Info Send To $bncuser --"
- if {$bncuser == ""} {
- return
- } elseif {[onchan $bncuser $chan]} {
- putserv "PRIVMSG $bncuser :Your BNC data, $bncuser:"
- putserv "PRIVMSG $bncuser :server -m $sbnc(server):$sbnc(port) $password -i $ident $ident`BNC $ident@moon.valueshellsnet -- Iface: $sbnc(iface)"
- putserv "PRIVMSG $bncuser :If you need help, just join $sbnc(#me.help)."
- } else {
- putserv "NOTICE $nick :Error. $bncuser is not on $chan."
- return
- }
- }
- "del" {
- set ident [lindex [split $arg] 1]
- if {$ident == ""} {
- putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc del 'ident'."
- return
- } else {
- putquick "SBNC DELUSER $ident"
- putquick "NOTICE $nick :sBNC Deleted By $nick Ident: ($ident)"
- }
- }
- "password" {
- set ident [lindex [split $arg] 1]
- set password [expr {int(rand()*1000000) + 1}]
- if {$ident == ""} {
- putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc password 'ident'."
- return
- } else {
- putquick "SBNC RESETPASS $ident $password"
- putquick "NOTICE $nick :Done. New password for user ($ident) created."
- putquick "NOTICE $nick :Password: $password"
- }
- }
- "admin" {
- set ident [lindex [split $arg] 1]
- if {$ident == "$sbnc(ident)"} {
- putquick "NOTICE $nick :Error This ident is already an admin"
- return
- } elseif {$ident == ""} {
- putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc admin 'ident'."
- return
- } else {
- putquick "SBNC ADMIN $ident"
- putquick "NOTICE $nick :Done. User ($ident) has now admin rights."
- }
- }
- "unadmin" {
- set ident [lindex [split $arg] 1]
- if {$ident == "$sbnc(ident)"} {
- putquick "NOTICE $nick :Error This ident needs admin rights."
- return
- } elseif {$ident == ""} {
- putserv "NOTICE $nick Error Wrong syntax. Use $sbnc(trigger)sbnc unadmin 'ident'."
- return
- } else {
- putquick "SBNC UNADMIN $ident"
- putquick "NOTICE $nick :Done Admin Rights For User ($ident) Deleted."
- }
- }
- "global" {
- set arg [lrange [split $arg] 1 end]
- if {$arg == ""} {
- putserv "NOTICE $nick :Error Wrong syntax. Use $sbnc(trigger)sbnc global 'message'."
- return
- } else {
- putquick "SBNC GLOBAL $arg"
- putquick "NOTICE $nick :Done Global notice to all bouncer users transmitted."
- }
- }
- "force" {
- set sbnc(force) "[lindex [split $arg] 1]"
- if {$sbnc(force) == ""} {
- putserv "NOTICE $nick :sBNC Forcing All Users To Join #/me By: $nick"
- putserv "SBNC tcl :foreach sbnc(user) \[bncuserlist\] {setctx \$sbnc(user) ; putserv \"join #/me\" }"
- return
- }
- }
- "part" {
- set sbnc(partchan) "[lindex [split $arg] 1]"
- if {$sbnc(partchan) == ""} {
- putserv "NOTICE $nick :Error. Wrong syntax. Use $sbnc(trigger)sbnc part 'channel'."
- return
- } elseif {[string first # $sbnc(partchan)] != 0} {
- putserv "NOTICE $nick :Error. The channel has to start with a '#'."
- return
- } else {
- putserv "NOTICE $nick :sBNC Forcing All Bouncer To Part $sbnc(partchan) By: $nick"
- putserv "SBNC tcl :foreach sbnc(user) \[bncuserlist\] {setctx \$sbnc(user) ; channel remove $sbnc(partchan)}"
- return
- }
- }
- "help" {
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Add ident nick ' To add user bnc"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Del ident ' To delete user bnc"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Password ident ' To change user password"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Admin ident ' To give user admin rights"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Unadmin ident ' Take ident admin rights"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Global message ' Send message to all sbnc users"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Force ' Send all user to #/me"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Part #chan ' Part all users from a #chan"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Userlist ' So you can check all users in sbnc server"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Userinfo ident ' Check ident info"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Status ' To see how much bouncers added"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Modex ' Set all user mode +x"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Motd text ' Set message off the day"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Rules ident ' To send the bnc rules to ident"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Adminlist ' To see the admin & owner list"
- putserv "NOTICE $nick :sBNC help: $sbnc(trigger)sbnc Version ' To see sbnc.tcl version"
- }
- "userlist" {
- putquick "sbnc tcl :if \{ \[lrange \[bncuserlist\] 0 49\] != \"\"\} \{ putquick \"NOTICE $nick :(sBNC) - Users - 1-50 - \[lrange \[bncuserlist\] 0 49\]\" \}"
- putquick "sbnc tcl :if \{ \[lrange \[bncuserlist\] 50 99\] != \"\"\} \{ putquick \"NOTICE $nick :(sBNC) - Users - 51-100 -> \[lrange \[bncuserlist\] 50 99\]\" \}"
- }
- "userinfo" {
- set ident [lindex [split $arg] 1]
- if {$ident == ""} {
- putserv "NOTICE $nick :Error. Wrong syntax. Use $sbnc(trigger)sbnc userinfo 'ident'."
- } else {
- putserv "sbnc tcl :putserv \"NOTICE $nick :USER: $ident\""
- putserv "sbnc tcl :putserv \"NOTICE $nick :NICK: \[getbncuser $ident nick\]\""
- putserv "sbnc tcl :putserv \"NOTICE $nick :CHANNELS: \[getbncuser $ident channels\]\""
- putserv "sbnc tcl :putserv \"NOTICE $nick :VHOST: \[getbncuser $ident vhost\]\""
- putserv "sbnc tcl :putserv \"NOTICE $nick :CONNECTED: \[getbncuser $ident hasclient\]\""
- putserv "sbnc tcl :putserv \"NOTICE $nick :HOST: \[getbncuser $ident client\]\""
- putserv "sbnc tcl :putserv \"NOTICE $nick :END OFF USERINFO\""
- }
- }
- "modex" {
- putserv "sbnc tcl :foreach bu \[bncuserlist\] \{ simul \$bu \"MODE \[getbncuser \$bu nick\] +x\" \}"
- putserv "NOTICE $nick :Done. All sBNC users set mode +x"
- return
- }
- "motd" {
- set ident [lrange $arg 1 end]
- if {$ident == ""} {
- putserv "NOTICE $nick :Error. Wrong Syntax. Use $sbnc(trigger)sbnc Motd 'text'."
- } else {
- putserv "sbnc motd :$ident"
- putserv "NOTICE $nick :Done. The Motd Has Been Set To: $ident"
- }
- }
- "rules" {
- set ident [lindex [split $arg] 1]
- if {$ident == ""} {
- putserv "NOTICE $nick :Error. Wrong syntax. Use $sbnc(trigger)sbnc rules 'ident"
- } else {
- putquick "NOTICE $nick :Sending sBNC Rules To $ident"
- putquick "PRIVMSG $ident :$chan sBNC Rules"
- putquick "PRIVMSG $ident :1) You need to be auth'd and have usermode +x active"
- putquick "PRIVMSG $ident :2) You are not allowed to change bnc realname"
- putquick "PRIVMSG $ident :3) You are not allowed to part #/me"
- putquick "PRIVMSG $ident :4) You are not allowed to change your vhost"
- putquick "PRIVMSG $ident :5) You are not allowed to spam ² much"
- putquick "PRIVMSG $ident :6) You Want To Use This 7CmOr Your sBNC Will Be Suspended"
- putquick "PRIVMSG $ident :7) if you need help join #/me.help"
- putquick "PRIVMSG $ident :8) /sbnc set quser <Q AUTH NAME>"
- putquick "PRIVMSG $ident :9) /sbnc set qpass <Q AUTH PASS>"
- putquick "PRIVMSG $ident :10) /sbnc set qx on"
- putquick "PRIVMSG $ident :Ended sBNC Rules For $chan"
- }
- }
- "status" {
- 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. \""
- }
- "adminlist" {
- putquick "NOTICE $nick :Admin list: [userlist -n+m]"
- putquick "NOTICE $nick :Owner list: [userlist +n]"
- }
- "version" {
- 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"
- }
- "default" {
- putserv "NOTICE $nick :Error. Use $sbnc(trigger)sbnc help to see a command overview."
- }
- }
- }
Add Comment
Please, Sign In to add comment