This is for a chatter/"atmosphere" bot that establishes a bar motif for a channel. When there's activity in the channel, the bot simply sits there and responds to keywords and keyphrases. What I'd like to add is some "idle time" activities - if the channel goes quiet for a period, the bot does something like "grabs a rag and polishes the bar to a gloss", and then goes into a new idle loop for a random amount of time within certain limits. I can handle the actual actions; I've got that part of the code working for other purposes already. It's the "idle time" activity that I can't seem to get my teeth into.
Problem 1: How to, in essence, start a timer to measure idle time, and have that timer stopped and reset if there's any channel activity.
Problem 2: How to have the repeat interval for the timer not be a constant - in other words, not "every ten minutes", but "ten minutes the first time, then eight minutes plus a random amount of time (between 0 and 250 seconds), recalculated each time"
I'm not, at this point, asking for actual code; I'm a perfectly competent programmer - just need the technique "hooks" to get started on this in mIRCscript.