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:
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.
I try to explain better:
-I have a bot named
PLUTO that start and stop talking using simply
ON and
OFF;
-On connect, bot is
ON and it talk every 60 sec saying something;
Now I wish that:
-If an user say any word, this ADDON should have to say: !OFF , and so PLUTO stop to talk, so I think is maybe:
if ( ?????? ) $1 && $timer(COUNTER)) { .timerCOUNTER off | .hadd -mz counter timer 180 | /bs say #mychannel !OFF ---->And so PLUTO SHUT UP
-If there're no more words from any user after for example 20 minutes, this ADDON should have to say: !ON , and so PLUTO restart to talk, so I think is something like:
if (!$hget(counter,timer)) { .timerCOUNTER 1 180 /bs say #mychannel $unsafe($chan) ON ---->And so PLUTO restart to talk every 60 sec
}
}-Of course if another user join and talk, addon restart the task.
I hope I been more clear, sorry but I'm not an expert
Thanks