Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Combat;
- import org.rsbot.script.methods.Equipment;
- import org.rsbot.script.methods.Walking;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.util.Filter;
- @ScriptManifest(authors = {"Tooth"},
- name = "TMinoMurderer",
- version = 0.2,
- description = "Kills Minotaurs in the Stronghold of Security.")
- public class TMinoMurderer extends Script {
- //vars
- boolean range = false;
- boolean sling = false;
- boolean food = false;
- int minoID = 4404;
- int idle = -1;
- int[] arrowID = {882, 884, 886, 888, 890};
- int startXP, XPGained, skill;
- String status, skillTrained;
- RSTile minoTile = new RSTile(1868, 5189);
- public boolean onStart() {
- if (range) {
- skill = 4;
- skillTrained = "Range";
- } else {
- skill = 2;
- skillTrained = "Strength";
- }
- startXP = skills.getCurrentExp(skill);
- String status = "Starting Up.";
- log(status);
- if (combat.getFightMode() == 1) {
- log("Everything is set: Starting Script.");
- } else {
- combat.setFightMode(1);
- log("Attack Mode set to Rapid.");
- sleep(random(200,400));
- }
- return true;
- }
- @Override
- public int loop() {
- RSGroundItem gItem = groundItems.getNearest();
- if (equipment.getCount(Equipment.AMMO) == 0) {
- if (!range || sling) {
- attackMino();
- } else {
- pickupArrows();
- if (gItem.getItem().getStackSize() < 2) {
- attackMino();
- } else {
- pickupArrows();
- }
- }
- } else {
- log("Out of Ammo: Loggin Out");
- stopScript();
- }
- return 100;
- }
- public void onFinish() {
- XPGained = skills.getCurrentExp(skill) - startXP;
- log("Gained " + XPGained + " " + skillTrained + " exp. Thanks for using TMinoMurderer.");
- }
- //Methods
- private void attackMino() {
- if (status != "Killing Minotaurs.") {
- status = "Killing Minotaurs.";
- log(status);
- }
- RSNPC mino = npcs.getNearest(minoID);
- if (mino != null) {
- if (getMyPlayer().getAnimation() == idle) {
- if (!getMyPlayer().isInCombat()) {
- mino.doAction("attack");
- sleep(random(400,600));
- }
- }
- } else {
- //
- }
- }
- private void pickupArrows() {
- if (status != "Picking up Arrows.") {
- status = "Picking up Arrows.";
- log(status);
- }
- RSGroundItem gItem = groundItems.getNearest(arrowID);
- if (gItem != null) {
- if (gItem.getItem().getStackSize() > 1) {
- if (getMyPlayer().getAnimation() == idle) {
- gItem.doAction("attack");
- sleep(random(400,600));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement