mIRC Home    About    Download    Register    News    Help

Print Thread
#265557 28/05/19 12:20 PM
Joined: Aug 2012
Posts: 59
Maelish Offline OP
Babel fish
OP Offline
Babel fish
Joined: Aug 2012
Posts: 59
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?


Last edited by Maelish; 28/05/19 12:21 PM.

Find Gamers, my player finder for tabletop RPGers and Wargamers.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
$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

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
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:

Code:
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.


Link Copied to Clipboard