Jump to content

Leaderboard

Popular Content

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

  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. ────────────── 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
  3. 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
  4. 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
  5. Multiple Potion Support! Prayer βœ“ Restore βœ“ Overloads βœ“ Absorptions βœ“ Ability to set custom random higher/lower boundaries Ranging βœ“ Super and Normal Magic βœ“ Super and Normal Imbued Heart βœ“ Super Attack, Strength & Defence Potions βœ“ Special attack support βœ“ Custom Dream Settings βœ“ Ability to chose whether you want the character to re-enter a dream when it dies Ability to chose what position the player stands in Ability to set dream type Normal Hard Customisable - normal Customisable - hard Ability to chose a dream preset MTD Tree Gnome village Lost City Vampire Slayer Fight Arena Mountain Daughter Guthans Tree Gnome Village Lost City Vampire Slayer What Lies Below Haunted Mine Demon Tree Gnome Village Lost City Vampire Slayer Fight Arena The Grand Tree Custom The ability to set your own bosses in-game and the script will not change anything. Enable or Disable Power-Ups Zapper Recurrent Damage Power Surge Requires a Special weapon to be set within the GUI Magic Support βœ“ Select any β€˜Normal Spellbook’ combat spell to train with Rune pouch support Barrows Repairing! βœ“ Uses 'Lumbridge Home Teleport' to get to lumbridge, requires standard spell book. Uses the Minigames teleport to travel back to Nightmare Zone Recharging rechargeable! βœ“ Blowpipe Tome of Fire Purchase Your Daily Herb Boxes! Option to only purchase when you have over 'x' Points Option to either Bank or Open the Herb Boxes Rock Cake & Locator Orb Support βœ“ Ability to set chose if you want to pre-dream rock cake outside the dream Ability to chose at what HP value you start to rock cake Custom Idle Activities βœ“ Random Camera Movements Random Tab Changes Random Mouse Clicks Ability to have mouse exit the screen whilst idle Custom Prayer settings βœ“ Enable/Disable β€˜Boost Prayers’ Defence: Thick Skin Rock Skin Steel Skin Strength: Burst of Strength Superhuman Strength Ultimate Strength Attack Clarity of Thought Improved Reflexes Incredible Reflexes Ranged: Sharp Eye Hawk Eye Eagle Eye Rigour Magic Mystic Will Mystic Lore Mystic Might Augury Others Piety Chivalry Enable/Disable Protect Prayers Protect From Melee Protect From Magic Protect From Missiles Informative Script UI βœ“ Colour coded skills painted XP Gained Current XP/Hr Percentage till level Time till level Status display Customisable Stop/Break Handler βœ“ Ability to stop the script at the following benchmarks: Stop randomly between 'x' and 'x' minutes of runtime. Stop randomly between 'x' and 'x' dreams completed. End dream by idling Enable/disable logout on exit. Ability to use a custom made break handler. Break random every 'x' and 'x' dreams completed. CLI Support βœ“ -script "698:profile=Test hours_limit=10 dreams_limit=5" profile = saved profile name, if you've been using CLI to run the script, this will need to be updated to suit. hours_limit = Complete after 'x' run hours. dreams_limit = Complete after 'x' dreams completed Misc. Options βœ“ Hop worlds between dreams Leave dreams at maximum points Ability to save/load multiple custom presets This is not a thread for asking for trials, as a whole, i don't offer trials for my script. Instead if encourage you to ask all the questions you have before purchasing aο»Ώny of my (or anyones) script to be sure the script does exactly what you would like it too. Please note, 1 purchase of FruityNMZ is a lifetime auth for as many accounts as you can run On OSBot, we do not limit the amount of instances you can run with a single script! If you'd like to purchase FruityZulrah using OSRS GP, SEND ME A PM and i can give you my current $$:GP Rates! Discord Community: https://discord.gg/WzXRk2bWTV Trial bot has been implemented (100 post count required if you're not VIP/Sponsor!) @fruityscripts on Discord!
    1 point
  6. Before buying, please ensure you check-out with the correct script. Swapping scripts is not possible. View in store $4.99 for lifetime access Features: All spawns - Supports every multi-crab spawn point both along the south coast of Zeah and Crab Claw Isle All combat styles - Supports Ranged, Magic and Melee combat training. The script will not bank runes of any type Saving GUI - Intuitive, re-sizeable and fully tool tipped GUI (Graphical User Interface) allowing you to tailor the script session to your needs, with configuration saving / loading Human replication - Designed with human simulation in mind - multiple options to replicate human behaviour available in the GUI Setup customiser - Inventory customiser allows you to visually see your trip setup CLI support - The script can be started from the command line All potions - Supports all relevant potion types (including divine potions!), multiple potion types simultaneously and varying potion ratios Healing in a range - Dual slider allows you to specify a range within which to consume food. Exact eat percentages are calculated using a Gaussian distributed generator at run time Healing to full at the bank - When banking, the script will eat up to full hit points to extend trip times Safe breaking - Working alongside the OSBot break manager, the script will walk to safe place approximately two minutes before a break starts to ensure a successful log out Anti-crash - Smart crash detection supports multiple anti-crash modes (chosen in the GUI): Hop worlds if crashed - the script will walk to a safe place and hop worlds until it finds a free one, at which point it will resume training Force attack if crashed - the script will fight back and manually fight pre-spawned sand crabs until the crasher leaves Stop if crashed - the script will walk to a safe place and stop Ammo and Clue looting - Clue scroll and Ammo looting system based on a Gaussian-randomised timing scheme All ammo - Supports all OSRS ammo types and qualities Spec activation - Special attack support for the current weapon to maximise your exp per hour Auto-retaliate toggling - The script will toggle auto-retaliate on if you forget Move mouse outside screen - Option to move the mouse outside the screen while idle, simulating an AFK player switching tabs Refresh delay - Option to add a Gaussian-randomised delay before refreshing the chosen session location, simulating an AFK player's reaction delay Visual Paint and Logger - Optional movable self-generating Paint and Timeout Scrolling Logger show all the information you would need to know about the script and your progress Progress bars - Automatically generated exp progress bars track the combat skills that you are using Web walking - Utilises the OSBot Web alongside a custom local path network to navigate the area. This means the script can be started from anywhere! Safe banking - Custom banking system ensures the script will safely stop if you run out of any configured items Safe stopping - Safely and automatically stops when out of supplies, ammo or runes Dropping - Drops useless/accidentally looted items to prevent inventory and bank clutter All food - Supports pretty much every OSRS food known to man. Seriously - there's too many to list! ... and many more - if you haven't already, trial it! Things to consider before trying/buying: Mirror mode - currently there appear to be some inconsistencies with behaviour between Mirror mode and Stealth Injection meaning the script can behave or stop unexpectedly while running on Mirror. I would urge users to use the script with Stealth Injection to ensure a flawless experience! Since Stealth Injection is widely considered equally 'safe' to mirror mode and comes with a host of other benefits such as lower resource usage, this hopefully shouldn't be a problem. Using breaks - the script supports breaks and will walk to a safe place ready to log out approximately two minutes before a configured break starts. However, upon logging back in, your spot may no longer be open. If you configure the crash mode to be either 'Hop if crashed' (default) or 'Stop if crashed', this will not prove to be a problem. However if using 'Force attack if crashed', the script will attempt to take back the spot by crashing the occupying player and manually attacking spawned sand crabs. Be aware that players have a tendency to report anti-social behaviour such as this! Avoiding bans - while I have done my utmost to make the script move and behave naturally, bans do occasionally happen, albeit rarely. To minimise your chances of receiving a ban, I would strongly suggest reviewing this thread written by the lead content developer of OSBot. If you take on board the advice given in that thread and run sensible botting periods with generous breaks, you should be fine. That being said, please keep in mind that botting is against the Oldschool Runescape game rules, thus your account will never be completely safe and you use this software at your own risk. Setting the script up - I have done my best to make the GUI (Graphical User Interface) as intuitive as possible by making all options as self explanatory as I could, however if you are not sure as to what a particular setting does, you can hover over it for more information. If that doesn't help, just ask on this thread! Web-walking - alongside a network of paths, the script moves around with the OSBot web-walking system, using it when in unknown territory. While it has proven very reliable, there are naturally some areas for which the web-walker may struggle. As a result, prior to starting the script, I would highly recommend manually navigating your player close to the sand crabs bank, however in practice, anywhere on Zeah should be fine. Script trials: I believe that trying a script before buying is paramount. After trying the script, hopefully you will be convinced to get a copy for yourself, but if not you will have gained some precious combat experience! If you're interested in a trial, please follow the instructions on my trials thread which can be found here. Gallery: Start up GUI (Graphical User Interface): Paint (optional, movable and self-generating): User screenshots: Recent Testimonials: Starting from CLI: This script can be started from the command line interface. There is a single parameter, which can take two (and only two) values: 'gui' or 'nogui'. 'gui' will start the script and show the gui, 'nogui' will skip the GUI setup and start the script using your save file as the configuration. To start from CLI with 'nogui', the script requires a valid GUI save file to be present - if you haven't already, start the script manually and configure the GUI to suit your needs. Then hit 'Save configuration' and in future starting from CLI will use these configured settings. The script ID is 886. Example CLI startup: java -jar "osbot 2.4.137.jar" -login apaec:password -bot apaec@example.com:password:1234 -debug 5005 -script 886:nogui
    1 point
  7. My lunch break is over, gtg back to work. I’ll be back in a few hours.
    1 point
  8. 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
  9. GG banned we don't support making fun of disabled people in this community!
    1 point
  10. 1 point
  11. its still a gud lol
    1 point
  12. ima say about tree fiddy jk probably like 7-10m
    1 point
  13. Hi guys, both done! (: -Apa
    1 point
  14. 1 point
  15. 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
  16. 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
  17. 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
  18. @Theminis but his min order is 10
    1 point
  19. Only certain things will. This script was designed for injection
    1 point
  20. Great of you for sharing. First things first 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); final Area area4 = new Area(3474, 3491, 3480, 3500); final Area area3 = new Area(3485, 3498, 3493, 3505); final Area area1 = new Area(3508, 3491, 3504, 3498); final Area area2 = new Area(3496, 3503, 3504, 3507); final Area area = new Area(3473, 3461, 3513, 3508); area.setPlane(0); area7.setPlane(2); area6.setPlane(3); area5.setPlane(2); Move all of these outside of onLoop method. There's no need to reinitialize there variables on each loop iteration. Also can do this in one line final Area area = new Area(3473, 3461, 3513, 3508).setPlane(0); Also might want to ditch hardcoded object ids Entity gap1 = objects.closest(10820); Maybe replace with Positions or names Entity gap1 = objects.closest(f -> f.getName().equals("Gap") && f.getPosition().equals(GAP_POSITION)); Also, use conditional sleeps, this is bad if (area1.contains(myPlayer())) { if (!myPlayer().isMoving() & !myPlayer().isAnimating()) { gap1.interact("Jump"); sleep(random(2500, 3500)); } Can't remember the correct syntax, but this would be much better (sleep until you're in the other area) if (area1.contains(myPlayer())) { if (!myPlayer().isMoving() & !myPlayer().isAnimating()) { gap1.interact("Jump"); new ConditionalSleep(5000, 250) { public boolean condition() { return AREA_TO_GO_TO.contains(myPlayer()); } } }
    1 point
  21. 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
  22. 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
  23. 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
  24. @Fruity you're welcome ;)
    1 point
  25. Great will pay for it. Thanks!
    1 point
  26. https://osbot.org/forum/profile/290721-jacob/
    1 point
  27. a certain zully bot charges $30 a month per account So yeah definitely cheap asf
    1 point
  28. Holy shit are you a life saver!!!!!
    1 point
  29. 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
  30. With a culturally insensitive and demeaning name like that I'm surprised workers are not flooding to your door!
    1 point
  31. 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
  32. Alot of factors come into play when a ban is applied for botting, most common one being Time played. Ban rates are impossible to determine to an exact figure, But more to a group (low/medium/high) with red chins being a highly profitable method of gold farming ban rates will always fall into the medium/high category, but these factors will help: If your account is a long term account with multiple skills trained existing membership etc it will still be banned for botting but may just be delayed for a longer period of time while the jagex detection system monitors your behaviour. If your account is a level 3 with 88 hunter and has been playing 11 hours a day 7 days a week for the past 2 weeks then chances are it's going to be banned very soon, That being said i currently have a bot going that has 67 mage all other skills 1 and its been going for 9 hours a day (purposely been suicide botting) and it has yet to be banned but this is a different money maker compared to chins, Your best bet buddy is to lay low, refrain from botting more than a couple hours a day and remember to always switch it up, Maybe before you start your bot in the morning do a few quests, or mid bot session pause your script go to the G.E merch some stuff for an hour or so then continue, ALWAYS do what a normal player would on an average day of runescape never just one repetitive activity if you're trying to avoid bans. Gl bud try keep us updated if your account survives the week
    1 point
  33. I've posted this in the past, but huge shoutout to this script. If you're not sure if you want to buy it or not because you aren't sure of its security, I've been using this script since July of 2017, it's currently February 20th 2018 and I've received 0 permanent bans to date. If you bot correctly then this script is seemingly 100% safe
    1 point
  34. 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
  35. Can I try? You're actually dumb ~ my entire clan has full void from this script lmfao
    1 point
  36. 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
  37. 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
  38. tyty, im releasing my last batch of scripts before scripting retirement
    1 point
Γ—
Γ—
  • Create New...