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.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSTilePath;
- @ScriptManifest(authors = { "Brad23" },
- keywords = "Combat, Money Making, Unicorns, Brad23, TROLOLOL",
- name = "DeadUnicorns by Brad23",
- version = 1.0,
- description = "Kills unicorns at Edgeville and banks the horns.")
- public class DeadUnicorns extends Script{
- ///ID's///
- private final int hornID = 237;
- ///Paths///
- private final RSTile[] tilesToUnicorn1 = { new RSTile(3091, 3454), new RSTile(3087, 3460), new RSTile(3085, 3464), new RSTile(3080, 3467), new RSTile(3079, 3474), new RSTile(3080, 3483), new RSTile(3084, 3489), new RSTile(3092, 3491) };
- private RSTilePath pathToUnicorn1;
- private final RSTile[] tilesToUnicorn2 = { new RSTile(3091, 3455), new RSTile(3087, 3461), new RSTile(3083, 3465), new RSTile(3080, 3467), new RSTile(3079, 3472), new RSTile(3080, 3479), new RSTile(3081, 3484), new RSTile(3084, 3485), new RSTile(3087, 3491), new RSTile(3092, 3490) };
- private RSTilePath pathToUnicorn2;
- private final RSTile[] tilesToUnicorn3 = { new RSTile(3089, 3458), new RSTile(3087, 3462), new RSTile(3085, 3465), new RSTile(3082, 3466), new RSTile(3080, 3470), new RSTile(3080, 3478), new RSTile(3081, 3485), new RSTile(3085, 3489), new RSTile(3089, 3490) };
- private RSTilePath pathToUnicorn3;
- ///Other///
- private RSArea UnicornArea = new RSArea(new RSTile(3099,3462), new RSTile(3081,3449));
- public boolean onStart() {
- pathToUnicorn1 = walking.newTilePath(tilesToUnicorn1);
- pathToUnicorn2 = walking.newTilePath(tilesToUnicorn2);
- pathToUnicorn3 = walking.newTilePath(tilesToUnicorn3);
- log ("DeadUnicorns Initializing!");
- log ("DeadUnicorns Initialized!");
- log.warning ("Happy Botting, Cheater.");
- return true;
- }
- @Override
- public int loop() {
- if (!inventory.isFull() & !UnicornArea.contains(getMyPlayer().getLocation())
- & !getMyPlayer().isInCombat()) {
- choosePathToUnicorn();
- }
- if (inventory.isFull() & UnicornArea.contains(getMyPlayer().getLocation())){
- choosePathToBank();
- }
- if (inventory.isFull() & checkBank()){
- useBank();
- antiban();
- }
- if (!inventory.isFull() & UnicornArea.contains(getMyPlayer().getLocation())){
- attackUnicorns();
- itempickup(hornID,"Unicorn horn");
- antiban();
- }
- return random(876, 2300);
- }
- public void onFinish() {
- log ("DeadUnicorns is de-activating!");
- log ("DeadUnicorns is de-activated");
- log ("DeadUnicorns is stopping");
- }
- public void attackUnicorns(){
- if (getMyPlayer().getInteracting() == null) {
- RSNPC Unicorn = npcs.getNearest("Unicorn");
- if (Unicorn != null && !Unicorn.isInCombat() && Unicorn.getHPPercent() > 0) {
- Unicorn.doAction("Attack");
- }
- }
- }
- public boolean checkBank(){
- RSObject bank = objects.getNearest("bank");
- if(bank != null)
- if(bank.isOnScreen()){
- return true;
- }
- return false;
- }
- private void useBank(){
- if (bank.isOpen()){
- if (bank.isOpen()){
- bank.deposit(hornID, 0);
- sleep(800, 1200);
- }else{
- bank.open();
- sleep(1800,2200);
- }
- }
- }
- public void itempickup (int itemID, String itemText) {
- while (groundItems.getNearest(itemID) != null & !inventory.isFull()) {
- RSGroundItem item = groundItems.getNearest(itemID);
- if (calc.tileOnScreen(item.getLocation())) {
- item.doAction("Take " + itemText);
- } else if (!calc.tileOnScreen(item.getLocation())) {
- walking.walkTileMM(groundItems.getNearest(itemID).getLocation());
- } else {
- sleep(500, 1000);
- }
- sleep (800, 1200);
- }
- }
- public void antiban() {
- int t = random(0, 100);
- switch (t) {
- case 1:
- if (random(0, 10) == 5) {
- mouse.moveSlightly();
- }
- break;
- case 2:
- if (random(0, 25) == 5) {
- camera.setPitch(random(1, 100));
- }
- break;
- case 3:
- if (random(0, 30) == 5) {
- game.openTab(random(0, 15));
- mouse.move(random(550, 735), random(210, 465));
- sleep(random(1000, 2000));
- }
- break;
- case 4:
- if (random(0, 30) == 5) {
- game.openTab(random(0, 15));
- sleep(random(500, random(1000, 2000)));
- }
- break;
- case 5:
- if (random(0, 40) == 5) {
- game.openTab(8);
- interfaces.getComponent(891, 10).doHover();
- sleep(random(1000, 2000));
- }
- break;
- case 6:
- if (random(0, 70) == 5) {
- mouse.moveOffScreen();
- }
- break;
- case 7:
- if (random(0, 25) == 5) {
- camera.setAngle(random(1, 360));
- }
- break;
- default:
- break;
- }
- }
- public boolean choosePathToUnicorn() {
- int Path= random(0,3);
- switch (Path){
- case 0:
- break;
- case 1:
- pathToUnicorn1.traverse();
- break;
- case 2:
- pathToUnicorn2.traverse();
- break;
- case 3:
- pathToUnicorn3.traverse();
- break;
- }
- return true;
- }
- public boolean choosePathToBank() {
- int Path= random(0,5);
- switch (Path){
- case 0:
- break;
- case 1:
- pathToUnicorn1.reverse();
- pathToUnicorn1.traverse();
- pathToUnicorn1.reverse();
- break;
- case 2:
- pathToUnicorn2.reverse();
- pathToUnicorn2.traverse();
- pathToUnicorn2.reverse();
- break;
- case 3:
- pathToUnicorn3.reverse();
- pathToUnicorn3.traverse();
- pathToUnicorn3.reverse();
- break;
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement