Here's the code for the RSC auto fighter for ARS.
I want to add a gui in the bottom right corner of the RSC game screen that shows Time ran for, NPC's killed, and times Slept
can anyone implement that?
Code:
import net.pink.probot.bot.Bot;
import net.pink.probot.script.Script;
import net.pink.probot.script.methods.wrappers.RSCNpc;
public class AutoFighter extends Script {
private boolean bury = false;
private int[] npcIDS;
private int[] pickupIDS;
private int[] boneIDS = new int[] { 413, 20, 814 };
private int foodID = 0;
public AutoFighter(Bot bot) {
super(bot);
}
@Override
public int loop() {
if(getPlayer().isSleeping())
return 100;
if(!getPlayer().inCombat()) {
return nonCombat();
} else if(getPlayer().inCombat()) {
if (getHitsPercent() < 20) {
getPlayer().walkTo(getPlayer().getX(), getPlayer().getY(), false);
return 1000;
}
}
return 500;
}
public int getHitsPercent() {
int lol = 0;
try {
lol = (getPlayer().getMaxLvl()[3] * 100)
/ getPlayer().getCurLvl()[3];
} catch (Exception e) {
e.printStackTrace();
}
return lol;
}
private int nonCombat() {
for (int bones : boneIDS) {
if (getInv().contains(bones)) {
getInv().useItem(bones);
return 500;
}
}
for (int j = 0; j < getGround().getGroundItemCount(); j++) {
if (bot.inArray(pickupIDS, getGround().getGroundItemID()[j])) {
getGround().pickupItem(pickupIDS);
return 500;
}
}
if (getHitsPercent() < 20) {
if (foodID != 0) {
if (getInv().contains(foodID)) {
getInv().useItem(foodID);
return 500;
}
}
}
RSCNpc attackNpc = bot.getNpcs().getNearestNpc(npcIDS);
if (attackNpc != null) {
attackNpc.attackNpc();
return 1000;
}
return 1000;
}
@Override
public boolean onStart() {
setBury(args.get("bury") != null ? true : false);
npcIDS = extractIntegers(args.get("npcs"));
pickupIDS = extractIntegers(args.get("items"));
foodID = Integer.parseInt(args.get("food"));
return true;
}
@Override
public String description() {
return "NPC IDs: <input type='text' name='npcs' /><br />Item IDs: <input type='text' name='items' /><br />Food ID: <input type='text' name='food' value='0' /><br />Bury bones: <input name='bury' type='checkbox' value='1'>";
}
public void setBury(boolean bury) {
this.bury = bury;
}
public boolean isBury() {
return bury;
}
}
I want to add a gui in the bottom right corner of the RSC game screen that shows Time ran for, NPC's killed, and times Slept
can anyone implement that?