This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Respond only when user talks after a time of silence

Help for those learning Tcl or writing their own scripts.
Post Reply
d
daigo
Voice
Posts: 37
Joined: Fri Jun 27, 2014 8:02 pm

Respond only when user talks after a time of silence

Post by daigo »

So I want to make my bot says one line of text in response to a user talking in a channel after the user doesn't say anything for at least 30 minutes.

I thought of doing something like, if string match "" (nothing) for a user in the $chan, then wait 1 second, then repeat if string match "" (nothing), wait 1 second, repeat, etc. for 30 minutes, and then after 30 minutes passes, if the code is still running, continue to run the code until the until the user says something, then PRIVMSG $chan with the line I want, and reset the code.

However this seems wildly inefficient, especially if the user changes their nickname or never goes online again, then the code will pretty much run forever.

Is there a better way to go about this?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You want to monitor a single specific user or multiple users?

Depending of the case things could be easy or be complicated, but nevertheless, it's do-able.

Either way you need to monitor the following aspects of user and bot actions: joins, parts, quits, is kicked, or servers splits.
Once the game is over, the king and the pawn go back in the same box.
d
daigo
Voice
Posts: 37
Joined: Fri Jun 27, 2014 8:02 pm

Post by daigo »

Specific multiple users.

Also, eggdrop cannot detect joins, parts, or quits on this IRC network for some reason (it works fine on other IRC networks, just not this particular one) so I don't need to put anything in the script that will watch for those. This IRC network cannot server split due to the way the network is modified (not RFC-compliant) so that's not an issue either. Channel kicks are disabled on this network, so also not a problem.
Post Reply