Examples of RSTile


Examples of org.rsbot.script.wrappers.RSTile

  public WebData(final MethodContext ctx) {
    super(ctx);
  }

  public boolean activateCondition() {
    final RSTile curr_base = methods.game.getMapBase();
    final int curr_plane = methods.game.getPlane();
    return methods.game.isLoggedIn() && ((lastMapBase == null || !lastMapBase.equals(curr_base)) || (lastLevel == -1 || lastLevel != curr_plane));
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  }

  public int loop() {
    try {
      sleep(5000);
      final RSTile currentMapBase = methods.game.getMapBase();
      final int currentLevel = methods.game.getPlane();
      if (!currentMapBase.equals(methods.game.getMapBase())) {
        return -1;
      }
      lastMapBase = currentMapBase;
      lastLevel = currentLevel;
      final int tileKeys[][] = methods.walking.getCollisionFlags(currentLevel).clone();
      final RSTile collisionOffset = methods.walking.getCollisionOffset(currentLevel);
      final int xOffset = collisionOffset.getX();
      final int yOffset = collisionOffset.getY();
      final int xBase = currentMapBase.getX(), yBase = currentMapBase.getY();
      for (int queryX = 3; queryX < 102; queryX++) {
        for (int queryY = 3; queryY < 102; queryY++) {
          final RSTile analysisTile = new RSTile(currentMapBase.getX() + queryX, currentMapBase.getY() + queryY, currentLevel);
          final int localX = analysisTile.getX() - xBase, localY = analysisTile.getY() - yBase;
          final int keyIndex_x = localX - xOffset, keyIndex_y = localY - yOffset;
          final int key = tileKeys[keyIndex_x][keyIndex_y];
          synchronized (botCollectionLock) {
            if (!Web.rs_map.containsKey(analysisTile) && (!RSTile.Walkable(key) || RSTile.Questionable(key))) {
              Web.rs_map.put(analysisTile, key);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

      return random(500, 1000);
    }
    if (readyToLeave) {
      final RSObject portal = objects.getNearest(PORTAL_ID);
      if (portal != null) {
        final RSTile portalLocation = portal.getLocation();
        if (portal.isOnScreen()) {
          portal.interact("Enter");
          return random(3000, 4000);
        } else {
          walking.walkTileMM(portalLocation.randomize(2, 2));
          return random(1500, 2000);
        }
      }
    }
    if (talkComponent.containsText("Ahem, ")) {
      readyToLeave = false;
    }
    if (talkComponent.containsText("Correct.") || talkComponent.containsText("You can go now.")) {
      readyToLeave = true;
    }
    if (interfaces.getComponent(184, 0).isValid()) {
      final int modelID = interfaces.getComponent(184, 8).getComponent(3).getModelID();
      String itemName = null;
      for (int i = 0; i < MODEL_IDS.length; i++) {
        if (MODEL_IDS[i] == modelID) {
          itemName = ITEM_NAMES[i];
        }
      }
      if (itemName == null) {
        log("The object couldn't be identified! ID: " + modelID);
        if (failCount++ > 10) {
          stopScript(false);
          return -1;
        }
        return random(1000, 2000);
      }
      for (int j = 0; j < 3; j++) {
        final RSComponent iface = interfaces.getComponent(184, 8).getComponent(j);
        if (iface.containsText(itemName)) {
          iface.doClick();
          return random(1000, 1200);
        }
      }
    }
    if (interfaces.canContinue()) {
      interfaces.clickContinue();
      return random(1000, 1200);
    }
    final RSNPC certer = npcs.getNearest("Giles", "Miles", "Niles");
    if (certer != null) {
      if (calc.distanceTo(certer) < 4) {
        certer.interact("Talk-to");
        return random(2500, 3000);
      } else {
        final RSTile certerLocation = certer.getLocation();
        walking.walkTileMM(certerLocation.randomize(2, 1));
        return random(3000, 3500);
      }
    }
    if (failCount++ > 10) {
      stopScript(false);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  private RSTile lastDoor = null;

  //working as of 4/07/2011
  void loadGreenPath() {

    paths.add(new Door(new RSTile(2903, 4555), 's', 0));
    paths.add(new Door(new RSTile(2890, 4566), 'e', 1));
    paths.add(new Door(new RSTile(2892, 4578), 'e', 2));
    paths.add(new Door(new RSTile(2894, 4567), 'e', 3));
    paths.add(new Door(new RSTile(2896, 4562), 'e', 4));
    paths.add(new Door(new RSTile(2905, 4561), 's', 5));
    paths.add(new Door(new RSTile(2915, 4560), 'n', 6));
    paths.add(new Door(new RSTile(2909, 4562), 'n', 7));
    paths.add(new Door(new RSTile(2924, 4566), 'w', 8));
    paths.add(new Door(new RSTile(2922, 4575), 'w', 9));
    paths.add(new Door(new RSTile(2916, 4568), 'n', 10));
    paths.add(new Door(new RSTile(2905, 4573), 'w', 11));
    paths.add(new Door(new RSTile(2906, 4585), 'n', 12));
    paths.add(new Door(new RSTile(2916, 4586), 's', 13));
    paths.add(new Door(new RSTile(2920, 4582), 'w', 14));
    paths.add(new Door(new RSTile(2910, 4582), 's', 15));
    paths.add(new Door(new RSTile(2910, 4572), 'n', 16));
    paths.add(new Door(new RSTile(2910, 4576), 'e', 17));
    log("Loaded green path");
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  }

  //working as of 1/31/2010
  void loadBluePath() {

    paths.add(new Door(new RSTile(2891, 4588), 'w', 0));
    paths.add(new Door(new RSTile(2889, 4596), 'w', 1));
    paths.add(new Door(new RSTile(2893, 4600), 's', 2));
    paths.add(new Door(new RSTile(2901, 4598), 's', 3));
    paths.add(new Door(new RSTile(2897, 4596), 's', 4));
    paths.add(new Door(new RSTile(2894, 4587), 'e', 5));
    paths.add(new Door(new RSTile(2896, 4582), 'e', 6));
    paths.add(new Door(new RSTile(2898, 4570), 'e', 7));
    paths.add(new Door(new RSTile(2900, 4567), 'e', 8));
    paths.add(new Door(new RSTile(2911, 4566), 'n', 9));
    paths.add(new Door(new RSTile(2906, 4585), 'n', 10));
    paths.add(new Door(new RSTile(2916, 4586), 's', 11));
    paths.add(new Door(new RSTile(2920, 4582), 'w', 12));
    paths.add(new Door(new RSTile(2910, 4582), 's', 13));
    paths.add(new Door(new RSTile(2910, 4572), 'n', 14));
    paths.add(new Door(new RSTile(2910, 4576), 'e', 15));
    log("Loaded blue path");
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  }

  //working as of  4/07/2011
  void loadCyanPath() {

    paths.add(new Door(new RSTile(2930, 4555), 's', 0));
    paths.add(new Door(new RSTile(2912, 4553), 's', 1));
    paths.add(new Door(new RSTile(2936, 4556), 'w', 2));
    paths.add(new Door(new RSTile(2934, 4568), 'w', 3));
    paths.add(new Door(new RSTile(2932, 4575), 'w', 4));
    paths.add(new Door(new RSTile(2930, 4561), 'w', 5));
    paths.add(new Door(new RSTile(2929, 4581), 'e', 6));
    paths.add(new Door(new RSTile(2930, 4590), 'w', 7));
    paths.add(new Door(new RSTile(2924, 4592), 's', 8));
    paths.add(new Door(new RSTile(2926, 4575), 'w', 9));
    paths.add(new Door(new RSTile(2924, 4583), 'w', 10));
    paths.add(new Door(new RSTile(2916, 4586), 's', 11));
    paths.add(new Door(new RSTile(2920, 4582), 'w', 12));
    paths.add(new Door(new RSTile(2910, 4582), 's', 13));
    paths.add(new Door(new RSTile(2910, 4572), 'n', 14));
    paths.add(new Door(new RSTile(2910, 4576), 'e', 15));
    log("Loaded cyan path");
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  }

  //working as of 2/05/2010
  void loadPurplePath() {

    paths.add(new Door(new RSTile(2932, 4597), 'n', 0));
    paths.add(new Door(new RSTile(2921, 4599), 'n', 1));
    paths.add(new Door(new RSTile(2909, 4600), 's', 3));
    paths.add(new Door(new RSTile(2913, 4598), 's', 4));
    paths.add(new Door(new RSTile(2908, 4596), 's', 5));
    paths.add(new Door(new RSTile(2919, 4594), 's', 6));
    paths.add(new Door(new RSTile(2908, 4592), 's', 7));
    paths.add(new Door(new RSTile(2898, 4585), 'e', 8));
    paths.add(new Door(new RSTile(2903, 4588), 's', 9));
    paths.add(new Door(new RSTile(2902, 4575), 'e', 10));
    paths.add(new Door(new RSTile(2906, 4585), 'n', 11));
    paths.add(new Door(new RSTile(2916, 4586), 's', 12));
    paths.add(new Door(new RSTile(2920, 4582), 'w', 13));
    paths.add(new Door(new RSTile(2910, 4582), 's', 14));
    paths.add(new Door(new RSTile(2910, 4572), 'n', 15));
    paths.add(new Door(new RSTile(2910, 4576), 'e', 16));

    log("Loaded purple path");
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

    if (getMyPlayer().isMoving()) {
      return random(150, 200);
    }

    if (getMyPlayer().getLocation().equals(new RSTile(2911, 4576))) {
      if (getMyPlayer().getAnimation() == -1) {
        final RSObject ob = objects.getNearest(3634);
        ob.interact("Touch");
        return random(5000, 6000);
      }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  }

  void getNewWall() {
    for (final Door door : paths) {
      if (door.doorID == doorIndex) {
        walkToTile = new RSTile(door.doorTile.getX(), door.doorTile.getY());
        doorDir = door.doorDir;
        door.doorID = doorIndex;
        log("walking.walkTo: " + walkToTile.getX() + ", " + walkToTile.getY());
        log("Door index: " + doorIndex + " | Door direction: " + doorDir);
      }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

  RSTile tileAfterDoor() {
    final int doorD = doorDir;
    if (doorD == 'a') {
      log("TILEAFTERDOOR: doorD = A");
      return new RSTile(1, 1);
    }
    if (walkToTile == null) {
      log("TILEAFTERDOOR: walkToTile = NULL");
      return new RSTile(1, 1);
    }
    switch (doorD) {
      case 'n':
        return new RSTile(walkToTile.getX(), walkToTile.getY() + 1);
      case 'w':
        return new RSTile(walkToTile.getX() - 1, walkToTile.getY());
      case 'e':
        return new RSTile(walkToTile.getX() + 1, walkToTile.getY());
      case 's':
        return new RSTile(walkToTile.getX(), walkToTile.getY() - 1);
    }
    return new RSTile(1, 1);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.