Jump to content

[RANGED] Var Sewer Skeleton Owner [UNSTOPABLE]


Recommended Posts

Posted (edited)

Start South of the Skeletons over the River in Varrock Sewers.

 

Can be used from 30+ range.

 

30 15k /hr (No breaks)

 

50 20k /hr (No breaks)

 

60 25k /hr (No breaks)

 

30 - 70 Range takes 5 normal days WITH breaks.

 

Safemode keeps player in a position to get the best XP/HR as well as preventing character from running around the river.

 

It's not perfect, but it gets the job done :-)

 

RANGER.png

 

 

 

 

package Ranged;

import org.osbot.rs07.antiban.AntiBan;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;
import java.util.concurrent.TimeUnit;

/**
 * Created by Admin on 10/24/2015.
 */
@ScriptManifest(name="Varrock Skeleton Ranger",author="Acinate", info="Ranges Skeletons inside Varrock Sewer.", version=1.1, logo="")
public class Skeleton_Ranger extends Script {

    Area RiverSpot = new Area(3253,9911,3255,9907);
    Area RangeSpot = new Area(3253,9911,3253,9911);
    Area Skeletons = new Area(3250,9918,3256,9914);
    Area FarSkeletons = new Area(3249,9913,3246,9918);
    Position SafeSpot = new Position(3253,9911,0);
    Player[] randomPlayers = new Player[] {};

    public boolean isSkeleton() {
        NPC Skeleton = npcs.closest(Skeletons, "Skeleton");

        if (Skeleton.isUnderAttack()) {
            return true;
        } else return false;
    }

    public long timeBegan;
    public long timeRan;

    private int startXP, currentXP, GainedXP, xpPerHour;

    public void onStart() throws InterruptedException {
        log("Thanks for choosing SkeletonZ!");

        timeBegan = System.currentTimeMillis();
        startXP = skills.getExperience(Skill.RANGED)
                + skills.getExperience(Skill.DEFENCE)
                + skills.getExperience(Skill.HITPOINTS);
    }

    private enum State { KILL, IDLE, HOP, SAFEMODE, DIA };

    private State getState() {
        if (dialogues.isPendingContinuation())
            return State.DIA;
        else if (!RiverSpot.contains(myPlayer()) && !myPlayer().isAnimating())
            return State.SAFEMODE;
        else if (RiverSpot.contains(myPlayer()) && !myPlayer().isAnimating())
            return State.KILL;
        else
        return State.IDLE;
    }

    public int onLoop() throws InterruptedException {

        switch(getState()) {
            case DIA:
                dialogues.clickContinue();
            case KILL:
                log("case KILL:");
                NPC Skeleton = npcs.closest(Skeletons, "Skeleton");
                NPC FarSkeleton = npcs.closest(FarSkeletons, "Skeleton");

                if (RangeSpot.contains(myPlayer())) {
                    if (Skeleton != null && !myPlayer().isInteracting(Skeleton)) {
                        if (Skeleton.getAnimation() != 5491)
                        Skeleton.interact("Attack");
                    } else if (Skeleton == null && FarSkeleton != null) {
                        log("Attacking far Skeletons....");
                        FarSkeleton.interact("Attack");
                        localWalker.walk(RangeSpot, true);
                        sleep(random(1000,2000));
                        FarSkeleton.interact("Attack");
                    }
                } else if(!RangeSpot.contains(myPlayer())) {
                    SafeSpot.interact(bot,"Walk here");
                }


                break;
            case SAFEMODE:
                log("case SAFEMODE:");
                    localWalker.walk(RiverSpot, true);
                break;
            case IDLE:
                log("case IDLE:");
                NPC Skele = npcs.closest(Skeletons, "Skeleton");
                int SkeleHealth;
                SkeleHealth = Skele.getHealth();
                log(SkeleHealth);
                int random = random(0, 10);
                log(random);

                while (myPlayer().isAnimating() && SkeleHealth > 0) {

                        if (random < 2)
                            tabs.getSkills().hoverSkill(Skill.RANGED);
                        else if (random == 3)
                            tabs.getSkills().hoverSkill(Skill.RANGED);
                        else if (random == 4)
                            tabs.getSkills().hoverSkill(Skill.HITPOINTS);
                        else if (random == 5)
                        {
                            log("Adjusting Camera");
                            if (isSkeleton() == true)
                                camera.toEntity(Skele);
                        }
                        else if (random > 5) {
                            mouse.moveRandomly();
                            if (random == 6)
                                sleep(random(2000, 3000));
                            else if (random == 7)
                                sleep(random(3000, 4000));
                            else if (random == 8)
                                sleep(random(4000, 5000));
                            else if (random >= 9)
                                sleep(random(5000, 6000));
                        }
                }

                NPC nextSkele = npcs.closest(Skeletons, "Skeleton");
                if (isSkeleton() == false) {
                    log("Attacking next Skeleton..");
                    nextSkele.interact("Attack");
                }

                if (random % 3 == 0)
                    tabs.open(Tab.INVENTORY);

                mouse.moveRandomly();
                break;
        }

        return 1000;
    }

    public void onPaint(Graphics2D g) {
        Graphics2D  gr = g;
        gr.setColor(Color.WHITE);
        gr.setFont(new Font("Arial", Font.ROMAN_BASELINE, 14));

        timeRan = System.currentTimeMillis() - timeBegan;
        currentXP = skills.getExperience(Skill.RANGED)
                + skills.getExperience(Skill.DEFENCE)
                + skills.getExperience(Skill.HITPOINTS);
        GainedXP = currentXP - startXP;
        xpPerHour = (int)(GainedXP / ((System.currentTimeMillis() - timeBegan) / 3600000.0));

        gr.drawString("Time Ran: " + ft(timeRan), 25, 297);
        gr.drawString("XP Gained: " + GainedXP, 25, 312);
        gr.drawString("XP Per hour:" + xpPerHour, 25, 327);
    }

    private String ft(long duration)
    {
        String res = "";
        long days = TimeUnit.MILLISECONDS.toDays(duration);
        long hours = TimeUnit.MILLISECONDS.toHours(duration)
                - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
        long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
                - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
                .toHours(duration));
        long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
                - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
                .toMinutes(duration));
        if (days == 0) {
            res = (hours + ":" + minutes + ":" + seconds);
        } else {
            res = (days + ":" + hours + ":" + minutes + ":" + seconds);
        }
        return res;
    }
}

 

Download it here: http://www.filedropper.com/ranged

 

Extract into OSBOT/Scripts"

 

 

Edited by Acinate
  • Like 2
  • 4 weeks later...
  • 1 month later...
  • 1 year later...
Posted
6 hours ago, DrDu said:

pls post sauce

package Ranged;

import org.osbot.rs07.antiban.AntiBan;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;
import java.util.concurrent.TimeUnit;

/**
 * Created by Admin on 10/24/2015.
 */
@ScriptManifest(name="Varrock Skeleton Ranger",author="Acinate", info="Ranges Skeletons inside Varrock Sewer.", version=1.1, logo="")
public class Skeleton_Ranger extends Script {

    Area RiverSpot = new Area(3253,9911,3255,9907);
    Area RangeSpot = new Area(3253,9911,3253,9911);
    Area Skeletons = new Area(3250,9918,3256,9914);
    Area FarSkeletons = new Area(3249,9913,3246,9918);
    Position SafeSpot = new Position(3253,9911,0);
    Player[] randomPlayers = new Player[] {};

    public boolean isSkeleton() {
        NPC Skeleton = npcs.closest(Skeletons, "Skeleton");

        if (Skeleton.isUnderAttack()) {
            return true;
        } else return false;
    }

    public long timeBegan;
    public long timeRan;

    private int startXP, currentXP, GainedXP, xpPerHour;

    public void onStart() throws InterruptedException {
        log("Thanks for choosing SkeletonZ!");

        timeBegan = System.currentTimeMillis();
        startXP = skills.getExperience(Skill.RANGED)
                + skills.getExperience(Skill.DEFENCE)
                + skills.getExperience(Skill.HITPOINTS);
    }

    private enum State { KILL, IDLE, HOP, SAFEMODE, DIA };

    private State getState() {
        if (dialogues.isPendingContinuation())
            return State.DIA;
        else if (!RiverSpot.contains(myPlayer()) && !myPlayer().isAnimating())
            return State.SAFEMODE;
        else if (RiverSpot.contains(myPlayer()) && !myPlayer().isAnimating())
            return State.KILL;
        else
        return State.IDLE;
    }

    public int onLoop() throws InterruptedException {

        switch(getState()) {
            case DIA:
                dialogues.clickContinue();
            case KILL:
                log("case KILL:");
                NPC Skeleton = npcs.closest(Skeletons, "Skeleton");
                NPC FarSkeleton = npcs.closest(FarSkeletons, "Skeleton");

                if (RangeSpot.contains(myPlayer())) {
                    if (Skeleton != null && !myPlayer().isInteracting(Skeleton)) {
                        if (Skeleton.getAnimation() != 5491)
                        Skeleton.interact("Attack");
                    } else if (Skeleton == null && FarSkeleton != null) {
                        log("Attacking far Skeletons....");
                        FarSkeleton.interact("Attack");
                        localWalker.walk(RangeSpot, true);
                        sleep(random(1000,2000));
                        FarSkeleton.interact("Attack");
                    }
                } else if(!RangeSpot.contains(myPlayer())) {
                    SafeSpot.interact(bot,"Walk here");
                }


                break;
            case SAFEMODE:
                log("case SAFEMODE:");
                    localWalker.walk(RiverSpot, true);
                break;
            case IDLE:
                log("case IDLE:");
                NPC Skele = npcs.closest(Skeletons, "Skeleton");
                int SkeleHealth;
                SkeleHealth = Skele.getHealth();
                log(SkeleHealth);
                int random = random(0, 10);
                log(random);

                while (myPlayer().isAnimating() && SkeleHealth > 0) {

                        if (random < 2)
                            tabs.getSkills().hoverSkill(Skill.RANGED);
                        else if (random == 3)
                            tabs.getSkills().hoverSkill(Skill.RANGED);
                        else if (random == 4)
                            tabs.getSkills().hoverSkill(Skill.HITPOINTS);
                        else if (random == 5)
                        {
                            log("Adjusting Camera");
                            if (isSkeleton() == true)
                                camera.toEntity(Skele);
                        }
                        else if (random > 5) {
                            mouse.moveRandomly();
                            if (random == 6)
                                sleep(random(2000, 3000));
                            else if (random == 7)
                                sleep(random(3000, 4000));
                            else if (random == 8)
                                sleep(random(4000, 5000));
                            else if (random >= 9)
                                sleep(random(5000, 6000));
                        }
                }

                NPC nextSkele = npcs.closest(Skeletons, "Skeleton");
                if (isSkeleton() == false) {
                    log("Attacking next Skeleton..");
                    nextSkele.interact("Attack");
                }

                if (random % 3 == 0)
                    tabs.open(Tab.INVENTORY);

                mouse.moveRandomly();
                break;
        }

        return 1000;
    }

    public void onPaint(Graphics2D g) {
        Graphics2D  gr = g;
        gr.setColor(Color.WHITE);
        gr.setFont(new Font("Arial", Font.ROMAN_BASELINE, 14));

        timeRan = System.currentTimeMillis() - timeBegan;
        currentXP = skills.getExperience(Skill.RANGED)
                + skills.getExperience(Skill.DEFENCE)
                + skills.getExperience(Skill.HITPOINTS);
        GainedXP = currentXP - startXP;
        xpPerHour = (int)(GainedXP / ((System.currentTimeMillis() - timeBegan) / 3600000.0));

        gr.drawString("Time Ran: " + ft(timeRan), 25, 297);
        gr.drawString("XP Gained: " + GainedXP, 25, 312);
        gr.drawString("XP Per hour:" + xpPerHour, 25, 327);
    }

    private String ft(long duration)
    {
        String res = "";
        long days = TimeUnit.MILLISECONDS.toDays(duration);
        long hours = TimeUnit.MILLISECONDS.toHours(duration)
                - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
        long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
                - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
                .toHours(duration));
        long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
                - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
                .toMinutes(duration));
        if (days == 0) {
            res = (hours + ":" + minutes + ":" + seconds);
        } else {
            res = (days + ":" + hours + ":" + minutes + ":" + seconds);
        }
        return res;
    }
}
Posted
3 hours ago, FFTL said:

package Ranged;

import org.osbot.rs07.antiban.AntiBan;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;
import java.util.concurrent.TimeUnit;

/**
 * Created by Admin on 10/24/2015.
 */
@ScriptManifest(name="Varrock Skeleton Ranger",author="Acinate", info="Ranges Skeletons inside Varrock Sewer.", version=1.1, logo="")
public class Skeleton_Ranger extends Script {

    Area RiverSpot = new Area(3253,9911,3255,9907);
    Area RangeSpot = new Area(3253,9911,3253,9911);
    Area Skeletons = new Area(3250,9918,3256,9914);
    Area FarSkeletons = new Area(3249,9913,3246,9918);
    Position SafeSpot = new Position(3253,9911,0);
    Player[] randomPlayers = new Player[] {};

    public boolean isSkeleton() {
        NPC Skeleton = npcs.closest(Skeletons, "Skeleton");

        if (Skeleton.isUnderAttack()) {
            return true;
        } else return false;
    }

    public long timeBegan;
    public long timeRan;

    private int startXP, currentXP, GainedXP, xpPerHour;

    public void onStart() throws InterruptedException {
        log("Thanks for choosing SkeletonZ!");

        timeBegan = System.currentTimeMillis();
        startXP = skills.getExperience(Skill.RANGED)
                + skills.getExperience(Skill.DEFENCE)
                + skills.getExperience(Skill.HITPOINTS);
    }

    private enum State { KILL, IDLE, HOP, SAFEMODE, DIA };

    private State getState() {
        if (dialogues.isPendingContinuation())
            return State.DIA;
        else if (!RiverSpot.contains(myPlayer()) && !myPlayer().isAnimating())
            return State.SAFEMODE;
        else if (RiverSpot.contains(myPlayer()) && !myPlayer().isAnimating())
            return State.KILL;
        else
        return State.IDLE;
    }

    public int onLoop() throws InterruptedException {

        switch(getState()) {
            case DIA:
                dialogues.clickContinue();
            case KILL:
                log("case KILL:");
                NPC Skeleton = npcs.closest(Skeletons, "Skeleton");
                NPC FarSkeleton = npcs.closest(FarSkeletons, "Skeleton");

                if (RangeSpot.contains(myPlayer())) {
                    if (Skeleton != null && !myPlayer().isInteracting(Skeleton)) {
                        if (Skeleton.getAnimation() != 5491)
                        Skeleton.interact("Attack");
                    } else if (Skeleton == null && FarSkeleton != null) {
                        log("Attacking far Skeletons....");
                        FarSkeleton.interact("Attack");
                        localWalker.walk(RangeSpot, true);
                        sleep(random(1000,2000));
                        FarSkeleton.interact("Attack");
                    }
                } else if(!RangeSpot.contains(myPlayer())) {
                    SafeSpot.interact(bot,"Walk here");
                }


                break;
            case SAFEMODE:
                log("case SAFEMODE:");
                    localWalker.walk(RiverSpot, true);
                break;
            case IDLE:
                log("case IDLE:");
                NPC Skele = npcs.closest(Skeletons, "Skeleton");
                int SkeleHealth;
                SkeleHealth = Skele.getHealth();
                log(SkeleHealth);
                int random = random(0, 10);
                log(random);

                while (myPlayer().isAnimating() && SkeleHealth > 0) {

                        if (random < 2)
                            tabs.getSkills().hoverSkill(Skill.RANGED);
                        else if (random == 3)
                            tabs.getSkills().hoverSkill(Skill.RANGED);
                        else if (random == 4)
                            tabs.getSkills().hoverSkill(Skill.HITPOINTS);
                        else if (random == 5)
                        {
                            log("Adjusting Camera");
                            if (isSkeleton() == true)
                                camera.toEntity(Skele);
                        }
                        else if (random > 5) {
                            mouse.moveRandomly();
                            if (random == 6)
                                sleep(random(2000, 3000));
                            else if (random == 7)
                                sleep(random(3000, 4000));
                            else if (random == 8)
                                sleep(random(4000, 5000));
                            else if (random >= 9)
                                sleep(random(5000, 6000));
                        }
                }

                NPC nextSkele = npcs.closest(Skeletons, "Skeleton");
                if (isSkeleton() == false) {
                    log("Attacking next Skeleton..");
                    nextSkele.interact("Attack");
                }

                if (random % 3 == 0)
                    tabs.open(Tab.INVENTORY);

                mouse.moveRandomly();
                break;
        }

        return 1000;
    }

    public void onPaint(Graphics2D g) {
        Graphics2D  gr = g;
        gr.setColor(Color.WHITE);
        gr.setFont(new Font("Arial", Font.ROMAN_BASELINE, 14));

        timeRan = System.currentTimeMillis() - timeBegan;
        currentXP = skills.getExperience(Skill.RANGED)
                + skills.getExperience(Skill.DEFENCE)
                + skills.getExperience(Skill.HITPOINTS);
        GainedXP = currentXP - startXP;
        xpPerHour = (int)(GainedXP / ((System.currentTimeMillis() - timeBegan) / 3600000.0));

        gr.drawString("Time Ran: " + ft(timeRan), 25, 297);
        gr.drawString("XP Gained: " + GainedXP, 25, 312);
        gr.drawString("XP Per hour:" + xpPerHour, 25, 327);
    }

    private String ft(long duration)
    {
        String res = "";
        long days = TimeUnit.MILLISECONDS.toDays(duration);
        long hours = TimeUnit.MILLISECONDS.toHours(duration)
                - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
        long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
                - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
                .toHours(duration));
        long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
                - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
                .toMinutes(duration));
        if (days == 0) {
            res = (hours + ":" + minutes + ":" + seconds);
        } else {
            res = (days + ":" + hours + ":" + minutes + ":" + seconds);
        }
        return res;
    }
}

What's the problem? Why's it broken. 

Posted (edited)

Its not running back where it should stay, if it missclicks. Safespot is not working.


I accidentally edited out the post. This is just a quick one I wrote as I fked the other one over real bad

Here's the problem.

 

 


                if (RangeSpot.contains(myPlayer())) {
                    if (Skeleton != null && !myPlayer().isInteracting(Skeleton)) {
                        if (Skeleton.getAnimation() != 5491)
                        Skeleton.interact("Attack");
                    } else if (Skeleton == null && FarSkeleton != null) {
                        log("Attacking far Skeletons....");
                        FarSkeleton.interact("Attack");
                        localWalker.walk(RangeSpot, true);
                        sleep(random(1000,2000));
                        FarSkeleton.interact("Attack");
                    }
                } else if(!RangeSpot.contains(myPlayer())) {
                    SafeSpot.interact(bot,"Walk here");
                }



Should be 

 

                if (RangeSpot.contains(myPlayer())) {
                    if (Skeleton != null && !myPlayer().isInteracting(Skeleton)) {
                    if(Safespot.contains(myPlayer()){
                     if (Skeleton.getAnimation() != 5491)
                        Skeleton.interact("Attack");
                    }
                       
                    } else if (Skeleton == null && FarSkeleton != null) {
                        log("Attacking far Skeletons....");
                        FarSkeleton.interact("Attack");
                        localWalker.walk(RangeSpot, true);
                        sleep(random(1000,2000));
                        FarSkeleton.interact("Attack");
                    }
                } else if(!RangeSpot.contains(myPlayer())) {
                if(!SafeSpot.contains(myPlayer())
                    SafeSpot.interact(bot,"Walk here");
                }

If this doesn't work then you'd need to tell just say if the players position != safespot position. Then walk there. 

 

Edited by Satire

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...