hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
All I want is one unit...

 
Reply to topic    hacker.org Forum Index » BitBath View previous topic
View next topic
All I want is one unit...
Author Message
psycore



Joined: 18 Feb 2009
Posts: 8

Post All I want is one unit... Reply with quote
Hi,

for testing some stuff I tried to make a bot that just creates one unit and does nothing else. I feel like a noob for not being able to do that. Here's what I got:
Code:
public class doNothing {
   public int orderType = 2;
   private boolean notBuilt=true;

   public Object think(double dx, double dy, double x, double y, boolean moving, int terrain,
          int ourID, int ourType, double hp, double maxHP, double range, double time,
          double[] objX, double[] objY, int[] objID, int[] objFaction, int[] objType, int[][] incomingRadio) {
      
      return this;
   }

   public int build(double dx, double dy, double x, double y, int terrain, int id, int buildItem,
          double hp, double maxHP, double time,
          double[] objX, double[] objY, int[] objID, int[] objFaction, int[] objType, int[][] incomingRadio) {

      
      if(notBuilt) {
         notBuilt = false;
         return 1;
      }
      return 0;
   }
}

Why does this thing create two units?
Tue Jun 15, 2010 4:51 pm View user's profile Send private message
Meelo



Joined: 25 Apr 2009
Posts: 9

Post Reply with quote
I think it gives you a free grunt at the start of the game, regardless of if you built it or not.
Sat Sep 18, 2010 11:32 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » BitBath All times are GMT
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.