Example #1
0
 public static void run(RobotController _rc) throws GameActionException {
   Bot.init(_rc);
   init();
   while (true) {
     myLocation = rc.getLocation();
     Radio.process();
     action();
     Radio.clear();
     Clock.yield();
   }
 }
Example #2
0
 private static void startBots() {
   logger.info("Starting bots");
   List<YAMLNode> nodes = ChatBot.getSettingsManager().getMainConfig().getNodeList("bots", null);
   for (YAMLNode node : nodes) {
     final String botType = node.getString("type");
     logger.info("Starting {} bot", botType);
     try {
       BotClassInfo botClassInfo = BOT_INFO.get(botType);
       if (botClassInfo == null) {
         logger.error("Cannot start bot '{}': the specified bot doesn't exist!", botType);
         continue;
       }
       Bot bot = botClassInfo.getBotClass().newInstance();
       bot.info = botClassInfo;
       bot.start();
       BOTS.add(bot);
     } catch (Exception e) {
       logger.error("Failed to start bot '{}'", botType);
       e.printStackTrace();
     }
   }
   logger.info("Started {} bot(s)", BOTS.size());
 }