Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Simple Question

 
Post new topic   Reply to topic Printable version
 View previous topic  Merver Freq register plugin request Post :: Post Domination plugin  View next topic  
Author Message
ZoAnimus
Newbie


Joined: Apr 22 2005
Posts: 11
Offline

PostPosted: Tue May 03, 2005 5:21 pm    Post subject: Simple Question Reply to topic Reply with quote

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....
Back to top
View users profile Send private message Add User to Ignore List AIM Address
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue May 03, 2005 8:09 pm    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Wed May 04, 2005 4:18 am    Post subject: Reply to topic Reply with quote

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.
_________________
Nickname: Maverick (I changed my name!)
TWCore developer | Subspace statistics
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
ZoAnimus
Newbie


Joined: Apr 22 2005
Posts: 11
Offline

PostPosted: Wed May 04, 2005 11:31 am    Post subject: Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List AIM Address
ZoAnimus
Newbie


Joined: Apr 22 2005
Posts: 11
Offline

PostPosted: Wed May 04, 2005 11:41 am    Post subject: Reply to topic Reply with quote

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");
               }
Back to top
View users profile Send private message Add User to Ignore List AIM Address
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed May 04, 2005 12:36 pm    Post subject: Reply to topic Reply with quote

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.
_________________
Current Terror Alert Level
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Wed May 04, 2005 12:41 pm    Post subject: Reply to topic Reply with quote

Load that plugin twice then. sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Wed May 04, 2005 1:45 pm    Post subject: Reply to topic Reply with quote

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;
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 142 page(s) served in previous 5 minutes.

phpBB Created this page in 0.472202 seconds : 32 queries executed (93.8%): GZIP compression disabled