Examples of RSTile


Examples of org.rsbot.script.wrappers.RSTile

  public TPlayerPosition(final Bot bot) {
    players = bot.getMethodContext().players;
  }

  public int drawLine(final Graphics render, int idx) {
    final RSTile position = players.getMyPlayer().getLocation();
    StringUtil.drawLine(render, idx++, "Position: " + position);
    return idx;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

    final RSPlayer player = ctx.players.getMyPlayer();
    if (player == null) {
      return;
    }
    final FontMetrics metrics = render.getFontMetrics();
    final RSTile location = player.getLocation();
    final int locX = location.getX();
    final int locY = location.getY();
    final int tHeight = metrics.getHeight();
    for (int x = locX - 25; x < locX + 25; x++) {
      for (int y = locY - 25; y < locY + 25; y++) {
        final RSTile tile = new RSTile(x, y);
        final Point screen = ctx.calc.tileToScreen(tile);
        if (!ctx.calc.pointOnScreen(screen)) {
          continue;
        }
        final RSObject[] objects = ctx.objects.getAllAt(tile);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

        Point mini = ctx.calc.worldToMinimap(x - 0.5, y - 0.5);
        if (mini.x == -1 || mini.y == -1) {
          mini = null;
        }
        minimapPoints[i][j] = mini;
        Point screen = ctx.calc.tileToScreen(new RSTile(x, y), 0, 0, 0);
        if (screen.x == -1 || screen.y == -1) {
          screen = null;
        }
        screenPoints[i][j] = screen;
      }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

    final RSPlayer player = ctx.players.getMyPlayer();
    if (player == null) {
      return;
    }
    final FontMetrics metrics = render.getFontMetrics();
    final RSTile location = player.getLocation();
    final int locX = location.getX();
    final int locY = location.getY();
    final int tHeight = metrics.getHeight();
    for (int x = locX - 25; x < locX + 25; x++) {
      for (int y = locY - 25; y < locY + 25; y++) {
        final RSGroundItem[] items = ctx.groundItems.getAllAt(x, y);
        if (items.length > 0) {
          final RSModel model = items[0].getModel();
          if (model != null) {
            render.setColor(Color.BLUE);
            model.drawWireFrame(render);
          }
        }
        for (int i = 0; i < items.length; i++) {
          final Point screen = ctx.calc.tileToScreen(new RSTile(x, y), items[i].getHeight());
          if (!ctx.calc.pointOnScreen(screen)) {
            continue;
          }
          render.setColor(Color.RED);
          render.fillRect((int) screen.getX() - 1, (int) screen.getY() - 1, 2, 2);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

    }
    final RSPlayer player = ctx.players.getMyPlayer();
    if (player == null) {
      return;
    }
    final RSTile oT = player.getLocation();
    final int plane = ctx.game.getPlane();
    final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
    while (rs.hasNext()) {
      final Map.Entry<RSTile, Integer> e = rs.next();
      final RSTile tile = e.getKey();
      final int key = e.getValue();
      if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
        render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
        final Point p = tileToMap(tile, oT);
        render.drawLine(p.x, p.y, p.x, p.y);
      }
    }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

   * @param distance The range to search (box-like).
   * @return An <tt>RSObject[]</tt> of all objects in the loaded region within specified range.
   */
  public RSObject[] getAll(final int distance) {
    final Set<RSObject> objects = new LinkedHashSet<RSObject>();
    final RSTile currTile = methods.players.getMyPlayer().getLocation(), baseTile = methods.game.getMapBase();
    final int sX = Math.max(0, currTile.getX() - baseTile.getX() - distance);
    final int sY = Math.max(0, currTile.getY() - baseTile.getY() - distance);
    final int eX = Math.min(104, currTile.getX() - baseTile.getX() + distance);
    final int eY = Math.min(104, currTile.getY() - baseTile.getY() + distance);
    for (int x = sX; x < eX; x++) {
      for (int y = sY; y < eY; y++) {
        for (final RSObject o : getAtLocal(x, y, -1)) {
          if (o != null) {
            objects.add(o);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

   * @param filter   Filters out unwanted objects.
   * @return An <tt>RSObject[]</tt> of all objects in the loaded region within specified range.
   */
  public RSObject[] getAll(final int distance, final Filter<RSObject> filter) {
    final Set<RSObject> objects = new LinkedHashSet<RSObject>();
    final RSTile currTile = methods.players.getMyPlayer().getLocation(), baseTile = methods.game.getMapBase();
    final int sX = Math.max(0, currTile.getX() - baseTile.getX() - distance);
    final int sY = Math.max(0, currTile.getY() - baseTile.getY() - distance);
    final int eX = Math.min(104, currTile.getX() - baseTile.getX() + distance);
    final int eY = Math.min(104, currTile.getY() - baseTile.getY() + distance);
    for (int x = sX; x < eX; x++) {
      for (int y = sY; y < eY; y++) {
        for (final RSObject o : getAtLocal(x, y, -1)) {
          if (o != null && filter.accept(o)) {
            objects.add(o);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

   */
  public RSTile getTileUnderPoint(final Point p) {
    if (!methods.calc.pointOnScreen(p)) {
      return null;
    }
    RSTile close = null;
    for (int x = 0; x < 104; x++) {
      for (int y = 0; y < 104; y++) {
        final RSTile t = new RSTile(x + methods.client.getBaseX(), y + methods.client.getBaseY());
        final Point s = methods.calc.tileToScreen(t);
        if (s.x != -1 && s.y != -1) {
          if (close == null) {
            close = t;
          }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

   * @return <tt>true</tt> if items were dropped from the inventory;
   *         otherwise <tt>false</tt>.
   */
  public boolean dropAllExcept(final boolean leftToRight, final int... ids) {
    final int startCount = getCount();
    final RSTile startLocation = methods.players.getMyPlayer().getLocation();
    boolean found_droppable = true;
    while (found_droppable && getCountExcept(ids) != 0) {
      if (methods.calc.distanceTo(startLocation) > 100) {
        break;
      }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSTile

        yy += random(0, y);
      } else {
        yy -= random(0, y);
      }
    }
    RSTile dest = new RSTile(xx, yy);
    if (!methods.calc.tileOnMap(dest)) {
      dest = getClosestTileOnMap(dest);
    }
    final Point p = methods.calc.tileToMinimap(dest);
    if (p.x != -1 && p.y != -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.