Server Help

Bot Questions - Simple Question

ZoAnimus - Tue May 03, 2005 5:21 pm
Post subject: Simple Question
Man, I feel like this is a stupid question but I've scoured over the MERVBot code and I can't find what I'm looking for.

Is there a way to check if the arena is locked or unlocked using MERVBot?

If so, I'd love to see some code samples.

Thanks,
ZoA

Sorry for the trivial question....
50% Packetloss - Tue May 03, 2005 8:09 pm
Post subject:
The way to do it would be to send *lock to the server and then look for the responce. Its kind of a round-about way of doing it but there isn't another way unless you use ASSS modules.
Maverick - Wed May 04, 2005 4:18 am
Post subject:
yup, notice that a normal user with Continuum can't actually determine whether an arena is locked unless trying to enter (hence the "bot is only an automated cleint" statement).

I will post some code samples of what 50% Packetloss suggests when I get home.
ZoAnimus - Wed May 04, 2005 11:31 am
Post subject:
Thanks for the info guys. I went ahead and did a string compare in the event_chat area of spawn.cpp . Checked the servers response and then toggled the lock again if I needed to.

thanks icon_razz.gif
ZoAnimus - Wed May 04, 2005 11:41 am
Post subject:
Here is the applicable part of the code from spawn.cpp that I used. Thought I would post just incase anyone else ever needs it. I use a Game_Mode variable to keep track of the mode that the game should be in. During game mode 1, the arena is initializing and I need the arena locked.

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,"Arena UNLOCKED")==0 && Game_Mode ==1)
               {
                  // Game_Mode 1 means we are trying to initialize the arena.  Arena must be locked
                  // If the arena gets unlocked, lock it back up
                  sendPublic("*lock");
               }

50% Packetloss - Wed May 04, 2005 12:36 pm
Post subject:
You'll want to compare the unlock message too, just in case your bot does a *lock and unlocks the arena instead of locking it.
Solo Ace - Wed May 04, 2005 12:41 pm
Post subject:
Load that plugin twice then. sa_tongue.gif
Maverick - Wed May 04, 2005 1:45 pm
Post subject:
Code: Show/Hide
//////// Chat ////////
   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(CMPSTART("Arena LOCKED", msg) && setLocked==false) {
                  sendPublic("*lock");
               } else if(CMPSTART("Arena UNLOCKED", msg) && setLocked==true) {
                  sendPublic("*lock");
               }
            }
            break;

All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group