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
TimedGameOver

 
Post new topic   Reply to topic Printable version
 View previous topic  Help me Please Post :: Post how u register a bot  View next topic  
Author Message
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Tue Jul 27, 2004 8:57 am    Post subject: TimedGameOver Reply to topic Reply with quote

I want a function to be called when the game is over ('Soccer game over.' message appears).

I have tried two possibilities:

1.
Code: Show/Hide
case EVENT_TimedGameOver:
      {
         Player *p[5];
         for (int i = 0; i < 5; i++)
            p[i] = (Player*)event.p[i];

         doSomething();
      }
      break;


2.
Code: Show/Hide
switch (type)
         {
         case MSG_Arena:
            {
               sendPublic("_MSG_Arena_");
               if (strcmp(msg, "Soccer game over.") == 0)
               {
                  doSomething();
               }
            }
            break;


Note: I don't see '_MSG_Arena_'. Is 'Soccer game over' an arena message? I also check all other MSG types with sendPublic. Nothing gets displayed. it seems like it has no MSG type at all.

I know that doSomething() does not get called because the first line in doSomething() is sendPublic("_doSomething_"); and I never see that message.
_________________
Expect the worst but hope for the best.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Tue Jul 27, 2004 9:24 am    Post subject: Reply to topic Reply with quote

talk to catid?
_________________
It's a shark! Oh my god! Unbelievable!
Back to top
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


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

PostPosted: Tue Jul 27, 2004 8:32 pm    Post subject: Reply to topic Reply with quote

ok, the event_timedgameover is for KOTH. Your 2nd set of code is correct. Try this,

char test[100];
sprintf(test, "_MSG_Arena_ %i", GetTickCount() );
sendPublic(test);

the array doesnt need to be that big, i just didnt want to figure out the perfect length

ive noticed that sometimes i dont get messages from bots because they are sending the same thing multiple times. So i use the tickcount to randomize what is being sent.
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: Tue Jul 27, 2004 8:43 pm    Post subject: Reply to topic Reply with quote

That is so ugly. icon_sad.gif
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Jul 27, 2004 9:13 pm    Post subject: Reply to topic Reply with quote

it's not that bad.

another solution is to do

sendPublic("*arena MSG_ARENA");

arena messages always get sent even if they are the same, i think

or just send 2 different messages:

sendPublic("-");
sendPublic("MSG_ARENA");
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 Jul 27, 2004 10:44 pm    Post subject: Reply to topic Reply with quote

nothing is ugly, his code is fine and working with sprintf is better than using the string class. Do a char test[25]; it shouldnt get any larger than that.
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: Tue Jul 27, 2004 10:50 pm    Post subject: Reply to topic Reply with quote

If you must use it that way, use snprintf then. icon_sad.gif
Back to top
View users profile Send private message Add User to Ignore List
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Thu Jul 29, 2004 2:58 am    Post subject: Reply to topic Reply with quote

Ok, it works now, thank you.

Catid, if you read this. Build in an EVENT_SoccerGameOver icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Thu Jul 29, 2004 4:06 am    Post subject: Reply to topic Reply with quote

Just suggest it to him...
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Thu Jul 29, 2004 6:58 pm    Post subject: Reply to topic Reply with quote

Or just use twcore
_________________

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: 59 page(s) served in previous 5 minutes.

phpBB Created this page in 0.604635 seconds : 34 queries executed (79.7%): GZIP compression disabled