Add a !join #chan feature to this bot for SBNC1.2

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

Add a !join #chan feature to this bot for SBNC1.2

Postby m4c » Tue Jun 29, 2010 6:43 pm

Hi,

someone gave me this bot which is awesome and it works great with SBNC1.2, it's for bnc hosting chans to add/del account and all you have to do is load it with the sbnc and it works.

But since sbnc1.2 dosn't have a simulall command anymore there is no way for me to keep the users in the base chan, which is a very minimal pay back for giving out many bnc accounts.

Was wondering if anyone can add a command to this bot that will join all users to a specific channl i.e !join #flal
Code: Select all
# Ident of Admin BNC. Bouncer has to be Op in Channel to Change the
# topic. We recommend to use this Bouncer not for real IRC usage.
set sbnc_pubadmin_admin "sbnc"

# Server the User should connect to. Note every User may change Server
# itself.
set sbnc_pubadmin_ircserver "irc.quakenet.org"

# The Admins channel. This is the Channel were Users come in and get
# their Bouncers.
set sbnc_pubadmin_channel "#chan"

# The maximum Number of Bouncers can be added via Script
set sbnc_pubadmin_bnc_max 15

# Command to use to control the Script.
# Do not use ? and *, they will act as wildcards.
set sbnc_pubadmin_command "!sbnc"

# Bouncer server. Only the User will see this text. Set it to your
# Servers IP and Port.
set sbnc_pubadmin_bncserver "x.x.x.x:5555"

######################################################################
######################################################################
#####           DO NOT CHANGE ANYTHING BELOW HERE                #####
######################################################################
######################################################################

setctx $sbnc_pubadmin_admin

bind pub - $sbnc_pubadmin_command sbnc_pubadmin_verwaltung

proc sbnc_pubadmin_topic {} {
   global sbnc_pubadmin_bnc_max sbnc_pubadmin_admin sbnc_pubadmin_channel
   
   setctx $sbnc_pubadmin_admin
   
   putserv "TOPIC $sbnc_pubadmin_channel :Free Bouncers by $sbnc_pubadmin_channel - Bouncer: [llength [bncuserlist]]/$sbnc_pubadmin_bnc_max ([expr {$sbnc_pubadmin_bnc_max-[llength [bncuserlist]]}] frei)"
}

proc sbnc_pubadmin_verwaltung {n u h c t} {
   global sbnc_pubadmin_bnc_max admin sbnc_pubadmin_server sbnc_pubadmin_channel sbnc_pubadmin_bncserver sbnc_pubadmin_admin sbnc_pubadmin_ircserver
   
   set params [split $t]
   
   setctx $sbnc_pubadmin_admin
   
   if {[isop $n $sbnc_pubadmin_channel]} {
      set command [string tolower [lindex $params 0]]
      
      if {$command == "add"} {
         set ident [string tolower [lindex $params 1]]
         set nick [lindex $params 2]
         
         if {$nick == ""} {
            set nick $n
         }
         
         if {$ident == "" || ![bncvalidusername $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Invalid ident format."
            return
         }
         
         if {[llength [bncuserlist]] > $sbnc_pubadmin_bnc_max} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Limit was reached."
            return
         }
         
         if {![onchan $nick $c]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :$nick is not on Channel."
            return
         }
         
         if {[bncvaliduser $ident] && [getbncuser $ident lock]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident was locked. Use '?sbnc unsuspend $ident' to unlock it."
            return
         } elseif {[bncvaliduser $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident already exists."
            return
         }
         
         set passwort [randstring 10]
         
         addbncuser $ident $passwort
         
         setbncuser $ident server $sbnc_pubadmin_ircserver
         setbncuser $ident port "6667"
         
         internaltimer 30 0 sbnc_pubadmin_join $ident
         
         putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident was added."
         putserv "PRIVMSG $nick :Server: $sbnc_pubadmin_bncserver"
         putserv "PRIVMSG $nick :Ident/Username: $ident"
         putserv "PRIVMSG $nick :Password: $passwort"
         putserv "PRIVMSG $sbnc_pubadmin_channel :Login data has been sent to $nick"
         
         sbnc_pubadmin_topic
         
         return
      } elseif {$command == "del"} {
         set ident   [string tolower [lindex $params 1]]
         
         if {$ident == "" || ![bncvalidusername $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Invalid ident format."
            return
         }
         
         if {![bncvaliduser $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident doesn't exist."
            return
         }
         
         delbncuser $ident
         
         putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident was deleted."
         
         sbnc_pubadmin_topic
         
         return
      } elseif {$command == "pass"} {
         set ident   [string tolower [lindex $params 1]]
         set nick   [lindex $params 2]
         
         if {$nick == ""} {
            set nick $n
         }
         
         if {$ident == "" || ![bncvalidusername $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Invalid ident format."
            return
         }
         
         if {![onchan $nick $c]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :$nick is not on Channel."
            return
         }
         
         if {![bncvaliduser $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident doesn't exist."
            return
         }
         
         set passwort [randstring 10]
         
         setbncuser $ident password $passwort
         
         putserv "PRIVMSG $sbnc_pubadmin_channel :Password for $ident was changed."
         putserv "PRIVMSG $nick :Server: $sbnc_pubadmin_bncserver"
         putserv "PRIVMSG $nick :Ident/Username: $ident"
         putserv "PRIVMSG $nick :Password: $passwort"
         putserv "PRIVMSG $sbnc_pubadmin_channel :Login data has been sent to $nick"
         
         return
      } elseif {$command == "topic"} {
         sbnc_pubadmin_topic
         
         return
      } elseif {$command == "unsuspend"} {
         set ident   [string tolower [lindex $params 1]]
         
         if {$ident == "" || ![bncvalidusername $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Invalid ident format."
            return
         }
         
         if {[llength [bncuserlist]] > $sbnc_pubadmin_bnc_max} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Limit was reached."
            return
         }
         
         if {![bncvaliduser $ident]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident doesn't exist."
            return
         } elseif {![getbncuser $ident lock]} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident isn't locked."
            return
         }
         
         setbncuser $ident lock 0
         setbncuser $ident tag partcount 0
         
         set ctx [getctx]
         
         setctx $ident
         jump
         
         setctx $ctx
         
         internaltimer 30 0 sbnc_pubadmin_join $ident
         
         putserv "PRIVMSG $sbnc_pubadmin_channel :Bouncer $ident was unlocked. Login data was not changed."
         
         sbnc_pubadmin_topic
         
         return
      } else {
         if {[llength $params] > 0} {
            putserv "PRIVMSG $sbnc_pubadmin_channel :Error: \"[join $params]\" is not a valid command"
         }
         
         putserv "PRIVMSG $sbnc_pubadmin_channel := (add|del|pass|topic|unsuspend)"
      }
   }
}

proc sbnc_pubadmin_join {ident} {
   global sbnc_pubadmin_channel
   
   setctx $ident
   
   if {![getbncuser $ident hasserver] && ![getbncuser $ident lock]} {
      jump
      
      internaltimer 30 0 sbnc_pubadmin_join $ident
      
   } elseif {[getbncuser $ident hasserver] && ![onchan $::botnick $sbnc_pubadmin_channel]} {
      putserv "JOIN $sbnc_pubadmin_channel"
      
   }
}
m4c
 

Re: Add a !join #chan feature to this bot for SBNC1.2

Postby jonlar » Fri Jul 09, 2010 6:39 pm

Why dont u use the sbnc bot thats posted somewhere here? Has all what u are looking for .sbnc join #chan also
jonlar
 


Return to TCL Scripting Request

Who is online

Users browsing this forum: No registered users and 3 guests

cron