• RE: Handle randoms like a pro

    @1234567Alex said in Handle randoms like a pro:

    @Man16 I'm sorry but I have never assisted to a successful handling of a random event before using the shown method of this OP.

    But I trust your word and experience I'll try to catch one time that it handles it by itself , thank you 🙂

    You have to configure an account in the account manager and select it before you run a script.

    posted in Snippets
  • RE: Handle randoms like a pro

    @1234567Alex said in Handle randoms like a pro:

    @Man16
    thanks for replying 16!
    Actually, then can you please give me an example of how it works ?

    • Does your script have to handle the interactions with the Random Event's npcs ?
    • If there is a lamp in my inventory while a script is running that have not been coded to interact with a Lamp at all, will the client do it itself ??

    Your script doesn't have to do anything. The user just selects their account in the account manager before running a script and it will apply all the breaks and randoms specified for that account.

    posted in Snippets
  • RE: Handle randoms like a pro

    @1234567Alex said in Handle randoms like a pro:

    Does anyone know how to find out the numbers of other skill than prayer for the checkLamp() method?
    I cannot test with a in-game Lamp so is there a way to know the other interfaces component without testing?

    There's almost no reason to use this now since the client can handle this

    posted in Snippets
  • RSPeer 1.69

    RSPeer 1.69 has been released. Below is the changelog for this build

    • Fixed the wintertodt bank action
    • Fixed an issue with withdrawAll and noted items
    • Added the battlefront teleport to the necromancy spell enum
    • Fixed the DIR fairy ring
    • Fixed an issue with the remembered game account not being reset correctly
    • Added isEquipped to RSPlayerAppearance
    • Fixed an issue where an x coordinate was being passed as a y coordinate to ScenePosition
    • Added newQuery() to Players, Npcs, SceneObjects, Projectiles, Pickables, Trade, Shop, Inventory, DepositBox, Equipment, Production and Bank (More soon)
    posted in Announcements
  • RE: Proper banking technique?

    You sure that node is still executing? Whats the validate on it.

    posted in Development
  • RE: Proper banking technique?

    we cant tell anything from a 3 line snippet

    posted in Development
  • Open Source Price Checker

    Small class to lookup item price by name or id from RSBuddy GE API. Refreshes every 30 minutes by default to keep prices updated.

    package org.rspeer.runetek.api.commons;
    
    import com.acuitybotting.common.utils.ExecutorUtil;
    import com.allatori.annotations.DoNotRename;
    import com.google.gson.Gson;
    import com.google.gson.JsonObject;
    import com.google.gson.annotations.SerializedName;
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;
    import com.mashape.unirest.http.exceptions.UnirestException;
    import org.rspeer.ui.Log;
    
    import java.util.HashMap;
    import java.util.Map;
    import java.util.concurrent.ScheduledFuture;
    import java.util.concurrent.ScheduledThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    
    public class PriceCheck {
    
        private static Gson g = new Gson();
        private static Map<String, Integer> itemNameMapping = new HashMap<>();
        private static Map<Integer, ItemPrice> prices = new HashMap<>();
        private static int reloadMinutes = 30;
        private static boolean isReloadEnabled = true;
    
        private static ScheduledThreadPoolExecutor executor = ExecutorUtil.newScheduledExecutorPool(1, Throwable::printStackTrace);
        private static ScheduledFuture<?> task;
    
        public static ItemPrice getPrice(String name) {
            if(prices.size() == 0) {
                reload();
            }
            int id = itemNameMapping.getOrDefault(name.toLowerCase(), -1);
            return id == -1 ? null : getPrice(id);
        }
    
        public static ItemPrice getPrice(int id) {
            if(prices.size() == 0) {
                reload();
            }
            return prices.getOrDefault(id, null);
        }
    
        public static void reload() {
            if(!isReloadEnabled && prices.size() > 0) {
                return;
            }
            if(task == null && isReloadEnabled) {
                task = executor.scheduleAtFixedRate(PriceCheck::reload, reloadMinutes, reloadMinutes, TimeUnit.MINUTES);
            }
            try {
                HttpResponse<String> node = Unirest.get("https://rsbuddy.com/exchange/summary.json").asString();
                if(node.getStatus() != 200) {
                    System.out.println(node.getBody());
                    Log.severe("PriceCheck", "Failed to load prices. Result: " + node.getBody());
                    return;
                }
                JsonObject o = g.fromJson(node.getBody(), JsonObject.class);
                for (String s : o.keySet()) {
                    ItemPrice price = g.fromJson(o.get(s).getAsJsonObject(), ItemPrice.class);
                    int id = Integer.parseInt(s);
                    String name = price.name.toLowerCase();
                    itemNameMapping.remove(name);
                    itemNameMapping.put(name, id);
                    prices.remove(id);
                    prices.put(id, price);
                }
            } catch (UnirestException e) {
                e.printStackTrace();
               Log.severe(e);
            }
        }
    
        public static void dispose() {
            task.cancel(true);
            executor.shutdown();
        }
    
        public static void setShouldReload(boolean value) {
            isReloadEnabled = value;
        }
    
        @DoNotRename
        public class ItemPrice {
    
            @DoNotRename
            private String name;
            @DoNotRename
            private boolean members;
            @DoNotRename
            @SerializedName("buy_average")
            private int buyAverage;
            @DoNotRename
            @SerializedName("sell_average")
            private int sellAverage;
            @DoNotRename
            @SerializedName("overall_average")
            private int overallAverage;
    
            public String getName() {
                return name;
            }
    
            public boolean isMembers() {
                return members;
            }
    
            public int getBuyAverage() {
                return buyAverage;
            }
    
            public int getSellAverage() {
                return sellAverage;
            }
    
            public int getOverallAverage() {
                return overallAverage;
            }
        }
    }
    
    posted in Source code
  • RE: Bought tokens and they weren't added to my account

    Seems like you have them now (as of 19 minutes ago)

    posted in Support
  • RE: RSPeer AIO Fighter

    @1234567Alex said in RSPeer AIO Fighter:

    @MadDev Are you still with the intention of finishing this ? It looks really really impressive. The target switch is brilliant and the painting is perfect.

    I haven't had much time lately, but a possibility. I opened sourced it in case anyone else wanted to.

    posted in Projects
  • RE: Auto Talker/Keystroke script

    Auto typers are not allowed on the SDN. You can, however, buy a private one from any VSS. (See #welcome in the Discord channel)

    posted in Requests