| View previous topic :: View next topic |
| Author |
Message |
GeeX Voice
Joined: 19 Sep 2005 Posts: 29
|
Posted: Fri Jul 21, 2006 5:16 pm Post subject: sBNC Script |
|
|
| Code: |
# __ __ __
# /\ \ /\ \ __/\ \
# \ \ \ __ \ \ \/\ \ \ \
# \ \ \ __ /'__`\ \ \ \ \ \ \ \
# \ \ \_\ \/\ \_\ \_\ \ \_/ \_\ \
# \ \____/\ \__/ \_\\ `\___ ___/
# \/___/ \/__/\/_/ '\/__//__/
#
# sBNC Script by LaW.
#
# | author: LaW
# | version: 1.6
# | web: www.myGeeX.de
# | irc: #GeeX at Quakenet
# | contact: www.myGeeX.de/?page_id=17
#
# +-------------+
# | r e a d m e |
# +-------------+
#
# | upload this script via ftp and write:
# | - 'source url/to/script/sbnc.tcl'
# | into your eggdrop configuration.
# | After you have done this rehash or restart your eggdrop.
# | Type !sbnc help to see the help.
#
# +-------------------+
# | c h a n g e l o g |
# +-------------------+
#
# | - (03.05.06) v1.0: release
# | - (14.05.06) v1.1: added list command
# | - (26.05.06) v1.2: added modex command
# | - (05.06.06) v1.3: code review
# | - (12.06.06) v1.4: added add command
# | - (21.06.06) v1.5: more advanced code
# | - (18.07.06) v1.6: full sbnc management added
#
# +-------------------+
# | 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.
#
# Don't change anything.
# Report bugs to #GeeX at Quakenet.
# Manages your sbnc over irc
# configuration
# variables
set sbnc(trigger) "\!"
set sbnc(version) "1.6"
set sbnc(author) "Laurids 'GeeX' W. (#GeeX at Quakenet)"
set sbnc(chan) "#GeeX"
set sbnc(ident) "Ch"
set sbnc(ircserver) "irc.quakenet.org 6667"
set sbnc(server) "myGeeX.de"
set sbnc(port) "1337"
set sbnc(realname) "powered by #GeeX"
set sbnc(iface) "http://sbnc.myGeeX.de"
# bindings
bind PUB n|- $sbnc(trigger)sbnc sbnc:iface
bind NOTC | * sbnc:notice
# 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 realname [lindex [split $arg] 2]
if {$realname == ""} {
set realname $sbnc(realname)
}
putquick "SBNC ADDUSER $ident $password"
putquick "SBNC SIMUL $ident SBNC SET REALNAME $realname"
putquick "SBNC SIMUL $ident SBNC SET SERVER $sbnc(ircserver)"
utimer 60 [list putquick "SBNC SIMUL $ident JOIN $sbnc(chan)"]
putquick "NOTICE $nick :Done. New bnc added."
putquick "NOTICE $nick :Server: $sbnc(server), Port: $sbnc(port), Ident: $ident, Password: $password, Iface: $sbnc(iface)"
}
"del" {
set ident [lindex [split $arg] 1]
putquick "SBNC DELUSER $ident"
putquick "NOTICE $nick :Done. User ($ident) deleted."
}
"password" {
set ident [lindex [split $arg] 1]
set password [expr {int(rand()*1000000) + 1}]
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
} 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
} else {
putquick "SBNC UNADMIN $ident"
putquick "NOTICE $nick :Done. Admin rights for user ($ident) deleted."
}
}
"global" {
set arg [lindex [split $arg] 1]
putquick "SBNC GLOBAL $arg"
putquick "NOTICE $nick :Done. Global notice to all bouncer users transmitted."
}
"check" {
set sbnc(nick) $nick
putquick "SBNC WHO"
}
"help" {
putserv "NOTICE $nick :\037sBNC help\037:"
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc add 'ident' 'realname' to add a bouncer."
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc del 'ident' to delete a bouncer."
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc password 'ident' to generate a new password."
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc admin 'ident' to give admin rights."
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc unadmin 'ident' to remove admin rights."
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc global 'message' to send a global notice to all bouncer users."
putserv "NOTICE $nick :Use $sbnc(trigger)sbnc check to check if all bouncer users are available at your channel."
putserv "NOTICE $nick :End of list."
}
"default" {
putserv "NOTICE $nick :Error. Use $sbnc(trigger)sbnc help to see a command overview."
}
}
}
proc sbnc:notice { nick host hand arg dest } {
global sbnc
if {$nick != "-sBNC"} {
return
} elseif {$arg == "No such user: *" || $arg == "Done."} {
return
} elseif {$arg == "End of USERS."} {
sbnc:notice:end $sbnc(nick)
} else {
set ident [lindex [split $arg ()] 0]
regsub -all {@} $ident { } ident
regsub -all {\*} $ident { } ident
append sbnc(db) " $ident"
}
}
proc sbnc:notice:end { nick } {
global sbnc
set sbnc(missing) ""
foreach user [chanlist $sbnc(chan)] {
set idents [lindex [split [getchanhost $user $sbnc(chan)] @] 0]
foreach ident [split $sbnc(db)] {
if {[string match "*$ident*" "$idents"]} {
lappend sbnc(missing) $idents
}
}
}
set sbnc(mlist) ""
foreach idents [split $sbnc(db)] {
if {![string match "*$idents*" "$sbnc(missing)"]} {
putserv "SBNC SIMUL $idents JOIN $sbnc(chan)"
}
}
unset sbnc(db)
putquick "NOTICE $sbnc(nick) :Done. All bouncer users should now be available at your channel."
}
|
With this Script you can manage you sbnc via public commands.  |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sun Jul 23, 2006 7:52 pm Post subject: |
|
|
why on earth would you want to do it via an eggdrop?
I think the more logical choice would be to make sbnc spawn a client and use that as a bot. |
|
| Back to top |
|
 |
spijon Voice
Joined: 27 Aug 2006 Posts: 33
|
Posted: Sat Feb 07, 2009 3:55 am Post subject: Custom |
|
|
Greate script there dude!
Is it posible to get the output notice to something like :
| Code: | | putquick "NOTICE $nick :The quick one: //emailaddr $ident | /server -a $sbnc(server) -g $sbnc(server) -p $sbnc(port) -w $password -d $sbnc(server) | /server $sbnc(server)" |
All it needs is a @ after the ident :/
Edit:
And i was alsow thinking of a update to the add ".sbnc add ident ircnick" privmsg the info to the ircnick. |
|
| Back to top |
|
 |
c0re Voice
Joined: 18 Jan 2009 Posts: 16
|
Posted: Fri Mar 27, 2009 3:41 pm Post subject: |
|
|
| can you make it for psybnc please |
|
| Back to top |
|
 |
Kein Voice
Joined: 09 Apr 2008 Posts: 21
|
Posted: Mon Mar 30, 2009 8:54 am Post subject: |
|
|
| c0re wrote: | | can you make it for psybnc please |
Yes, but not for you. _________________ I'm too lazy for all of this |
|
| Back to top |
|
 |
n0radx Voice
Joined: 08 Jun 2016 Posts: 2
|
Posted: Thu Aug 25, 2016 8:30 am Post subject: |
|
|
| is it possible to modify the script in order to allow multiple bouncer connections ? (for example the eggdrop will connect to 10 psybnc admins - wich will remain in the partyline - and add users from them) |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Thu Nov 17, 2016 12:28 pm Post subject: |
|
|
| c0re wrote: | | can you make it for psybnc please |
Have you checked psyBNC scripting? You might want something like this. It's pretty simple to add more commands as you want/need them. You may also like to check the psyBNC forum scripting category _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
|