Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2012, 08:43 PM   PM User | #1
Dubz
Regular Coder

 
Join Date: Sep 2011
Posts: 206
Thanks: 15
Thanked 5 Times in 5 Posts
Dubz has a little shameless behaviour in the past
Question possible built in timer without a loop or stopping the script until the time?

I am wondering if this is possible to do. Lets say i have a certain time ('time()' in php) and at a specific time after (say 5 minutes) I want an action to happen. This is something I am looking to adding to a chat bot script that I am currently working on but I never did before. How could i get the bot to do a certain action repeatedly with separate conditions at the set time. Say a user joins the chat. After being in the chat for 5 minutes, the bot sends the MEMBER command through the chat and members them. Now say 3 users join the chat at 1 minute intervals. Each user would be made member 5 minutes after THEY joined, not the last person. I'm already able to add the ID of the user into an associative array with the ID as the key and the time as the value but the only problem i have is getting the bot to member them at the set time. I don't want the bot to get disabled at all in the process (the users should still be able to use its commands).

Summing that all up, I need a looping script to do certain actions at certain times without the script pausing at all. It's for a chat bot so when the time is hit for the certain user, the action is done.
Dubz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:02 PM.


Advertisement
Log in to turn off these ads.