Server Help

Bot Questions - ?time and *timer

ZoAnimus - Tue Apr 26, 2005 2:18 pm
Post subject: ?time and *timer
Does anyone know what event is passed when the timer runs out that is set by *timer? I want to use MervBot to do some processing anytime the *timer runs down to 0. I'm hoping that there is already a function to handle this event in the MervBot code. I can then just add my processing to that function. Any thoughts will be appreciated

Thanks,
ZoA
Mr Ekted - Tue Apr 26, 2005 2:20 pm
Post subject:
I think it might just be *arena %103, which isn't a very good thing to use to assume the timer expired.
Muskrat - Tue Apr 26, 2005 2:48 pm
Post subject:
Do you mean this?
From the dll plugin example spawn.cpp
Code: Show/Hide
   case EVENT_TimedGameOver:
      {
         Player *p[5];
         for (int i = 0; i < 5; i++)
            p[i] = (Player*)event.p[i];
      }
      break;

Maverick - Tue Apr 26, 2005 2:59 pm
Post subject:
I thought it was EVENT_TimedGameOver, however after some testing that didn't work for me.

So I suggest you to use:
Code: Show/Hide

   case EVENT_Chat:
      {
         int type  = *(int*)&event.p[0];
         int sound = *(int*)&event.p[1];
         Player *p = (Player*)event.p[2];
         char *msg = (char*)event.p[3];

         switch (type)
         {
         case MSG_Arena:
            {
               if(strcmp(msg,"NOTICE: Game over")==0 && sound==5) {
                  //code goes here
               }
            }
            break;
[...]

or use the countdown array and check in EVENT_Tick. icon_smile.gif
ZoAnimus - Tue Apr 26, 2005 4:15 pm
Post subject:
I tried adding the line
sendPublic("Event happened");

to both the EVENT_TimedGameOver and MSG_Arena areas of the code. However, when the timed game ends. The Bot nevers says Event happened. I thought that just having the bot say something would be a good test as to whether or not the bot is registering the event.

Any ideas??

Edit:
I changed the line of code to
sendPublic("*arena Event Happened");

and it worked. Go figure???
Muskrat - Tue Apr 26, 2005 4:24 pm
Post subject:
Yeah I couldnt get the EVENT_TimedGameOver to work either, I just assumed I was doing somethign wrong heh.

But I would not use that anyways, as having a timer in the bot to set and check with bot commands will allow using seconds, and allow events at intervals before it ends.
D1st0rt - Tue Apr 26, 2005 8:03 pm
Post subject:
Quote:
sendPublic("Event happened");

to both the EVENT_TimedGameOver and MSG_Arena


Because you sent a Public message, it didn't register for your check for Arena Messages. If you had put stuff in MSG_Public, it would have worked.
Smong - Thu Apr 28, 2005 3:59 am
Post subject:
I think EVENT_TimedGameOver is for Misc:TimedGame, which by the way cannot by overided with *timer.
Muskrat - Thu Apr 28, 2005 2:44 pm
Post subject:
cool, thanks
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group