Server Help

Bot Questions - Mervbot time control?

OpenBot - 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 icon_lol.gif
Smong - 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.
Anonymous - 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.
Anonymous - 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 icon_wink.gif

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
OpenBot - 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?

sa_tongue.gif
ExplodyThingy - 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.
}
}
Cyan~Fire - 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.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group