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 

Help !!! counter nick !request

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
kn1ghtt
Voice


Joined: 01 Aug 2022
Posts: 10

PostPosted: Sat Oct 01, 2022 9:33 am    Post subject: Help !!! counter nick !request Reply with quote

hello group... add code please:


kn1ght: !pedido coldplay - a sky full of stars

bot1: Tema 6aceptado 14con exito 06 kn1ght  14En un momento más 6la escucharas. [1 peticiones]

kn1ght: !pedido coldplay - yelow

bot1: Tema 6aceptado 14con exito 06 kn1ght  14En un momento más 6la escucharas. [2 peticiones]

charlie_decker: !pedido la konga - la kabaña

bot1: Tema 6aceptado 14con exito 06 charlie_decker 14En un momento más 6la escucharas. [1 peticiones]

and resumen add bot counter request nick

code:
Code:

set scwishtrigger "!pedido"
bind pub - $scwishtrigger  pub_wish
bind msg - $scwishtrigger  msg_wish

proc pub_wish { nick uhost handle chan arg } {
global CanalesRadio CanalAdmins CanalDjs limit
set temp [open "peticiones" r]
              set peticiones [gets $temp]
      close $temp
      if {$peticiones == "Abiertas"} {
     
if {$arg == ""} { putquick  [encoding convertfrom utf-8 "privmsg $chan :6 $nick 14Por Favor 13Especifica 14El Tema Que 13Deseas Pedir.6 !pedido Artista - Tema  14Gracias Por 13Sintonizar: 1 fanaticaextrema(com)   "]; return 0}
set host [lindex [split [getchanhost $nick $chan] @] 1]
      set idents [lindex [split [getchanhost $nick $chan] @] 0]
      if {[onchan $nick]} {set im "*!*@[join [lrange [split $host .] 0 end] .]"} else {set im "$nick"}
  if {[onchan $nick]} {set ident1 "*![join $idents]@*" }
  if {"$idents" == "ircap"} {set ident1 "*![join $idents]@[join $host]"
      } else {
      set ident1 "*![join $idents]@[join $host]" }
#para probarlo SOLO modifique la linea siguiente por if $chan == $CanalesRadio, porque el proceso/archivo status esta en otra parte del codigo y siempre daba q la radio estaba off       
if { [info exist arg] } {
set temp [open "djnick" r]
set djnick [gets $temp]
close $temp

if {![info exist limit]} { set limit 360}
      foreach {_nick time} [array get ::flood] { if {[expr [clock seconds] - $time] > $limit} { unset ::flood($_nick) } }
      foreach {_ident1 time} [array get ::flood] { if {[expr [clock seconds] - $time] > $limit} { unset ::flood($_ident1) } }
# Crear una variable global que guarde el tiempo en segundos que se ejecutó el comando:

# (al final del todo está)

# Comprobar si la variable existe y todavía no ha transcurrido el tiempo límite de 360 segundos

if {([info exists ::flood($nick)]) || ([info exists ::flood($ident1)])} {

# Existe, así que comprobar el tiempo transcurrido

set timeago [expr [clock seconds] - $::flood($nick)]
set timeago [expr [clock seconds] - $::flood($ident1)]
  # ahora $timeago contiene el tiempo que ha pasado entre ahora y cuando lo ejecutó
 
# si $timeago es menos tiempo que el que pusimos de límite...
if {$timeago < $limit} {

  set rest [expr $limit - $timeago]
      putmsg  $chan [encoding convertfrom utf-8 "6 $nick 14espera 4 [duration $rest] 14para solicitar otra 6canción nuevamente."]
if { $rest > 340 } {
newignore $im $handle "antiflood 2min" "2"
#putquick "PRIVMSG $chan :6 $nick 14espera 4 [duration $rest] 14para solicitar otra 6canción nuevamente.4?"
putlog "Ignore ($nick): $im $handle antiflood 2min"
newignore $ident1 $handle "antiflood2min" "2"
putlog "Ignore ($nick): $ident1 $handle antiflood 2min"
putmsg $CanalAdmins "4AVISO1!!!14 Se ha puesto en \002ignore\002 a \002$nick\002 (Antiflood 2 minutos) "
      } else { return }
}
} else {
# Este usuario es nuevo, le creamos la variable

putquick  [encoding convertfrom utf-8 "privmsg $CanalDjs :1Petición / En 01 $chan  el nick 6 $nick  solicita: 06 $arg "]
putserv  [encoding convertfrom utf-8 "privmsg $CanalAdmins :1Petición / En 01 $chan  el nick 6 $nick  solicita: 06 $arg "]
putquick  [encoding convertfrom utf-8 "privmsg $djnick :1Petición / En 01 $chan  el nick 6 $nick  solicita: 06 $arg "]

putquick  [encoding convertfrom utf-8 "privmsg $chan :6Tema 6aceptado 14con exito 06 $nick  14En un momento más 6la escucharas."]
set ::flood($nick) [clock seconds]
set ::flood($ident1) [clock seconds]
}
} else {
putquick "privmsg $chan :6Lo Siento 14El Comando 13No Se Puede 6Usar La 13Radio 14Está 6Fuera 13De 14Línea." }
} else {
               putquick  [encoding convertfrom utf-8 "privmsg $chan : 4Error1!  01 $nick  1Por ahora las peticiones estan cerradas."]
              return 0
}
}


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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