Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2019
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 6.47 KB | None | 0 0
  1. # Basic Request script
  2.  
  3. # GNU License
  4. # This program is free software; you can redistribute it and/or modify      
  5. # it under the terms of the GNU General Public License as published by      
  6. # the Free Software Foundation; either version 2 of the License, or          
  7. # (at your option) any later version.                                        
  8. #                                                                            
  9. # This program is distributed in the hope that it will be useful,            
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of            
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
  12. # GNU General Public License for more details.                              
  13. #                                                                            
  14. # You should have received a copy of the GNU General Public License          
  15. # along with this program; if not, write to the Free Software                
  16. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  17.  
  18. # /* This is a basic request script, It will join the channel, check some settings and stay/part if accepted.
  19. # *  This does NOT add other bots to that channel.
  20. # *  If you want it to do that, You will have to make it do that yourself :)
  21. # *  If you have any questions about this script, feel free to ask me in #v1per on irc.quakenet.org
  22. # *  Also, if you find any bugs, the same channel, my nickname is metroid
  23. # *  Also, leave my copyright in, If you want to put your own copyright in MY script, Make your own script completely from scratch.
  24. # */
  25.  
  26. # /* Installing the request script
  27. # *  First, put the script into your /home/user/*eggdrop name*/scripts folder.
  28. # *  Then at the end of your eggdrop.conf, Put:
  29. # *  source scripts/request.tcl
  30. # *  Just rehash the bot after you've done this and it should work.
  31. # */
  32.  
  33. # /* This is a VERY basic idea of what you can use for a request system with eggdrops.
  34. # *  It's very flexible as it's really easy to just add whatever you want to it :)
  35. # *  Good luck with making your own request script and if you need some help, you can contact me.
  36. # */
  37.  
  38.  
  39. namespace eval solicito {
  40.  variable version "1.0"
  41.  variable author  "metroid"
  42.  
  43.  # Configuration!
  44.  # Our homechannel, they can only request here.
  45.  variable homechan "#Radio"
  46.  # Ammount of people we require.
  47.  variable needed "15"
  48.  # Do we want a Q or L?
  49.  variable service "0"
  50.    
  51.  # Do we send a message to the homechannel when a request fails?
  52.  variable tell "1"
  53.  
  54.  # End of Config!
  55.  # Do NOT edit anything below these lines
  56.  
  57.  variable busy "0"
  58.    bind pub  -|-  !solicito  [namespace current]::solicito
  59. }
  60.  
  61. proc solicito::solicito {nickname hostname handle channel arguments} {
  62.  if {[string equal -nocase $channel $solicito::homechan]} {
  63.   if {!$solicito::busy} {
  64.    set chan [lindex [split $arguments] 0]
  65.    if {$chan != "" && ![validchan $chan]} {
  66.     if {[string index $chan 0] == "#"} {
  67.      set solicito::busy 1
  68.     bind RAW -|- 315 [namespace current]::who  
  69.     utimer 60 [list [namespace current]::timeout $chan]
  70.     channel add $chan
  71.     channel set $chan +usergreet
  72.    set fp [open canales a+]
  73.    puts $fp $chan
  74.       close $fp
  75.    set ::info "$nickname $chan"
  76.    } else {
  77.     putquick "PRIVMSG $solicito::homechan :4$nickname 2Debes Digitar # Seguido Del Nombre De Tu Canal ."
  78.    }
  79.   } else {
  80.     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 ."
  81.   }
  82.   } else {
  83.     putquick "PRIVMSG $solicito::homechan :4$nickname 2Lo Sentimos, Ya Existe Una Peticion En Curso."
  84.  }
  85.  }
  86. }
  87. proc solicito::who {server raw arguments} {
  88. unbind RAW -|- 315 [namespace current]::who
  89. if {$solicito::busy} {
  90.  if {![info exists ::info]} { return 0 }
  91.  set nickname [lindex [split $::info] 0]
  92.  set channel [lindex [split $::info] 1]
  93.  unset ::info
  94.  set solicito::busy 0
  95.  if {![onchan $nickname $channel] || ![isop $nickname $channel]} {
  96.   putquick "PRIVMSG $solicito::homechan :4$nickname 2Usted No Esta En El Canal $channel O No Eres Founder/Sussesor/Admin."
  97.   if {$solicito::tell} {
  98.   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."  
  99.   }
  100.   channel remove $channel
  101.   return 0  
  102.  }
  103.  if {$solicito::service} {
  104.    if {![onchan L $channel] && ![onchan Q $channel]} {  
  105.     set busy 0
  106.     putquick "PRIVMSG $solicito::homechan :Q or L was not found on $channel."
  107.     if {$solicito::tell} {
  108.      putserv "PRIVMSG $solicito::homechan :solicito for $channel failed. There is no Q or L on $channel."
  109.     }
  110.     channel remove $channel
  111.     return 0
  112.    }
  113.   }
  114.   if {[llength [chanlist $channel]] < $solicito::needed} {
  115.     putquick "PRIVMSG $solicito::homechan :4$nickname 2Procesando Su Solicitud, Deben Haber Al Menos 3($solicito::needed) 2Usuarios Conectados En el Canal 4$channel."
  116.        if {$solicito::tell} {
  117.      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. "
  118.     }
  119.     channel remove $channel
  120.     return 0
  121.   }
  122.   # Solicito is accepted
  123.   putquick "PRIVMSG $solicito::homechan :2La Solicitud Para El Canal $channel En Proceso Por Favor Espere."
  124.  putquick "PRIVMSG $solicito::homechan :2Se Acepto La Solicitud De 4$nickname 2Para El Canal $channel, El Canal Tiene 3[llength [chanlist $channel]] 2Usuarios. ."
  125.  putquick "PRIVMSG $channel :2Suscribiendo Bot RL Al Canal 4$channel 2Gracias Por Preferirnos."
  126.  if {![validuser [nick2hand $nickname]]} {
  127.    adduser $nickname *![getchanhost $nickname]
  128.    chattr $nickname |+x $channel
  129.   } else {
  130.    chattr [nick2hand $nickname] |+x $channel
  131.   }
  132.  }
  133. }
  134.  
  135. proc solicito::timeout {chan} {
  136.  if {[validarg $chan] && ![botonchan $chan]} {
  137.   channel remove $chan
  138.   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."
  139.   if {[info exists ::info]} { unset ::info }
  140.  }
  141. }
  142.                  
  143. proc solicito::version {} {
  144.  putlog "Basic solicito script version: $solicito::version by $solicito::author was loaded successfully."  
  145. }
  146.    
  147. solicito::version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement