Originally Posted by Fernet
And what if I want the timer stop also if a user write any word? For example an user say "HELLO" and timer stop.

Try using this variant code:
Code
on *:TEXT:*:#channel:{
  if (HELLO === $1 && $timer(COUNTER)) { .timerCOUNTER off | .hadd -mz counter timer 1800 | msg $chan The timer is disabled and can be started after 1800 secs = 30 mins. }
  if (!$hget(counter,timer)) { .timerCOUNTER 1 1800 msg $unsafe($chan) This message is sent because nobody said anything for 1800 secs = 30 mins. }
}

Timer named "COUNTER" will restart every time users write something on the channel. If no one communicates on the channel for 30 minutes, a message will be sent that follows the timer. But if someone writes the magic word "HELLO" while the timer is running, then it will stop, and after that it will be impossible to restart the timer for the next 30 minutes.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples