Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Basic Request script
- # GNU License
- # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- # /* This is a basic request script, It will join the channel, check some settings and stay/part if accepted.
- # * This does NOT add other bots to that channel.
- # * If you want it to do that, You will have to make it do that yourself :)
- # * If you have any questions about this script, feel free to ask me in #v1per on irc.quakenet.org
- # * Also, if you find any bugs, the same channel, my nickname is metroid
- # * Also, leave my copyright in, If you want to put your own copyright in MY script, Make your own script completely from scratch.
- # */
- # /* Installing the request script
- # * First, put the script into your /home/user/*eggdrop name*/scripts folder.
- # * Then at the end of your eggdrop.conf, Put:
- # * source scripts/request.tcl
- # * Just rehash the bot after you've done this and it should work.
- # */
- # /* This is a VERY basic idea of what you can use for a request system with eggdrops.
- # * It's very flexible as it's really easy to just add whatever you want to it :)
- # * Good luck with making your own request script and if you need some help, you can contact me.
- # */
- namespace eval solicito {
- variable version "1.0"
- variable author "metroid"
- # Configuration!
- # Our homechannel, they can only request here.
- variable homechan "#Radio"
- # Ammount of people we require.
- variable needed "15"
- # Do we want a Q or L?
- variable service "0"
- # Do we send a message to the homechannel when a request fails?
- variable tell "1"
- # End of Config!
- # Do NOT edit anything below these lines
- variable busy "0"
- bind pub -|- !solicito [namespace current]::solicito
- }
- proc solicito::solicito {nickname hostname handle channel arguments} {
- if {[string equal -nocase $channel $solicito::homechan]} {
- if {!$solicito::busy} {
- set chan [lindex [split $arguments] 0]
- if {$chan != "" && ![validchan $chan]} {
- if {[string index $chan 0] == "#"} {
- set solicito::busy 1
- bind RAW -|- 315 [namespace current]::who
- utimer 60 [list [namespace current]::timeout $chan]
- channel add $chan
- channel set $chan +usergreet
- set fp [open canales a+]
- puts $fp $chan
- close $fp
- set ::info "$nickname $chan"
- } else {
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Debes Digitar # Seguido Del Nombre De Tu Canal ."
- }
- } else {
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Lo Siento, Error En La Sintaxis Vuelve A Ejecutar El Comando !solicito #canal, De Lo Contrario Verifica Que El BOT RadioVip Ya Este En Tu canal ."
- }
- } else {
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Lo Sentimos, Ya Existe Una Peticion En Curso."
- }
- }
- }
- proc solicito::who {server raw arguments} {
- unbind RAW -|- 315 [namespace current]::who
- if {$solicito::busy} {
- if {![info exists ::info]} { return 0 }
- set nickname [lindex [split $::info] 0]
- set channel [lindex [split $::info] 1]
- unset ::info
- set solicito::busy 0
- if {![onchan $nickname $channel] || ![isop $nickname $channel]} {
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Usted No Esta En El Canal $channel O No Eres Founder/Sussesor/Admin."
- if {$solicito::tell} {
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Lo Sentimos, Solicitud Para El Canal $channel Denegada, $nickname O No Estas En el Canal $channel O No Eres Founder/Sussesor/Admin."
- }
- channel remove $channel
- return 0
- }
- if {$solicito::service} {
- if {![onchan L $channel] && ![onchan Q $channel]} {
- set busy 0
- putquick "PRIVMSG $solicito::homechan :Q or L was not found on $channel."
- if {$solicito::tell} {
- putserv "PRIVMSG $solicito::homechan :solicito for $channel failed. There is no Q or L on $channel."
- }
- channel remove $channel
- return 0
- }
- }
- if {[llength [chanlist $channel]] < $solicito::needed} {
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Procesando Su Solicitud, Deben Haber Al Menos 3($solicito::needed) 2Usuarios Conectados En el Canal 4$channel."
- if {$solicito::tell} {
- putserv "PRIVMSG $solicito::homechan :4$nickname 2Lo Sentimos, Solicitud Denegada. No Hay Suficientes Usuarios En El Canal $channel Solo Hay 3([llength [chanlist $channel]]) 2Usuarios. "
- }
- channel remove $channel
- return 0
- }
- # Solicito is accepted
- putquick "PRIVMSG $solicito::homechan :2La Solicitud Para El Canal $channel En Proceso Por Favor Espere."
- putquick "PRIVMSG $solicito::homechan :2Se Acepto La Solicitud De 4$nickname 2Para El Canal $channel, El Canal Tiene 3[llength [chanlist $channel]] 2Usuarios. ."
- putquick "PRIVMSG $channel :2Suscribiendo Bot RL Al Canal 4$channel 2Gracias Por Preferirnos."
- if {![validuser [nick2hand $nickname]]} {
- adduser $nickname *![getchanhost $nickname]
- chattr $nickname |+x $channel
- } else {
- chattr [nick2hand $nickname] |+x $channel
- }
- }
- }
- proc solicito::timeout {chan} {
- if {[validarg $chan] && ![botonchan $chan]} {
- channel remove $chan
- putquick "PRIVMSG $solicito::homechan :4$nickname 2Lo Siento, La Solicitud Para El Cana 4$chan 2Ha Fallado, El Bot No Puede Ingresar al canal 4$chan."
- if {[info exists ::info]} { unset ::info }
- }
- }
- proc solicito::version {} {
- putlog "Basic solicito script version: $solicito::version by $solicito::author was loaded successfully."
- }
- solicito::version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement