Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/21/18 in Posts

  1. Hey everyone and anyone that still remembers me, I recently gained access again to the email that my OSBot account was linked to and was able to recover the password. I just wanted to make a post saying hi and that i'll be around on here again. I doubt i'll do any paid scripting(or if I'd even be allowed to), but I've been botting on Lights Hope(private vanilla WoW server) and it made me want to come back and make some free open source community scripts. Over the last 2 or so years I've grown so much as a programmer, to the point where looking back at old code I've written is just cringey lol. Back when that whole "Other bot sites are hacking osbot users" fiasco was going on, I changed my password to something stupid long and complex(can't say I was in the most sober state of mind). I ended up forgetting that password, and when I tried to recover my account I found out the email I signed up with was some random throw away email. I recently got that email back and was able to recover the account on here. But yeah hi, I'll be posting/lurking on these forums again and just wanted to say what's up.
    4 points
  2. CzarScripts #1 Bots LATEST BOTS If you want a trial - just post below with the script name, you can choose multiple too. Requirements Hit 'like' on this thread
    3 points
  3. ────────────── PREMIUM SUITE ────────────── ─────────────── FREE / VIP+ ─────────────── ──────────────────────────────────────────────────────────── ⌠ Sand crabs - $4,99 | Rooftop Agility - $5,99 | AIO Smither - $4,99 | AIO Cooker - $3,99 | Unicow Killer - £3,99 | Chest Thiever - £2,99 | Rock crabs - $4,99 | Rune Sudoku - $9,99 ⌡ ⌠ AIO Herblore - FREE & OPEN-SOURCE | Auto Alcher - FREE | Den Cooker - FREE | Gilded Altar - FREE | AIO Miner - VIP+ ⌡ ──────────────────────────────────── What is a trial? A trial is a chance for you to give any of my scripts a test run. After following the instructions below, you will receive unrestricted access to the respective script for 24 hours starting when the trial is assigned. Your trial request will be processed when I log in. The trial lasts for 24 hours to cater for time zones, such that no matter when I start the trial, you should still get a chance to use the script. Rules: Only 1 trial per user per script. How to get a trial: 'Like' this thread AND the corresponding script thread using the button at the bottom right of the original post. Reply to this thread with the name of the script you would like a trial for. Your request will be processed as soon as I log in. If i'm taking a while, i'm probably asleep! Check back in the morning Once I process your request, you will have the script in your collection (just like any other SDN script) for 24 hours. Private scripts: Unfortunately I do not currently offer private scripts. ________________________________________ Thanks in advance and enjoy your trial! -Apaec.
    3 points
  4. Molly's Chaos Druids This script fights chaos druids in Taverly dungeon, Edgeville dungeon and Ardougne. Profits can easily exceed 200k p/h and 60k combat exp/ph, this is a great method for training low level accounts and pures. Buy HERE Like this post and then post on this thread requesting a 24hr trial. When I have given you a trial I will like your post so you will receive a notification letting you know you got a trial. Requirements - 46 Thieving for Ardougne -82 Thieving and a Lockpick for Yanille - 5 Agility for Taverly(recommended) - No other requirements! Though I do recommend combat stats of 20+ as a minimum Features: - Supports eating any food - Hopping out of bot worlds - Recovers from deaths(respawn point must be lumbridge), includes re-equipping items on death - Potion support - Automatically detects and withdraws/uses Falador teleport tabs if using Taverly dungeon - Automatically detects and withdraws/equips/uses glories if using Edgeville dungeon - Supports looting bag Setup: Start the script, fill out the GUI, and be in the general area of where you want to run the script. CLI setup: Proggies: In the works: Known bugs: Bug report form, this is a MUST for problems to be resolved quickly: Description of bug(where, what, when, why): Log: Your settings: Mirror mode: Y/N
    2 points
  5. around 10-15m you're better off doing 70/70/70 accounts as they're more in demand so people can instantly start DHin at NMZ. they also go for 25-30m
    2 points
  6. Want to buy with OSGP? Contact me on Discord! Detailed feature list: - Supports every altar - Supports every rune Air, Mind, Water, Earth, Fire, Body runes (Just walk back and forth) Fire runes (Ring of dueling to Castle wars) Mind runes (Ring of dueling to Castle wars + Mind altar teleport) Nature runes (Unnote at shop and walk to altar) Nature runes (Ring of dueling to Castle wars + Necklace of passage to Fairy ring) Nature runes (Ring of dueling to Castle wars + Ardougne cape to Fairy ring) Nature runes (Ring of dueling to Castle wars + Quest cape to Fairy ring) Nature runes (Ring of dueling to Castle wars + POH teleport to Fairy ring) Cosmic runes (Walks back and forth - Uses obstacles based on agility level) Cosmic runes (Ring of dueling to Castle wars + Necklace of passage to Fairy ring) Cosmic runes (Ring of dueling to Castle wars + Quest cape to Fairy ring) Law altar (Ring of dueling to Castle wars + Balloon method to Entrana) Astral altar (Teleports back to bank) Lava runes (Ring of dueling to Castle wars) Stream runes (Ring of dueling to Castle wars) Smoke runes (Ring of dueling to Castle wars) Mud runes (Walks back and forth in varrock) Mud runes (Digsite teleport) Blood runes (Arceuus) Blood runes (Ring of dueling to Castle wars + POH teleport to Fairy ring) (93 agility req) Soul runes (Arceuus) Wrath runes (Ring of dueling to Castle wars + Mythical cape ) - Pouches support - Menu invokes - Daeyalt essence support - Pouch repair - Energy/Stamina potions support - Food support - Combination rune support - Binding necklaces + Magic imbue - Abyss support (Edgeville / Ferox enclave banking) Death handler, will grab your stuff and continue (Abyss only) Abyssal bracelets/Ring of life support Pouches repair at zamorak mage - ZMI altar support Walks short unsafe path OR walks long safe path Quick prayer support Full bank mode (Add fillers so all runes get deposited, but not the pouches/Rune pouch) - Mining daeyalt essence - Master/Runners setup Setup a bunch of runners for your main account who stands at an altar Either play your main yourself or use the master mode Combination runes, magic imbue + binding necklaces available Runners can bring binding necklaces, talismans to the master Stamina potion support for runners Custom Breakmanager: - Setup Bot and break times - Randomize your break times - Stop script on certain conditions (Stop on first break, Stop after X amount of minutes, Stop when skill level is reached) - Worldhopping - Crucial part to botting in 2023! Script queueing: - Support queueing multiple script in a row - All Khal scripts support flawless transitions in between scripts - Start creating your acc in a few clicks from scratch to multiple 99's - Flawless CLI support - Learn more here: How to use CLI parameters: - Example Usage: -script 482:ScriptFile.BreakFile.DiscordFile SAVEFILE = Saved Filename BREAKFILE = Breakmanager Filename - SAVEFILE: Save file can be created in the GUI. Navigate to the tab you want to run and press "Save As CLI file". Please choose your filename wisely (No special characters) - BREAKFILE (Optional): Breakfile can also be create in the GUI, set the breaksettings you wish to use and press "Save new CLI BreakFile". Please choose your filename wisely (No special characters) - Final form (Note that with some bot managers you do not need to specify -script 482): -script 482:TaskList1.4515breaks (With breaks) -script 482:TaskList1.4515breaks.discord1 (With breaks & discord) -script 482:TaskList1..discord1 (NO breaks & discord) Proggies:
    1 point
  7. Want to buy with OSGP? Contact me on Discord! Detailed feature list: - Account builder mode to level your firemaking to level 50 or even higher. - Equips pyromancer gear option - Chopping and burning logs (base Option) - Relights brazier - Fletch option - Fix brazier option - Make potion and heal pyromancer when down option - Tons of food supported - Brazier swicthing when pyromancer is down - Advanced game settings to skip games, smart caluclate points, afk at certain points, ... - Bank or Open crates - Dragon axe special attack - Fletch at brazier option - Chop in safespot option - Worldhopping - CLI support for goldfarmers Custom Breakmanager: - Setup Bot and break times - Randomize your break times - Stop script on certain conditions (Stop on first break, Stop after X amount of minutes, Stop when skill level is reached) - Worldhopping - Crucial part to botting in 2023! Script queueing: - Support queueing multiple script in a row - All Khal scripts support flawless transitions in between scripts - Start creating your acc in a few clicks from scratch to multiple 99's - Flawless CLI support - Learn more here: How to use CLI parameters: - Example Usage: -script 909:ScriptFile.BreakFile.DiscordFile SAVEFILE = Saved Filename BREAKFILE = Breakmanager Filename - SAVEFILE: Save file can be created in the GUI. Navigate to the tab you want to run and press "Save As CLI file". Please choose your filename wisely (No special characters) - BREAKFILE (Optional): Breakfile can also be create in the GUI, set the breaksettings you wish to use and press "Save new CLI BreakFile". Please choose your filename wisely (No special characters) - Final form (Note that with some bot managers you do not need to specify -script 909): -script 909:TaskList1.4515breaks (With breaks) -script 909:TaskList1.4515breaks.discord1 (With breaks & discord) -script 909:TaskList1..discord1 (NO breaks & discord) Proggies:
    1 point
  8. My lunch break is over, gtg back to work. I’ll be back in a few hours.
    1 point
  9. Hey! im looking for a constant supplier of 60-60-60 accounts cheap if you want to make these for me then message me to discuss.
    1 point
  10. no worrys it's still going 380k+ xp gained in 1 hour 12 minutes
    1 point
  11. GG banned we don't support making fun of disabled people in this community!
    1 point
  12. 1 point
  13. its still a gud lol
    1 point
  14. ima say about tree fiddy jk probably like 7-10m
    1 point
  15. Bro it wouldnt align I tried my very best
    1 point
  16. Hi guys, both done! (: -Apa
    1 point
  17. 1 point
  18. Check what Apa said. 10/10 would agree. Anyway if you're still having trouble just throw me a pm with your current code and I'll help out
    1 point
  19. here is a snippet from my tzhaars script: private void lootTokkul() { if (getTokkul() != null) { long lastTokkul = getInventory().getAmount("Tokkul"); if (getTokkul().interact("Take")) { new ConditionalSleep(3000, 600) { @Override public boolean condition() throws InterruptedException { return getInventory().getAmount("Tokkul") > lastTokkul; } }.sleep(); } } } then just set getokkul to return true if there is a marks of grace on the floor and chance tokkul to Marks of grace
    1 point
  20. public class Main extends Script { private long timeStart; private String state = "Cannifis Rooftop Agility"; final Area area7 = new Area(3509, 3474, 3516, 3484); final Area area6 = new Area(3488, 3468, 3504, 3481); final Area area5 = new Area(3477, 3481, 3481, 3487); Add those here (class variables). You should get some compiler errors telling you what's wrong if it doesn't work
    1 point
  21. Only certain things will. This script was designed for injection
    1 point
  22. Now’s your chance @Fruity , increase the price of your script now that every 3rd person is getting on the zulrah botting trend. Not me tho, so keep your nmz script mint
    1 point
  23. he posted this a month and a half ago - i think you should stop trying to leech scripts off a dead post tbh. He clearly isn't making them anymore...
    1 point
  24. Hi Czar, Can i please trial your fletching script. Have purchased your magic script and it works wonderfully. Would really like to try this one out before purchasing. Cheers
    1 point
  25. recommendation setup for 1 def pure? saw some vids but you prob know more also frosty do you mind if i get 24hr trial to test on my 1def pure :0
    1 point
  26. @Fruity you're welcome ;)
    1 point
  27. Great will pay for it. Thanks!
    1 point
  28. Holy shit are you a life saver!!!!!
    1 point
  29. I've moved on to chins and I can confirm the mouse does move off screen for this part of hunter. Strange that it wasn't doing it for falconry, but nevertheless it's working fine now. And thanks, I'll definitely be popping by into it
    1 point
  30. You should really make a coal bag API as apposed to shoving it into a task node. That way, it's a little more maintainable and, if it proves flawless, it could perhaps make it into the official API to then be maintained by the developers and scriptwriters. Here's a 10 minute example of me taking what you wrote and scribbling out an API: import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.ui.Message; import org.osbot.rs07.api.ui.Message.MessageType; import org.osbot.rs07.listener.MessageListener; import org.osbot.rs07.script.API; import org.osbot.rs07.utility.ConditionalSleep; public class CoalBagAPI extends API implements MessageListener { /** * Maximum amount of coal that can be stored in the coal bag when the user is * not wearing a smithing cape. */ public static final int STORAGE_COUNT = 27; /** * Maximum amount of coal that can be stored in the coal bag when the user is * wearing a smithing cape. */ public static final int STORAGE_COUNT_SMITHING_CAPE = 36; /** * Smithing cape increases the size capacity of the coal bag. */ private boolean usingSmithingCape; /** * Keep a running tally of the amount of coal stored in the coal bag. */ private int storedCoalAmount; @Override public void initializeModule() { bot.addMessageListener(this); usingSmithingCape = equipment.contains("Smithing cape"); } @Override public void onMessage(Message messageObj) throws InterruptedException { String messageText = messageObj.getMessage(); /* Check whether message is from the game */ if (messageObj.getType().equals(MessageType.GAME)) { /* Check the message contents */ if (messageText != null) { switch (messageText) { /* Set counter to 0 */ case "Your coal bag is empty.": storedCoalAmount = 0; break; /* Set counter to max storage value */ case "Your coal bag is already full.": storedCoalAmount = (usingSmithingCape ? STORAGE_COUNT_SMITHING_CAPE : STORAGE_COUNT); break; } } } } public boolean isUsingSmithingCape() { return usingSmithingCape; } public void setUsingSmithingCape(boolean usingSmithingCape) { this.usingSmithingCape = usingSmithingCape; } public int getStoredCoalAmount() { return storedCoalAmount; } public void setStoredCoalAmount(int storedCoalAmount) { this.storedCoalAmount = storedCoalAmount; } public boolean isFull() { return usingSmithingCape ? storedCoalAmount == STORAGE_COUNT_SMITHING_CAPE : storedCoalAmount == STORAGE_COUNT; } public boolean isEmpty() { return storedCoalAmount == 0; } public int getRemainingSpace() { return usingSmithingCape ? (STORAGE_COUNT_SMITHING_CAPE - storedCoalAmount) : (STORAGE_COUNT - storedCoalAmount); } private int getCoalAmount() { return (int) inventory.getAmount("Coal"); } private Item getCoalBag() { return inventory.getItem("Coal bag"); } public boolean fill() throws InterruptedException { boolean successful = false; Item coalBag = getCoalBag(); int invCoalCount = getCoalAmount(); int remainingSpace = getRemainingSpace(); int amountToBeStored = 0; ConditionalSleep sleepUntilCoalAddedToBag = null; if (coalBag == null) { /* Don't bother returning true/false */ throw new InterruptedException("No coal bag found!"); } else if (invCoalCount > 0 && remainingSpace > 0) { /* Calculate the difference for when you store the coal */ amountToBeStored = (invCoalCount - remainingSpace); /* Try to fill the coal bag */ if (coalBag.interact("Fill")) { /* Sleep for 3.5 seconds (3500) */ sleepUntilCoalAddedToBag = new ConditionalSleep(3500) { @Override public boolean condition() throws InterruptedException { /* Wake up when the coal has been added */ return getCoalAmount() != invCoalCount; } }; /* It shouldn't take us 3.5 seconds to check whether the bag's been filled */ if (sleepUntilCoalAddedToBag.sleep()) { storedCoalAmount += amountToBeStored; successful = true; } } } return successful; } public boolean empty() throws InterruptedException { boolean successful = false; Item coalBag = getCoalBag(); int remainingSpace = inventory.getEmptySlotCount(); int amountToBeWithdrawn = 0; ConditionalSleep sleepUntilCoalRemovedFromBag = null; if (coalBag == null) { /* Don't bother returning true/false */ throw new InterruptedException("No coal bag found!"); } else if (storedCoalAmount > 0 && remainingSpace > 0) { /* Figure out how much inventory space we're about to lose */ amountToBeWithdrawn = Math.min(storedCoalAmount, remainingSpace); /* Try to fill the coal bag */ if (coalBag.interact("Empty")) { /* Sleep for 3.5 seconds (3500) */ sleepUntilCoalRemovedFromBag = new ConditionalSleep(3500) { @Override public boolean condition() throws InterruptedException { /* Wake up when the coal has been added */ return inventory.getEmptySlotCount() != remainingSpace; } }; /* It shouldn't take us 3.5 seconds to check whether the bag's been filled */ if (sleepUntilCoalRemovedFromBag.sleep()) { storedCoalAmount -= amountToBeWithdrawn; successful = true; } } } return successful; } /** * TODO ... * @return * @throws InterruptedException */ public boolean check() throws InterruptedException { return false; } }
    1 point
  31. With a culturally insensitive and demeaning name like that I'm surprised workers are not flooding to your door!
    1 point
  32. Holy crap that was quick. Looking forward to trying out many of your scripts and purchasing them. Pretty optimistic they'll be good from what I've seen, but just have to check to see if I am unfortunate enough to get banned haha. Thanks~
    1 point
  33. Czar, need you to fix a fault in the script. Everytime my bot goes to the bank to grab fresh supplies. As it walks back to the area to kill the Warriors, it gets stuck and is unable to click any of the warriors because of the position it is standing in. It makes it very obvious that it's a bot as it just stands in open space for a long time! Walking to fight pos: [x=3293, y=3169, z=0] That's what it says whilst it's stuck in the position after grabbing supplies
    1 point
  34. Can I try? You're actually dumb ~ my entire clan has full void from this script lmfao
    1 point
  35. Educating OSBot, one rant at a time EDIT: This tutorial is meant for people who already have some grasp on how to write a script. If you are completely new to scripting, this tutorial is not for you. The node method of making scripts is definitely by far one of the best methods out there, but it has so many flaws that make for bad programming practices. Imagine you're making a pickpocket script, you might have the following nodes: EatNode WalkToBankNode WalkFromBankNode BankingNode PickpocketNode Now, given how most node-based scripts work, it simply does a for loop on each node and runs the first node in the list that can be executed. So if we enter our nodes in like this PickpocketNode, BankingNode, WalkToBankNode, WalkFromBankNode, EatNode (EatNode being last, PickpocketNode being first) we have actually just have a big issue: eating is the lowest priority. The idea of nodes is to keep the logic for one thing self-contained within another, but if we enter in our EatNode last, we will need to check to make sure our health is high enough in PickpocketNode (to ensure we don't, you know, die). This means you either ship along some global statics (bad!!!!), a script settings object (good!!!) or just forget about it. Now, what if I could tell you that we can prioritise our nodes based on what happened last? Now we can say have our eat node a very high priority after we've walked to the bank (maybe we're in DMM and have 1 food left but low hp) and very high priority after we've pickpocketed something (because we may have just taken damage), but fairly low priority otherwise. We can constantly give our pickpocket node a high priority, and run our walk from bank node immediately after we've banked. This does a few things for us: We don't have static priority - this is great because we as humans don't have static priority for things either! We no longer rely on the order we put nodes in to our list, we only care about when they should be ran Now, the node system I propose isn't perfect, but it's a damn sight better and provides us a lot more legroom for upgrading in the future. Also, this will get you a lot more comfortable with some of Java's more advanced features, namely annotations which make every high level programmer cum immediately. The Goal: Make a flexible node system that has dynamic priority The Result: By the end of this, you will have a working node system with two example nodes (ImmediateNode and DefaultNode) which will show you how flexible the system is. Lazy Kids: Leave now. All code here has been screenshotted so you can't copy/paste it. Learn something or GTFO Step 1: How the Fuck Will We Do This? We need to decide how we're going to store things, and how things will be written in code. For this project, we need a manager of some sort that handles the sorting of nodes, we need something to handle priority, and we need to determine how we will denote prioritisation. For this, we will create a NodeManager class, a Priority enum, and we will cover prioritisation in step 2. What the fuck is this? This enumerated type is less of an enumerated type and more of a... well.. class. However, this "class" only has a set number of values! This means that we can only specify LOWEST, LOW, DEFAULT, HIGH, HIGHEST, IMMEDIATELY. If you want to be an absolute madman, you can add additional priorities in this file. Well, you lost me. I understand NONE of this. This is actually really simple! This class stores references to a list of NodeObjects (come to that later), our last executed node, as well as a "default" or empty node (which we will return when we can't execute anything else to avoid nasty nulls), and finally a Comparator. A comparator simply compares two objects. In this case, we want to compare the priority of two different nodes. We will also create an interface called Node. This looks nothing like my Node class! That's because this is an interface. In programming, an interface is meant to represent the barebones object (in simpler terms, an interface is a blueprint for an object). Read the big documentation comment at the top of it if you want to sneak in a Script instance. Step 2: Decide How to Manage Prioritisation Now, we need to create a way to determine the priority of our nodes. There are two real ways to do this: A second parameter in our NodeManager#addNode(Node node) method, which would have every dynamic priority attached. This could actually get very messy, so I'm not even going to explain it better. We can attach annotations to each Node class we write, which keeps the logic contained and doesn't clog up our methods with useless garbage. Step 2.1: What's an Annotation? In Java, we have these nice little things called "annotations", and they make programming in Java a whole lot nicer. Annotations are effectively little nuggets of code that annotate our methods, variables and classes. They're great because they bridge the gap between human-readable code & complicated data structures. We've actually come across annotations before, at least if you know what a ScriptManifest is. We're going to use annotations here and we're going to love it. Step 3: Write Annotations We're going to need two annotations here: a bog standard PrioritisedNode annotation, and a Condition annotation (I'm calling mine "After" in this implementation) Hey, I kinda get this! It's very simple, but is also very, very powerful. Holy fuck, this is similar! That's because it is. Step 4: Write a Node! We're going to write an "ImmediateNode". This node will have an IMMEDIATE priority, but after it is executed it will have a LOW priority (so that something else can execute!). Oh fuck, you lost me. Now, this is a normal node (written just like you'd normally write a node), except we've plugged in our annotations that we just made. The first annotation (PrioritisedNode), says that by default we have an IMMEDIATE priority. The second annotation (After) says that after we execute ImmediateNode (this node), its priority is set to LOW. Step 5: Write another Node! Oh, fuck! We can use this to write other nodes, too! We're now going to write a "DefaultNode". This node will always have the DEFAULT priority. Bitch, did you just gender your code? Damn straight I did. Notice how we omit the (priority = <something>) part in our annotation here? This is because we're using the default value we set earlier! We also set no After annotation, which means it will never have a different priority. Step 6: What do we do now??? Well now that we've complicated things, we're going to need to update our NodeManager class. We need to add a few more things: A NodeObject class, this will allow us to track these annotations and make them in to something a little more computable A getNextNode method, which will get the next possible node to execute. We'll start with the getNextNode method (within NodeManager). Why do we sort? Why do we loop? WHY? We call Collections#sort(List, Comparator) to sort the list based on our previous condition - the comparator we made earlier! This doesn't return anything, but instead modifies the list we pass through. We iterate because we also need to find nodes that we CAN execute, otherwise we may just be executing garbage we can't do. We also set our lastNode variable provided we find a node, so that we can properly calculate our priorities next run. Step 7: Objectify the Nodes We're going to create something called an inner class - this is a class that is special to another class, kinda like you are to your parents. We're going to insert an extra class statement at the very bottom of NodeManager (but not outside the last bracket!) - this keeps things cleaner, especially because we don't want to access this class outside the manager. ?????????????????? This is a bit more complicated to explain, so we're going to ignore the constructor. Instead, we'll focus on getPriority(NodeManager) - if the last node doesn't exist (it's null), we return our default priority. Otherwise, we return the priority given by our After annotation, but if that doesn't exist we return our default priority. Step 8: ??? Step 9: Profit! We have now created our node system! We can use it like so: And, hopefully, after all this hard work, we'll get this output in our logger box: Notice how, although we added DefaultNode first, it ran ImmediateNode first? And furthermore, even though ImmediateNode has a priority of IMMEDIATE, it doesn't get ran that second time? That's because of the After condition we put in that! Conclusion Nodes are great, but they aren't perfect. So I made them perfect. Use this in all kinds of scripts, and claim you wrote the code yourself. Be proud of yourself, you just actually read a tutorial in its entirety. Exercises (ie things I was too lazy to type up) Java does not allow two annotations of the same type to exist on a single object. This means one node can only have one priority change - how can we make one node have many priority changes? (Hint: make a third annotation whose only value is an array of After annotations, and iterate through them in NodeManager) Can you expand the code to do more things than just changing priority after one node executes?
    1 point
  36. why don't you just get the amount of coins in your inventory. Then get the price of the ore from RSbuddy, then * the price by amount of ores you want, then check to see if you have enough coins? Or you could do it the opposite way and calculate how many ores u can get with the amount of money you have. Make sure barsTobuy is getting the right value. It seems like it isn't. Debug it step by step to see what's going on. I cbf writing it all up normally so I hope you understand. getinv = getInventory etc... long coins = getinv().getamount("Coins"); get price of item oresToBuy = (int)coins/price of item; which would = the amount u can get, sum it down to an int to get that value. You can use this code to get the price of the item This code is from another user, you can find it somewhere ( I forgot where). public class PriceHandler { /** * The URL of the API endpoint. */ public static HashMap<Integer, Integer> cache = new HashMap<Integer, Integer>(); public static String getData(int itemID) { try { StringBuilder sb = new StringBuilder("https://api.rsbuddy.com/grandExchange?a=guidePrice&i="); sb.append(String.valueOf(itemID)); InputStream inputStream = new URL(sb.toString()).openStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String line; while ((line = bufferedReader.readLine()) != null) { if (line.contains("{")) { sb = new StringBuilder(line); //Remove { and } sb.deleteCharAt(0); //sb.deleteCharAt((line.length() - 1)); return sb.toString(); } } } catch (Exception e) { return e.getMessage(); } return null; } public static String[] parseData(String data) { ArrayList<String> holder = new ArrayList<String>(); String[] parts = data.split(","); //Now we have strings in format "x":y for (String s : parts) { s = s.replace("\"", ""); //Remove " - now in format x:y holder.add(s.split(":")[1]); //Extract y from format x:y } String[] ret = new String[holder.size()]; return holder.toArray(ret); } public static int getPrice(int itemID) { if (itemID == 995) return 1; if (cache.containsKey(itemID)) { return cache.get(itemID); } String[] data = parseData(getData(itemID)); int price = Integer.valueOf(data[0]); cache.put(itemID, price); return price; } }
    1 point
  37. tyty, im releasing my last batch of scripts before scripting retirement
    1 point
×
×
  • Create New...