Jump to content

Folks

Lifetime Sponsor
  • Posts

    60
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by Folks

  1. Here is a quick bank util I made after running into issues with walking to the nearest bank only to have it be unaccessible due to quest/skill requirements. I haven't tested this yet but I may need to alter it so that the quest checks are cached once on initialization if it takes a long time to do all the checks.

    If anyone knows the config values for checking RFD sub-quest completion and is willing to share, let me know so I can add those checks in properly as well as the Lunar Diplomacy and Tree Gnome Stronghold values.

    Banks taken from here but I plan to add most if not all of the banks listed on the wiki when time permits.


    I think spoilers are broken so enjoy the long ass post 😁

    Usage

    BankUtil.getAccessibleBanks(SomeMethodProvider);


    Source
     

    import org.osbot.rs07.api.Favour;
    import org.osbot.rs07.api.Quests;
    import org.osbot.rs07.api.map.Area;
    import org.osbot.rs07.api.map.constants.Banks;
    import org.osbot.rs07.api.ui.EquipmentSlot;
    import org.osbot.rs07.api.ui.Skill;
    import org.osbot.rs07.script.MethodProvider;
    
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;
    
    public class BankUtil {
    
        enum Bank {
            AL_KHARID(Banks.AL_KHARID),
            ARCEUUS_HOUSE(Banks.ARCEUUS_HOUSE),
            ARDOUGNE_NORTH(Banks.ARDOUGNE_NORTH),
            ARDOUGNE_SOUTH(Banks.ARDOUGNE_SOUTH),
            CAMELOT(Banks.CAMELOT),
            CANIFIS(Banks.CANIFIS),
            CASTLE_WARS(Banks.CASTLE_WARS),
            CATHERBY(Banks.CATHERBY),
            DRAYNOR(Banks.DRAYNOR),
            DUEL_ARENA(Banks.DUEL_ARENA),
            EDGEVILLE(Banks.EDGEVILLE),
            FALADOR_EAST(Banks.FALADOR_EAST),
            FALADOR_WEST(Banks.FALADOR_WEST),
            GNOME_STRONGHOLD(Banks.GNOME_STRONGHOLD),
            GRAND_EXCHANGE(Banks.GRAND_EXCHANGE),
            HOSIDIUS_HOUSE(Banks.HOSIDIUS_HOUSE),
            LOVAKENGJ_HOUSE(Banks.LOVAKENGJ_HOUSE),
            LOVAKITE_MINE(Banks.LOVAKITE_MINE),
            LUMBRIDGE_LOWER(Banks.LUMBRIDGE_LOWER),
            LUMBRIDGE_UPPER(Banks.LUMBRIDGE_UPPER),
            PEST_CONTROL(Banks.PEST_CONTROL),
            PISCARILIUS_HOUSE(Banks.PISCARILIUS_HOUSE),
            SHAYZIEN_HOUSE(Banks.SHAYZIEN_HOUSE),
            TZHAAR(Banks.TZHAAR),
            VARROCK_EAST(Banks.VARROCK_EAST),
            VARROCK_WEST(Banks.VARROCK_WEST),
            YANILLE(Banks.YANILLE),
            BARBARIAN_ASSAULT(new Area(2534, 3576, 2537, 3572)),
            BURGH_DE_ROTT(new Area(3496, 3213, 3499, 3210)),
            CRAFTING_GUILD(new Area(2933, 3284, 2936, 3281)),
            ETCETERIA(new Area(2618, 3896, 2620, 3893)),
            FISHING_TRAWLER(new Area(2661, 3162, 2665, 3160)),
            FISHING_GUILD(new Area(2584, 3422, 2588, 3418)),
            GRAND_TREE_WEST(new Area(2440, 3489, 2442, 3487).setPlane(1)),
            GRAND_TREE_SOUTH(new Area(2448, 3482, 2450, 3479).setPlane(1)),
            JATISZO(new Area(2415, 3803, 2418, 3801)),
            KOUREND(new Area(1610, 3683, 1613, 3680).setPlane(2)),
            LLETYA(new Area(2350, 3163, 2354, 3162)),
            LUNAR_ISLE(new Area(2097, 3919, 2102, 3917)),
            LANDS_END(new Area(1508, 3423, 1511, 3419)),
            NARDAH(new Area(3424, 2892, 3430, 2889)),
            NEITIZNOT(new Area(2335, 3808, 2337, 3805)),
            PORT_PHASMATYS(new Area(3686, 3471, 3691, 3463)),
            PISCATORIS(new Area(2327, 3690, 2332, 3687)),
            SHILO_VILLAGE(new Area(2849, 2955, 2855, 2953)),
            SANDCRABS(new Area(1717, 3466, 1722, 3463)),
            SHANTAY_PASS(new Area(3305, 3123, 3308, 3119)),
            SULPHUR_MINE(new Area(1453, 3859, 1458, 3856)),
            TREE_GNOME_STRONGHOLD(new Area(2444, 3427, 2446, 3422).setPlane(1)),
            VINERY(new Area(1802, 3571, 1808, 3571)),
            WARRIORS_GUILD(new Area(2843, 3544, 2846, 3539)),
            WOODCUTTING_GUILD(new Area(1589, 3480, 1593, 3476)),
            ZEAH_COOKING(new Area(1653, 3613, 1658, 3607));
    
            private final Area area;
    
            Bank(final Area area) {
                this.area = area;
            }
    
            public Area getArea() {
                return area;
            }
        }
    
    
        public static Area[] getBankAreas() {
            return Arrays.stream(Bank.values()).map(Bank::getArea).toArray(Area[]::new);
        }
    
        public static Area[] getAccessibleBanks(final MethodProvider api) {
            List<Area> accessibleBanks = new ArrayList<>();
    
            // f2p
            accessibleBanks.add(Bank.AL_KHARID.getArea());
            accessibleBanks.add(Bank.CASTLE_WARS.getArea());
            accessibleBanks.add(Bank.DRAYNOR.getArea());
            accessibleBanks.add(Bank.DUEL_ARENA.getArea());
            accessibleBanks.add(Bank.EDGEVILLE.getArea());
            accessibleBanks.add(Bank.FALADOR_EAST.getArea());
            accessibleBanks.add(Bank.FALADOR_WEST.getArea());
            accessibleBanks.add(Bank.GRAND_EXCHANGE.getArea());
            accessibleBanks.add(Bank.LUMBRIDGE_UPPER.getArea());
            accessibleBanks.add(Bank.VARROCK_EAST.getArea());
            accessibleBanks.add(Bank.VARROCK_WEST.getArea());
            accessibleBanks.add(Bank.SHANTAY_PASS.getArea());
    
            if (api.getSkills().getVirtualLevel(Skill.CRAFTING) >= 40 && api.getEquipment().isWearingItem(EquipmentSlot.CHEST, "Brown apron")) {
                accessibleBanks.add(Bank.CRAFTING_GUILD.getArea());
            }
    
            // p2p
            if (api.getClient().isMember() && api.getWorlds().isMembersWorld()) {
                accessibleBanks.add(Bank.ARCEUUS_HOUSE.getArea());
                accessibleBanks.add(Bank.ARDOUGNE_NORTH.getArea());
                accessibleBanks.add(Bank.ARDOUGNE_SOUTH.getArea());
                accessibleBanks.add(Bank.CAMELOT.getArea());
                accessibleBanks.add(Bank.CATHERBY.getArea());
                accessibleBanks.add(Bank.GNOME_STRONGHOLD.getArea());
                accessibleBanks.add(Bank.HOSIDIUS_HOUSE.getArea());
                accessibleBanks.add(Bank.LOVAKENGJ_HOUSE.getArea());
                accessibleBanks.add(Bank.LOVAKITE_MINE.getArea());
                accessibleBanks.add(Bank.PEST_CONTROL.getArea());
                accessibleBanks.add(Bank.PISCARILIUS_HOUSE.getArea());
                accessibleBanks.add(Bank.SHAYZIEN_HOUSE.getArea());
                accessibleBanks.add(Bank.TZHAAR.getArea());
                accessibleBanks.add(Bank.YANILLE.getArea());
                accessibleBanks.add(Bank.BARBARIAN_ASSAULT.getArea());
                accessibleBanks.add(Bank.VINERY.getArea());
                accessibleBanks.add(Bank.FISHING_TRAWLER.getArea());
                accessibleBanks.add(Bank.KOUREND.getArea());
                accessibleBanks.add(Bank.ZEAH_COOKING.getArea());
                accessibleBanks.add(Bank.LANDS_END.getArea());
                accessibleBanks.add(Bank.NARDAH.getArea());
                accessibleBanks.add(Bank.SANDCRABS.getArea());
                accessibleBanks.add(Bank.SULPHUR_MINE.getArea());
    
                if (api.getQuests().isComplete(Quests.Quest.PRIEST_IN_PERIL)) {
                    accessibleBanks.add(Bank.PORT_PHASMATYS.getArea());
                    accessibleBanks.add(Bank.CANIFIS.getArea());
                }
    
                if (api.getQuests().isStarted(Quests.Quest.IN_AID_OF_THE_MYREQUE)) {
                    accessibleBanks.add(Bank.BURGH_DE_ROTT.getArea());
                }
    
                if (api.getQuests().isComplete(Quests.Quest.THE_FREMENNIK_TRIALS)) {
                    accessibleBanks.add(Bank.ETCETERIA.getArea());
                    if (api.getQuests().isStarted(Quests.Quest.THE_FREMENNIK_ISLES)) {
                        accessibleBanks.add(Bank.JATISZO.getArea());
                        accessibleBanks.add(Bank.NEITIZNOT.getArea());
                    }
                }
    
                if (api.getQuests().isComplete(Quests.Quest.SHILO_VILLAGE)) {
                    accessibleBanks.add(Bank.SHILO_VILLAGE.getArea());
                }
    
                if (api.getQuests().isStarted(Quests.Quest.MOURNINGS_END_PART_I)) {
                    accessibleBanks.add(Bank.LLETYA.getArea());
                }
    
                if (api.getQuests().isComplete(Quests.Quest.SWAN_SONG)) {
                    accessibleBanks.add(Bank.PISCATORIS.getArea());
                }
    
                if (api.getSkills().getVirtualLevel(Skill.FISHING) >= 68) {
                    accessibleBanks.add(Bank.FISHING_GUILD.getArea());
                }
    
                if (api.getSkills().getVirtualLevel(Skill.ATTACK) + api.getSkills().getVirtualLevel(Skill.STRENGTH) >= 130) {
                    accessibleBanks.add(Bank.WARRIORS_GUILD.getArea());
                }
    
                if (api.getSkills().getVirtualLevel(Skill.WOODCUTTING) >= 60 && api.getFavour().getFavour(Favour.House.HOSIDIUS) >= 75) {
                    accessibleBanks.add(Bank.WOODCUTTING_GUILD.getArea());
                }
    
                // First time entering minigame(?) Need to figure this out.
                if (false) {
                    accessibleBanks.add(Bank.GRAND_TREE_WEST.getArea());
                    accessibleBanks.add(Bank.GRAND_TREE_SOUTH.getArea());
                    accessibleBanks.add(Bank.TREE_GNOME_STRONGHOLD.getArea());
                }
    
                // Only needs partial completion, need to figure out the check for it.
                if (api.getQuests().isComplete(Quests.Quest.LUNAR_DIPLOMACY)) {
                    accessibleBanks.add(Bank.LUNAR_ISLE.getArea());
                }
    
                // Only needs one part finished, need to figure out the check for that as well.
                if (api.getQuests().isStarted(Quests.Quest.RECIPE_FOR_DISASTER)) {
                    accessibleBanks.add(Bank.LUMBRIDGE_LOWER.getArea());
                }
            }
    
            return accessibleBanks.toArray(new Area[0]);
        }
    
    }

     

    • Like 5
  2. While working on my own paint, I liked the aesthetic of the chatbox so I wanted to keep the look and paint over it with the same or similar colors. I figured I'd share since others might find it useful.

    Side note I just noticed there is a chatbox in the api which might have something to make this easier or better but I am too lazy to look into it at this point.

    private static final int CHAT_BOX_X = 0;
    private static final int CHAT_BOX_Y = 338;
    private static final int CHAT_BOX_WIDTH = 519;
    private static final int CHAT_BOX_HEIGHT = 142;
    private static final int CHAT_BOX_PADDING = 6;
    
    private static final Color CHAT_BOX_COLOR = new Color(200, 180, 150);
    
    public void fillChatBoxPadded(final Graphics2D g) {
        int paddedX = CHAT_BOX_X + CHAT_BOX_PADDING;
        int paddedY = CHAT_BOX_Y + CHAT_BOX_PADDING;
        int paddedWidth = CHAT_BOX_WIDTH - (2 * CHAT_BOX_PADDING);
        int paddedHeight = CHAT_BOX_HEIGHT - (2 * CHAT_BOX_PADDING);
    
        g.setColor(CHAT_BOX_COLOR);
        g.fillRect(paddedX, paddedY, paddedWidth, paddedHeight);
        g.setColor(Color.black);
        g.drawRect(paddedX, paddedY, paddedWidth, paddedHeight);
    }
    
    public void fillChatBox(final Graphics2D g) {
        g.setColor(CHAT_BOX_COLOR);
        g.fillRect(CHAT_BOX_X, CHAT_BOX_Y, CHAT_BOX_WIDTH, CHAT_BOX_HEIGHT);
        g.setColor(Color.black);
        g.drawRect(CHAT_BOX_X, CHAT_BOX_Y, CHAT_BOX_WIDTH, CHAT_BOX_HEIGHT);
    }

     

    With padding
    hC7xEvI.png

    Without padding

    qOWHJPC.png

     

    • Like 2
    • Heart 1
  3. 3 hours ago, RevokedHonor said:

    that is pretty insane, i have this scripts for a few months now and only do 1 hour a day tops and only few days a week. gz on 99

    I was pretty surprised that I didn't get a ban as well. 4ish hours a day max but essentially every day around the same time (during my lunch breaks, after work).

  4. On 7/4/2020 at 6:23 AM, Apaec said:

    Hmm, I hadn't realised the interface changes in this way! I will take a look. Do you know if this is the case only in lumbridge castle? Or does it happen for all fires/ranges?

    It is for all fires/ranges, when you have cooked food that has a burnt variation used in a quest (such as druidic ritiual, reference https://oldschool.runescape.wiki/w/Burnt_food), it will give you the option to burn it manually.

  5. 1. A description of the suggestion

    Using the utilities package takeScreenshot() function, it would be convenient to be able to set or get the screenshot names.

    2. How will this suggestion impact scripters and/or botters?

    Not 100% sure if its useful to most scripters but as I am creating a dataset for an object detection ML model it would make it easier to link the data and images if there was an easy way to get or set the screenshots name.

    3. Post any examples such as code or pictures to supplement your description (optional)

    List<RS2Object> objects;
    
    ArrayList<String> nodes = new ArrayList<>();
    nodes.add("class,fileName,height,width,xmax,xmin,ymax,ymin");
    
    String ss = Utilities.takeScreenshot();
    
    for (Entity e : objects) {
      Rectangle rectangle = GraphicUtilities.getModelBoundingBox(bot, e.getGridX(), e.getGridY(), e.getZ(), e.getModel());
      nodes.add("object," + ss + "," + 123 + "," + 123 + "," + rectangle.x + "," + rectangle.width + ","+rectangle.y + "," + rectangle.height);
    }

    that code is just a rough sketch but it should get the idea across.

     

    • Like 2
  6. 1. OSBot Version (do NOT put "current version", be specific)

    2.5.22 but I assume it has always been this way.

    2. A description of the issue. Include relevant logs.

    When using the screenshot function built into the osbot api, if there is an advertisement being shown the screenshot will also contain the ad.

    3. How can you replicate the issue?

    Use code below when an advertisement is being shown

     

    Utilities.takeScreenshot();

    I'd post an image of it but I am not currently on my desktop and osbot is currently down.

    • Like 1
  7. 1 hour ago, Knuckolls said:

    that actually does sound interesting, would you be willing to post your findings after your model is complete?

    Yea, I'll try to write up a tutorial too so others can could follow along with or change the methods I am doing.

  8. 1 minute ago, Alek said:

    You can, but you're wasting a shit ton of CPU for no reason - probably will use more CPU than your script itself.

    I am not actually making a script with it, I am training a deep learning model for an into to machine learning class and i figured the easiest way to build a data set would be to automate it with a bot. ?

    2 minutes ago, Lordsthan said:

     

    Thanks a ton!

    • Like 1
  9. Hey!

    I am wondering if its possible to trace an object such as a tree or rock to mine with the paint? I was looking through the methods and objects have an x, y position and a x, y size but for example with copper and tin ore their sizes are 1 for both x and y which obviously doesnt help too much. I have tried to find a method that could get the bounds of a object but I may be missing it.

    Even just drawing a square around the object would be fine!


    Thanks!

  10. On 11/12/2017 at 4:26 PM, Slut said:

    I never said it doesn't work, I simply quoted that it's not supported, which simply means there could be problems with it.

    This thread has nothing to do with stealth quester though.

  11. 29 minutes ago, shyronnthefair said:

    I ran through the kourend quest and mountain daughter. Both took between 20-30min to complete. Didnt watch it necessarily so i cant report how well it used the stamina potions. But it looked to be pretty effecient. mecient from what I was observing in the checkpoints I was monitoring the two quests. 

     

    Side Note: It doesnt seem to recognize Dragon Slayer, Shield of Arrav, and Shade of Morton Skips over the

    He posted above that he uploaded the wrong version and those quests aren't completely supported yet.

  12. 8 hours ago, sudoinit6 said:

    Do you have problems with webwalking?

     

    I found a sweet hookup on vps with a gig of ram and a shitty cpu and I am running all those options but I get a lot of this:

    
    WebWalkingEvent; Terminated! Exceeded attempt threshold.

     

    I code around it and eventually it gets where it needs to go but it is sapping my overall efficiency. It's strange, sometimes it will give me that error 40 times in a row and sometimes it walks just fine, same route.

    Not really, my webwalking seems fine, are you using lowcpu?

×
×
  • Create New...