SimpleBot Version 3.0.0 is finally out! Please enjoy your easy access to proxies and more!

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vitality Red/Black Chinchompa hunter
#1
Should work on multiple servers since the functions are written in a very generic manner

Features

- Insanely fast & efficient
- Resets traps
- Efficiently written so lag spikes wont break it
- Support for every type of chin so it will also work with grey chins.

[Image: lrEVrQdYToObDAcXrGNCog.png]


Source (you will have to compile it yourself or pm me for help) :

Code:
package Hunter;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

import net.runelite.api.coords.WorldPoint;
import simple.hooks.filters.SimpleSkills;
import simple.hooks.filters.SimpleSkills.Skills;
import simple.hooks.queries.SimpleEntityQuery;
import simple.hooks.scripts.Category;
import simple.hooks.scripts.ScriptManifest;
import simple.hooks.simplebot.ChatMessage;
import simple.hooks.wrappers.SimpleGroundItem;
import simple.hooks.wrappers.SimpleItem;
import simple.hooks.wrappers.SimpleObject;
import simple.hooks.wrappers.SimplePlayer;
import simple.robot.script.Script;
import simple.robot.utils.WorldArea;

@ScriptManifest(author = "Trester", category = Category.HUNTER, description = "Start at the tiles that you want to lay box traps",
discord = "", name = "Chinchompa hunter", servers = { "Vitality" }, version = "0.1")


public class ChinchompaHunter extends Script {

private static final Skills HUNTER = null;
private String EXIT_STATUS;

private int startHunterXp, hunterXpGained, CURRENT_HUNTER_XP, hunterlvl;
private long STARTTIME, UPTIME;


private WorldPoint northeast = new WorldPoint(2544, 2913, 0);
private WorldPoint northwest = new WorldPoint(2544, 2915, 0);
private WorldPoint southwest = new WorldPoint(2542, 2915, 0);
private WorldPoint southeast = new WorldPoint(2542, 2913, 0);
private WorldPoint center = new WorldPoint(2543, 2914, 0);

private static final int normal_box = 9380;
private static final int shaking_box = 9384;
private static final int fail_box = 9385;

@Override
public void paint(Graphics Graphs) {
    this.CURRENT_HUNTER_XP = this.ctx.skills.experience(SimpleSkills.Skills.HUNTER);
    this.UPTIME = System.currentTimeMillis() - this.STARTTIME;
        Graphics2D Graph = (Graphics2D) Graphs;
        Graphics2D g = (Graphics2D) Graphs;
        g.setColor(Color.BLACK);
        g.fillRect(9, 230, 150, 55);
        g.setColor(Color.CYAN);
        g.drawRect(9, 230, 150, 55);
        g.setColor(Color.WHITE);
        g.drawString("  Chinchompa hunter v0.1", 7, 245);
        g.setColor(Color.WHITE);
        g.drawString("  Total XP: " + runescapeFormat(Integer.valueOf(this.CURRENT_HUNTER_XP - this.startHunterXp)) + " / P/H (" + runescapeFormat(Integer.valueOf(this.ctx.paint.valuePerHour(this.CURRENT_HUNTER_XP - this.startHunterXp, this.STARTTIME))) + ")", 7, 257);
        g.setColor(Color.WHITE);
        g.drawString("  Uptime: " + this.ctx.paint.formatTime(this.UPTIME), 7, 269);
        g.setColor(Color.WHITE);
        g.drawString("  Current Level: " + this.hunterlvl + "", 7, 281);
        ctx.paint.drawTileMatrix(Graph, northeast, Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, northwest, Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, southwest, Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, southeast, Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, center, Color.CYAN);
     
     
}


@Override
public void onChatMessage(ChatMessage arg0) {
// TODO Auto-generated method stub


}

@Override
public void onExecute() {
CURRENT_HUNTER_XP = ctx.skills.experience(Skills.HUNTER); //check old xp?????
        startHunterXp = ctx.skills.experience(Skills.HUNTER);
        this.STARTTIME = System.currentTimeMillis();
        this.hunterlvl = Integer.valueOf(this.ctx.skills.realLevel(SimpleSkills.Skills.HUNTER));
       
        center = ctx.players.getLocal().getLocation();
        northeast = new WorldPoint(ctx.players.getLocal().getLocation().getX() + 1, ctx.players.getLocal().getLocation().getY() - 1, 0);
        northwest = new WorldPoint(ctx.players.getLocal().getLocation().getX() + 1, ctx.players.getLocal().getLocation().getY() + 1, 0);
        southwest = new WorldPoint(ctx.players.getLocal().getLocation().getX() - 1, ctx.players.getLocal().getLocation().getY() + 1, 0);
        southeast = new WorldPoint(ctx.players.getLocal().getLocation().getX() - 1, ctx.players.getLocal().getLocation().getY() - 1, 0);

}


private boolean emptyTile(WorldPoint location) {
SimpleEntityQuery<SimpleObject> boxes = ctx.objects.populate().filter(location);
SimpleEntityQuery<SimpleGroundItem> groundboxes = ctx.groundItems.populate().filter(location);

ctx.log("Sizes: " + boxes.size());

if(boxes.size() == 0 && groundboxes.size() == 0) {
return true;
}

return false;
}

private boolean shakingBox(WorldPoint location) {
SimpleEntityQuery<SimpleObject> boxes = ctx.objects.populate().filter(location);
for(SimpleObject b : boxes) {
if(b.getId() == shaking_box) {
return true;
}
}
return false;
}

private boolean normalBox(WorldPoint location) {
SimpleEntityQuery<SimpleGroundItem> boxes = ctx.groundItems.populate().filter(location);
for(SimpleGroundItem b : boxes) {
if(b.getName().equals("Box trap")) {
ctx.log("Found grounditem box trap");
if(b.click("Take")) {
b.click("Take");
return true;
}
}
}
return false;
}

private boolean failBox(WorldPoint location) {
SimpleEntityQuery<SimpleObject> boxes = ctx.objects.populate().filter(location);
for(SimpleObject b : boxes) {
if(b.getId() == fail_box) {
return true;
}
}
return false;
}

private boolean checkBox(WorldPoint location) {
SimplePlayer p = ctx.players.getLocal();
SimpleObject box = ctx.objects.populate().filter(location).next();

if(p.isAnimating()) {
ctx.log("sleeping on animation");
ctx.onCondition(() -> !p.isAnimating(), 1000);
}

if(shakingBox(location)) {
if(box.click("Check")) {
box.click("Check");
ctx.onCondition(() -> emptyTile(location), 1000);
if(initBox(location)) {
        ctx.log("Succesfully setup box");
        return true;
    }
}
}

if(failBox(location)) {
if(box.click("Reset")) {
box.click("Reset");
ctx.onCondition(() -> emptyTile(location), 1000);
if(initBox(location)) {
        ctx.log("Succesfully setup box");
        return true;
    }
}
}

if(normalBox(location)) {
ctx.onCondition(() -> emptyTile(location), 1000);
if(initBox(location)) {
        ctx.log("Succesfully setup box");
        return true;
    }
}

return false;

}


private boolean initBox(WorldPoint location) {
SimplePlayer p = ctx.players.getLocal();

if(p.isAnimating()) {
ctx.log("sleeping on animation");
ctx.onCondition(() -> !p.isAnimating(), 1000);
}

if(emptyTile(location)) {
ctx.log("Tile is empty");
if(!p.getLocation().equals(location)) {
if(ctx.pathing.clickSceneTile(location, false, true)){
ctx.pathing.clickSceneTile(location, false, true);
ctx.log("Moving player to tile");
ctx.onCondition(() -> p.getLocation().equals(location), 1000);
}
}


if(p.getLocation().equals(location)){
ctx.log("We are on the tile, setting up boxtrap");
SimpleItem boxtrap = ctx.inventory.populate().filter("Box trap").next();
if(boxtrap.click(0)) {
ctx.log("Clicked boxtrap in inventory");
ctx.onCondition(() -> !emptyTile(location), 1000);
return true;
}
}
}
return false;
}

@Override
public void onProcess() {
        this.hunterlvl = Integer.valueOf(this.ctx.skills.realLevel(SimpleSkills.Skills.HUNTER));
        SimplePlayer p = ctx.players.getLocal();
        if(p.isAnimating()) {
        ctx.log("sleeping on animation");
    ctx.onCondition(() -> !p.isAnimating(), 1000);
    }
       
        if(initBox(northeast)) {
        ctx.log("Succesfully setup northeastern box");
        if(initBox(northwest)) {
        ctx.log("Successfully setup northwestern box");
        if(initBox(southwest)) {
        ctx.log("Successfully setup southwestern box");
        if(initBox(southeast)) {
        ctx.log("Successfully setup southeastern box");
        }
        }
        }
        }
       
       
        if(checkBox(northeast)) {
        ctx.log("Succesfully checked northeastern box");
        }
     
        if(checkBox(northwest)) {
    ctx.log("Successfully checked northwestern box");
    }
       
        if(checkBox(southwest)) {
        ctx.log("Successfully checked southwestern box");
        }
       
        if(checkBox(southeast)) {
ctx.log("Successfully checked southeastern box");
}
       
       
       
       
       
        if(initBox(northeast)) {
        ctx.log("Succesfully setup northeastern box");
        }
       
        if(initBox(northwest)) {
    ctx.log("Successfully setup northwestern box");
        }
       
        if(initBox(southwest)) {
        ctx.log("Successfully setup southwestern box");
        }
       
        if(initBox(southeast)) {
        ctx.log("Successfully setup southeastern box");
        }

       
}


@Override
  public void onTerminate() {
  }

  public static String runescapeFormat(Integer number) {
    String[] suffix = { "K", "M", "B", "T" };
    int size = (number.intValue() != 0) ? (int)Math.log10(number.intValue()) : 0;
    if (size >= 3)
      while (size % 3 != 0)
        size--;
    return (size >= 3) ? (String.valueOf(Math.round(number.intValue() / Math.pow(10.0D, size) * 10.0D) / 10.0D) +
      suffix[size / 3 - 1]) : (
      new StringBuilder(String.valueOf(number.intValue()))).toString();
  }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)