Jump to content

Beenrange

Members
  • Posts

    17
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Beenrange's Achievements

Newbie

Newbie (1/10)

2

Reputation

  1. Can you give a code snippet of how you are trying to sleep? As for the needing to close OSBot, no, you can simply click the play button to choose a script. When on that screen, hit the refresh button - then you can run your updated jar.
  2. Instead of using rs GE, use rsbuddy GE as its more reflective of actual prices imo... Following code was found elsewhere and adopted for my usecase (sorry cant remember source) private final static String RSBUDDY_URL = "https://rsbuddy.com/exchange/summary.json"; public static HashMap<String, Integer> getPriceMap(List<String> items) { HashMap<String, Integer> priceMap = new HashMap<>(); try { URL url = new URL(RSBUDDY_URL); BufferedReader jsonFile = new BufferedReader(new InputStreamReader(url.openStream())); JsonObject priceJSON = JsonObject.readFrom(jsonFile.readLine()); Iterator<Member> iterator = priceJSON.iterator(); while (iterator.hasNext()) { JsonObject itemJSON = priceJSON.get(iterator.next().getName()).asObject(); String itemName = itemJSON.get("name").asString(); if (items.contains(itemName)) { priceMap.put(itemName, itemJSON.get("buy_average").asInt()); } } } catch (Exception e) { } return priceMap; } Then, every time you loot an item or if you already know the item name, add it to a list of strings. You can use it as such.... HashMap<String,Integer> itemPrices = new HashMap(); itemPrices = getPriceMap(items); For keeping a list of total looted you could (inefficiently, sorry unwilling to share my code) for(String item : items){ itemPrices = getPriceMap(items); try { total = total + itemPrices.get(item); } catch (Exception e) { log("Empty"); } } items.clear(); } You can use the following library (literally just copy and paste the .java files into your code, I don't know of a better way of doing this) https://github.com/ralfstx/minimal-json
  3. Thank you, the logic is clear now will be replacing many of my sleeps.
  4. Yeah, its my first time using filters so I tested removing some to see if that was the cause, I'll re-add them as clearly not. Will look at the conditional sleep - yet to use one but can see that SDN scripts require it so must be important. Do you have any examples of where it is used by any chance?
  5. Thats sorted it, cheers. My sleep wasn't long enough. Still happens every now and again though, no idea why. 5 second sleep should have sorted it tbf
  6. gargoyle = getNpcs().closest(n -> n.getName().equals("Gargoyle") && !n.isUnderAttack()); if ((!player.isMoving()) && (!player.isUnderAttack()) && (!player.isAnimating()) && (gargoyle != null) && (gargoyle.getHealthPercent() > 0) && (!gargoyle.isUnderAttack() && (!gargoyle.isHitBarVisible()))) { if(!gargoyle.isOnScreen()) { getCamera().toEntity(gargoyle); } gargoyle.interact("Attack"); } Sometimes, the script will find a target successfully and click it, but then after one attack (and the npc not attacking me back) it will switch to a new gargoyle. Does anyone know why/have any suggestions on how to fix this? I think its a result of player.isUnderAttack - obviously im not under attack(yet), but surely the player.isAnimating() call would fix it? Cheers.
  7. Sorry - the error is as follows: [INFO][Bot #1][06/28 02:07:27 PM]: scripts.ArdyKnightsHailzy.chatWorld(ArdyKnightsHailzy.java:206) [INFO][Bot #1][06/28 02:07:27 PM]: scripts.ArdyKnightsHailzy.hop(ArdyKnightsHailzy.java:218) [INFO][Bot #1][06/28 02:07:27 PM]: scripts.ArdyKnightsHailzy.thieve(ArdyKnightsHailzy.java:110) [INFO][Bot #1][06/28 02:07:27 PM]: scripts.ArdyKnightsHailzy.onLoop(ArdyKnightsHailzy.java:55) [INFO][Bot #1][06/28 02:07:27 PM]: org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(kl:223) [INFO][Bot #1][06/28 02:07:27 PM]: java.lang.Thread.run(Unknown Source) I found it largely unhelpful so thats why I didn't include it. Essentially what I'm trying to do is this: //get the chatbox containing the list of all users in clan and their worlds RS2Widget chatbox = widgets.get(589, 5); //get an array of people in the clan chat including their world RS2Widget[] people = chatbox.getChildWidgets(); I can't see why it doesn't work, as to my knowledge them ID's are correct. My only thought atm is that I need to move into the clan 'tab' before I call them lines, but I'm unsure of how to do that atm.
  8. Based on this thread: https://osbot.org/forum/topic/44402-chatworld-find-the-world-most-of-the-people-in-clan-chat-are-in/ I have tried to implement something similar private static int mode(List <Integer> list) { Map < Integer, Integer > map = new HashMap < Integer, Integer > (); for (int i = 0; i < list.size(); i++) { Integer frequency = map.get(list.get(i)); if (frequency == null) { map.put(list.get(i), 1); } else { map.put(list.get(i), frequency + 1); } } int mostCommonKey = -1; int maxValue = -1; for (Map.Entry < Integer, Integer > entry: map.entrySet()) { if (entry.getValue() > maxValue) { mostCommonKey = entry.getKey(); maxValue = entry.getValue(); } } return mostCommonKey; } public int chatWorld() throws InterruptedException { List < Integer > chatWorlds = new ArrayList <Integer> (); int hopWorld = -1; RS2Widget chatbox = widgets.get(589, 5); RS2Widget[] people = chatbox.getChildWidgets(); for (RS2Widget world: people) { if (world.getMessage().contains("World ")) { chatWorlds.add(Integer.parseInt(world.getMessage().replace("World ", ""))); } } hopWorld = mode(chatWorlds); return hopWorld; } I get an error at the line: RS2Widget[] people = chatbox.getChildWidgets(); Where am I going wrong? Basically all I want to do is get the most common world in the clan chat that I'm currently in. Thank you
  9. Bot isnt teleporting out the tunnel, I have the box checked, 1k casts in rune pouch and on arceus spellbook. Any help? @FrostBug edit- took the runes out the pouch and eveythings working fine.
  10. nvm had an error but for some reason letting the script get the stuff from the bank instead of me wearing it myself fixed it.
  11. Disputed Member:bigbadtroll Why it should be removed: i never even did a trade with this guy Details: never traded with him idk why he gave me bad feedback Link to topic: none
  12. they just start to fps drop and then die to zulrah and after regearing once or twice the script just stops, weird. even with 1 client on my CPU is at like 25% usage so obviously something must be wrong on my end, cheers
  13. both using fruity zulrah? i got i7 6700k and 16gb ddr4 ram which seems weird. I can easily run 5 nmz scripts but the zulrah one fucks me
×
×
  • Create New...