egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Respond only when user talks after a time of silence

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
daigo
Voice


Joined: 27 Jun 2014
Posts: 37

PostPosted: Fri Jul 25, 2014 9:30 am    Post subject: Respond only when user talks after a time of silence Reply with quote

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?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Jul 25, 2014 11:49 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
daigo
Voice


Joined: 27 Jun 2014
Posts: 37

PostPosted: Fri Jul 25, 2014 12:16 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber