mIRC Home    About    Download    Register    News    Help

Topic Options
#265557 - 28/05/19 01:20 PM IF NOT Good Morning
Maelish Offline
Babel fish

Registered: 28/08/12
Posts: 55
Loc: Nashville
I have a Good Morning script that triggers during certain situations. For example, it's limited to a specific channel and only during a limited timeframe.

But I'd like for the script to ignore the trigger if I've said anything within the channel during the last hour.

Is there a way to phrase an IF Statement that only triggers if you've not sent text in that channel within a time-frame?

Edited by Maelish (28/05/19 01:21 PM)
Find Gamers, my player finder for tabletop RPGers and Wargamers.

#265558 - 28/05/19 02:03 PM Re: IF NOT Good Morning [Re: Maelish]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1158
$nick($chan,$me).idle being less than 3600 is close to what you want, though I'm pretty sure it gets reset to zero from nick changes and possibly mode changes.

To have it only trap your messages, you'd need to have an ON INPUT event that would need to check if $chan == #channelname, and ignore text beginning with $comchar / unless it's /say /me //say //me. You could then add something to a hashtable with a shelf life of 3600 seconds, then later you could just check if the item exists.

hadd -m saying $chan

You'd probably want to do the same thing as you join the channel, and clear the item during ON DISCONNECT

#265564 - 30/05/19 12:52 AM Re: IF NOT Good Morning [Re: Maelish]
Blas Offline
Vogon poet

Registered: 27/10/15
Posts: 111
I assume that you already have a part of your script that is capturing all text based on what you've explained. Try something like this when capturing all text from everyone:

IF (!$hget(activeusers, $nick)) MSG $chan Good Morning, $nick $+ .
HADD -mz activeusers $nick 3600

It will sent a message to the channel if the person hasn't said anything in the last hour.
My Twitch mIRC Bot Games and Stuff