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 

To ignore command for a time specifies

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


Joined: 07 May 2009
Posts: 3

PostPosted: Thu May 07, 2009 12:44 pm    Post subject: To ignore command for a time specifies Reply with quote

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
View user's profile Send private message Visit poster's website
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Thu May 07, 2009 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
hmetall
Voice


Joined: 07 May 2009
Posts: 3

PostPosted: Fri May 08, 2009 7:26 am    Post subject: Reply with quote

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.


Very Happy
_________________
Sou Brasileiro.
Back to top
View user's profile Send private message Visit poster's website
Fill
Halfop


Joined: 18 Jan 2009
Posts: 80

PostPosted: Fri May 08, 2009 7:54 am    Post subject: Reply with quote

hehe, sou de Portugal tambem! Razz
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