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
[RELEASE] WildyAgility v0.1
#1
WildyAgility v0.1
Script release
Most likely won't be doing any more to it so I will release both source code & jar file

Compatible servers: Vitality
Category: Agility
Author: FlipFlap
Title: WildyAgility
Description: Runs the agility course in the wilderness
Version: 0.1
GUI available: No
---------------------------------------------------------------------------------------------------------------------
Link to .Jar
[Image: 9Tw1n0o.png]


Code:
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.scripts.Category;
import simple.hooks.scripts.ScriptManifest;
import simple.hooks.simplebot.ChatMessage;
import simple.hooks.wrappers.SimpleObject;
import simple.robot.script.Script;
import simple.robot.utils.WorldArea;

@ScriptManifest(author = "FlipFlap", category = Category.AGILITY, description = "Start at beginning of Wilderness Agility Course With Client Zoomed out. This was a little test I put to myself & I'm not a scripter so please don't pm me with bug related questions.",
discord = "", name = "WildyAgility", servers = { "Vitality" }, version = "0.1")


public class WildyAgility extends Script {

private static final Skills AGILITY = null;

private SimpleObject Pipe;
private SimpleObject Rope;
private SimpleObject Stone;
private SimpleObject Log;
private SimpleObject Rocks;

private WorldArea AGILITY_AREA = new WorldArea(new WorldPoint(2998, 3937, 0), new WorldPoint(3006, 3931, 0)); //Area to stand when starting script
private WorldPoint PipeTile = new WorldPoint(3004, 3937, 0); // this tile is in front of pipe
private WorldPoint RopeTile = new WorldPoint(3005, 3953, 0); // this tile is in front of rope
private WorldPoint StoneTile = new WorldPoint(3002, 3960, 0); // this tile is in front of stones
private WorldPoint LogTile = new WorldPoint(3002, 3945, 0); // this tile is in front of log
private WorldPoint RockTile = new WorldPoint(2994, 3937, 0); // this tile is in front of rocks
private int startAgilityXp, agilityXpGained, CURRENT_AGILITY_XP, agilitylvl;
private long STARTTIME, UPTIME;


   
   
   
   

WorldArea areaAfterPipe = new WorldArea(new WorldPoint(3002, 3954, 0), new WorldPoint(3008, 3947, 0));
WorldArea areaAfterRope = new WorldArea(new WorldPoint(3002, 3964, 0), new WorldPoint(3007, 3955, 0));
WorldArea areaAfterStone = new WorldArea(new WorldPoint(2993, 3962, 0), new WorldPoint(3002, 3943, 0));
WorldArea areaAfterLog = new WorldArea(new WorldPoint(2993, 3946, 0), new WorldPoint(2995, 3944, 0));
WorldArea areaAfterRocks = new WorldArea(new WorldPoint(2990, 3937, 0), new WorldPoint(3002, 3930, 0));

@Override
public void paint(Graphics Graphs) {
    this.CURRENT_AGILITY_XP = this.ctx.skills.experience(SimpleSkills.Skills.AGILITY);
    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("  WildyAgility v0.1", 7, 245);
        g.setColor(Color.WHITE);
        g.drawString("  Total XP: " + runescapeFormat(Integer.valueOf(this.CURRENT_AGILITY_XP - this.startAgilityXp)) + " / P/H (" + runescapeFormat(Integer.valueOf(this.ctx.paint.valuePerHour(this.CURRENT_AGILITY_XP - this.startAgilityXp, 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.agilitylvl + "", 7, 281);
        ctx.paint.drawTileMatrix(Graph, Log.getLocation(), Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, Pipe.getLocation(), Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, Rope.getLocation(), Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, Stone.getLocation(), Color.CYAN);
        ctx.paint.drawTileMatrix(Graph, Rocks.getLocation(), Color.CYAN);
       
       
}


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


}

@Override
public void onExecute() {
CURRENT_AGILITY_XP = ctx.skills.experience(Skills.AGILITY); //check old xp?????
        startAgilityXp = ctx.skills.experience(Skills.AGILITY);
        this.STARTTIME = System.currentTimeMillis();
        this.agilitylvl = Integer.valueOf(this.ctx.skills.realLevel(SimpleSkills.Skills.AGILITY));



}

@Override
public void onProcess() {
        this.agilitylvl = Integer.valueOf(this.ctx.skills.realLevel(SimpleSkills.Skills.AGILITY));
Pipe = ctx.objects.populate().filter("Obstacle pipe").next();
Rope = ctx.objects.populate().filter(23132).nearest().next();
    Stone = ctx.objects.populate().filter("Stepping stone").nearest().next();
Log = ctx.objects.populate().filter("Log balance").nearest().next();
Rocks = ctx.objects.populate().filter("Rocks").nearest().next();



if (ctx.pathing.reachable(PipeTile) && !ctx.pathing.inArea(areaAfterPipe) && !ctx.pathing.inArea(areaAfterStone) && !ctx.pathing.inArea(areaAfterRope)) {
if (Pipe != null && Pipe.validateInteractable()) {
CURRENT_AGILITY_XP = ctx.skills.experience(Skills.AGILITY);
Pipe.click("Squeeze-through");

ctx.onCondition(() -> ctx.skills.experience(Skills.AGILITY) > CURRENT_AGILITY_XP, 900);

}
} else if (ctx.pathing.reachable(RopeTile) && ctx.pathing.inArea(areaAfterPipe) && !ctx.pathing.inArea(areaAfterRope) && !ctx.pathing.inArea(areaAfterStone)) {
if (Rope != null && Rope.validateInteractable()) {
CURRENT_AGILITY_XP = ctx.skills.experience(Skills.AGILITY);
Rope.click("Swing-on");


ctx.onCondition(() -> ctx.skills.experience(Skills.AGILITY) > CURRENT_AGILITY_XP, 900);
         
}
} else if (ctx.pathing.reachable(StoneTile) && ctx.pathing.inArea(areaAfterRope)) {
if (Stone != null && Stone.validateInteractable()) {
CURRENT_AGILITY_XP = ctx.skills.experience(Skills.AGILITY);
Stone.click("Cross");


ctx.onCondition(() -> ctx.skills.experience(Skills.AGILITY) > CURRENT_AGILITY_XP, 900);
}
        } else if (ctx.pathing.reachable(LogTile) && ctx.pathing.inArea(areaAfterStone)) {
            if (Log != null && Log.validateInteractable()) {
            CURRENT_AGILITY_XP = ctx.skills.experience(Skills.AGILITY);
                Log.click("Walk-across");

ctx.onCondition(() -> ctx.skills.experience(Skills.AGILITY) > CURRENT_AGILITY_XP, 4000);
}
} else if (ctx.pathing.reachable(RockTile) && ctx.pathing.inArea(areaAfterLog)) {
if (Rocks != null && Rocks.validateInteractable()) {
CURRENT_AGILITY_XP = ctx.skills.experience(Skills.AGILITY);
Rocks.click("Climb");

ctx.onCondition(() -> ctx.skills.experience(Skills.AGILITY) > CURRENT_AGILITY_XP, 900);
}
}
}


@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: 1 Guest(s)