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
Updated TWCore

 
Post new topic   Reply to topic Printable version
 View previous topic  types Post :: Post I need a awsome CTF bot  View next topic  
Author Message
D1st0rt
Miss Directed Wannabe


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

PostPosted: Sat Feb 21, 2004 5:25 pm    Post subject: Updated TWCore Reply to topic Reply with quote

Let me know (email or otherwise) if you would like the updates I have made to the TWCore that now handle the TurretEvents, they were previously unimplemented. I had to modify the SubspaceBot, EventRequester, and GamePacketInterpreter classes to incorporate the TurretEvent class that was already there. The one problem comes with detaching, because it will throw a NullPointerException if you try to get information from the attachee.

here's the code I use to get around it:
Code: Show/Hide
import java.util.*;

public class TurretBot extends SubspaceBot
{
      private HashSet attached;
      public TurretBot(BotAction botAction)
      {
            attached = new HashSet();
      }

      public void handleEvent(TurretEvent event)
      {
            int turret = event.getAttacherID();
            String name = m_botAction.getPlayerName(turret);
            if(attached.add(name))
            {
                  int capship = event.getAttacheeID();
                  //Stuff goes here
            }
            else
                  attached.remove(name);
            }
      }
}

_________________

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

phpBB Created this page in 0.445788 seconds : 26 queries executed (94.6%): GZIP compression disabled