This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

To ignore command for a time specifies

Help for those learning Tcl or writing their own scripts.
Post Reply
h
hmetall
Voice
Posts: 3
Joined: Thu May 07, 2009 11:01 am
Contact:

To ignore command for a time specifies

Post by hmetall »

Good afternoon to All.

Firstly he/she wanted to say that am Brazilian I am writing through
translators;)

Good My problem is the following I am new in TCL
I am wanting to do the following function for TCL

That she catches a word it specifies of another channel I specify and write in another channel
Tie oh it is simple the problem that if the person repeats the same word I wanted
that the script didn't repeat her for a certain time the same command or it ignores himself for certain
time!


I will pass my first script.

Code: Select all

set canal1 "#UOplus"
set canal2 #EBclan"

bind pubm - *.am* pub_am
bind pubm - *.save* pub_save


proc pub_am {nick host handle channel arg} {

  putserv "PRIVMSG #EBclan :.am"


  return 1
}

proc pub_save {nick host handle channel arg} {

  putserv "PRIVMSG #EBclan :.save"


  return 1
}

putlog "TCL Captura \2AM - SAVE \2 Carregada..."

Could anybody help me to do that as I should do?

They will understand it is simple to catch a command of a channel and it orders for other and the principal not to let to repeat the same command for a certain time.

Muito Obrigado.
Thank you.
Sou Brasileiro.
g
garfwen
Halfop
Posts: 61
Joined: Wed Mar 12, 2008 5:16 pm

Post by garfwen »

Boas

Sou Portugues, Portugal!


Bem existe uma maneira relativamente facil:

Code: Select all


bind pub - .am pub_am
bind pub - .save pub_save

# Apos o utilizador fazer um comando o bot vai deixar de responder passado X segundos
# Metes portanto aqui o tempo, em segundos, que o bot esteja calado
set repeattime 120

set time 0


set canal1 "#UOplus"
set canal2 #EBclan" 


proc pub_am {nick host handle channel arg} {
global time repeattime
if {[expr [unixtime] - $time] >= $repeattime } {
  putserv "PRIVMSG #EBclan :.am"
set time [unixtime]
}
}

proc pub_save {nick host handle channel arg} {
global time repeattime
if {[expr [unixtime] - $time] >= $repeattime } {
  putserv "PRIVMSG #EBclan :.save"
set time [unixtime]
}
}

putlog "TCL Captura \2AM - SAVE \2 Carregada..." 
[ Não foi testado - Untested ]

Neste script o bot "guarda" a ultima vez que foi executado o comando e faz uma conta para ver se a diferença de tempo entre a ultima vez e o tempo real é maior ou igual que o tempo minimo para que volte a responder.


Espero que tenhas percebido...
Cumps GaRfWeN
h
hmetall
Voice
Posts: 3
Joined: Thu May 07, 2009 11:01 am
Contact:

Post by hmetall »

Bom Dia garfwen

Maravilha em Este Forum aqui nao tem explicacao 100%
Galera aqui se ajuda mesmo.

Bom Deu Tudo Certo ai garfwen

Muito Obrigado Pela Ajuda e pela rapides !

Flw.


:D
Sou Brasileiro.
F
Fill
Halfop
Posts: 80
Joined: Sun Jan 18, 2009 6:08 pm

Post by Fill »

hehe, sou de Portugal tambem! :P
Post Reply