wardellbagby / HangoutsBot

Python 3 Bot for Hangouts
GNU General Public License v3.0
38 stars 25 forks source link

Start commands at defined time #27

Open sgrunt91 opened 9 years ago

sgrunt91 commented 9 years ago

Hello,

I'm not a developper, i don't know many things of Python, and I don't understand 80% of your Bot :-)

But, I want to use your project to made a Bot for fun, and I've added some new commands and also the send image functionnality. So, I'm not also a big noob and I'm learning quite fast.

I just want to know if it's possible to execute a command defined in ExtraCommands.py at a defined time, for example everyday at 9am ? And if it's possible, what is the best practice to do that with your code?

Hope you understand me and could help me :)

Best Regards !

wardellbagby commented 9 years ago

@sgrunt91 Hmm. Currently, I don't have the means for a time-based command like that, but I think it would be possible to add in a feature like that. Let me see what I can do for you.

cntrlwiz commented 9 years ago

I would also like to have something similar...In the game Ingress, there are defined checkpoints that happen every 5 hours. I would like to be able to call out these checkpoints when they occur, and also to have a optional countdown mode where I could set 60,30,15,10,5,4,3,2,1 minutes-to-checkpoint warnings. I looked at doing this through the existing /remind structure, but haven't gotten very far with it.

sgrunt91 commented 9 years ago

Thanks for the replies !

For now, I've just added a thread in Bot.py which is an infinite loop and check the time and if it's my time do what I want. And I run it in the run(), and it's work. But it's probably very ugly for real developers... And also, I don't understand how to call bot's commands from my thread, so I don't know if I will keep that...

If you have already basic ideas to make that and no time, I could try to develop it, and you could accept or reject the code. I mean that I'm not necessary asking you to make it, just pointing me the right way to do it ;)

Thanks again !

nylonee commented 9 years ago

@cntrlwiz be sure to check out the checkpoint.py plugin for nylonee/hangupsbot.

Also, if you're Resistance, hit me up on hangouts please :P