egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sBNC Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Fri Jul 21, 2006 5:16 pm    Post subject: sBNC Script Reply with quote

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. Smile
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Jul 23, 2006 7:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
spijon
Voice


Joined: 27 Aug 2006
Posts: 33

PostPosted: Sat Feb 07, 2009 3:55 am    Post subject: Custom Reply with quote

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
View user's profile Send private message
c0re
Voice


Joined: 18 Jan 2009
Posts: 16

PostPosted: Fri Mar 27, 2009 3:41 pm    Post subject: Reply with quote

can you make it for psybnc please
Back to top
View user's profile Send private message
Kein
Voice


Joined: 09 Apr 2008
Posts: 21

PostPosted: Mon Mar 30, 2009 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message
n0radx
Voice


Joined: 08 Jun 2016
Posts: 2

PostPosted: Thu Aug 25, 2016 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Thu Nov 17, 2016 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber