Author |
Message |
OpenBot Newbie
Joined: Nov 15 2003 Posts: 6 Offline
|
Posted: Fri Nov 21, 2003 5:55 am Post subject: Mervbot time control? |
 |
|
|
|
I am wondering if there is a time function in the mervbot that will allow me to make the bot do something at certain time??
or maybe have a command such as !settime = 10 minute and after 10 minute it will do something??
Thanks 
Last edited by OpenBot on Fri Nov 21, 2003 8:31 am, edited 1 time in total |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Nov 21, 2003 6:09 am Post subject: |
 |
|
|
|
I don't think it is possible to send a message prefixed by one ? for all to see in public chat. |
|
Back to top |
|
 |
Plody Guest
Offline
|
Posted: Fri Nov 21, 2003 8:50 am Post subject: |
 |
|
|
|
Yes, its possible in one sense. It wont run in terms of time of day but will run in terms of timers. Merv plugins have 5 integers, counter[0]-[4], and each is ticked down once per second in EVENT_Tick. Use !settime to convert the number into an integer and store it to countdown[0]. In EVENT_Tick, check if(!countdown[0]) to see if it has reached 0 yet. That is where you put your periodic information. |
|
Back to top |
|
 |
Rifle Guest
Offline
|
Posted: Fri Nov 21, 2003 8:52 am Post subject: |
 |
|
|
|
Smong wrote: | I don't think it is possible to send a message prefixed by one ? for all to see in public chat. |
That`s not possible, but using ! instead of ? is
In response to the original question :
Yes, it is possible to do a command like !settime 10 and the bot would perform a certain action after 10 minutes.
hint : Look for EVENT_Tick ( If I remember correctly )
-Rifle |
|
Back to top |
|
 |
OpenBot Newbie
Joined: Nov 15 2003 Posts: 6 Offline
|
Posted: Fri Nov 21, 2003 8:41 pm Post subject: |
 |
|
|
|
Thanks Plody and Rilfe !!
But does anyone have an example where maybe I an learn from?
 |
|
Back to top |
|
 |
ExplodyThingy Server Help Squatter
Age:38 Gender: Joined: Dec 15 2002 Posts: 528 Location: Washington DC Offline
|
Posted: Fri Nov 21, 2003 11:51 pm Post subject: |
 |
|
|
|
ok, here:
command.cpp:
if(c->check("settime"))
{
countdown[0]=atoi(c->final);
}
spawn.cpp:
EVENT_Tick
{
for(int i=0;i<4;i++)
countdown[i]--;
if(!ountdown[0]
{
//Your stuff here.
}
} _________________ There are no stupid question, but there are many inquisitive idiots.
Loot
Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Nov 22, 2003 1:30 pm Post subject: |
 |
|
|
|
Here's the files the Explody was talking about:
http://www.mervbot.com/files/Tutorial.rar
If you have no experience with C++, tell me what you want it do do and I'll program it for you. It shouldn't be that hard. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
|