| View previous topic :: View next topic |
| Author |
Message |
hmetall Voice
Joined: 07 May 2009 Posts: 3
|
Posted: Thu May 07, 2009 12:44 pm Post subject: To ignore command for a time specifies |
|
|
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: |
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. |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Thu May 07, 2009 5:22 pm Post subject: |
|
|
Boas
Sou Portugues, Portugal!
Bem existe uma maneira relativamente facil:
| Code: |
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 |
|
| Back to top |
|
 |
hmetall Voice
Joined: 07 May 2009 Posts: 3
|
Posted: Fri May 08, 2009 7:26 am Post subject: |
|
|
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.
 _________________ Sou Brasileiro. |
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Fri May 08, 2009 7:54 am Post subject: |
|
|
hehe, sou de Portugal tambem!  |
|
| Back to top |
|
 |
|