Jump to content

Search the Community

Showing results for tags 'scripting'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • OSBot
    • News & Announcements
    • Community Discussion
    • Bot Manager
    • Support Section
    • Mirror Client VIP
    • Script Factory
  • Scripts
    • Official OSBot Scripts
    • Script Factory
    • Unofficial Scripts & Applications
    • Script Requests
  • Market
    • OSBot Official Voucher Shop
    • Currency
    • Accounts
    • Services
    • Other & Membership Codes
    • Disputes
  • Graphics
    • Graphics
  • Archive

Product Groups

  • Premium Scripts
    • Combat & Slayer
    • Money Making
    • Minigames
    • Others
    • Plugins
    • Agility
    • Mining & Smithing
    • Woodcutting & Firemaking
    • Fishing & Cooking
    • Fletching & Crafting
    • Farming & Herblore
    • Magic & Prayer
    • Hunter
    • Thieving
    • Construction
    • Runecrafting
  • Donations
  • OSBot Membership
  • Backup

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location:


Interests

Found 23 results

  1. I've been messing around with this for hours after i have done all this the script will not open in OSbot client i've had it open before when i was still in the process of making the better now im clueless i did add armour ealier but removed it... i need to readd this is more for testing and learing how to it will shows up in OSbot client scripts its listed in the C:\Users\username\OSBot\ScriptsOSbot/ but im lost atm and need sleep import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "DarkScuzz", info = "Green Dragon Killer", name = "GreenDragonKiller", version = 1.0, logo = "") class GreenDragonKiller extends Script { private boolean shouldBank = false; private static final Area GREEN_DRAGON_AREA = new Area(2974, 3618, 3029, 3650); private static final String ANTI_FIRE_POTION = "Anti-fire potion"; // Name of the anti-fire potion private static final String FOOD_NAME = "Lobster"; // Name of the food you want to eat private static int FOOD_AMOUNT = 10; // Change this to the desired amount of food @Override public int onLoop() { if (shouldBank) { // Implement banking logic here // You can use the closest bank or any preferred method bank(); } else { if (getSkills().getDynamic(Skill.HITPOINTS) < 10 || !hasFood()) { shouldBank = true; return 1000; // Delay before heading to the bank } // Activate the Protection from Melee prayer if (!isPrayerActive()) { activatePrayer(); } // Check for and use an anti-fire potion if (inventory.contains(ANTI_FIRE_POTION)) { inventory.interact("Drink", ANTI_FIRE_POTION); } // Equip gear and implement combat logic here // ... Combat logic ... // Eat food if health is low if (getSkills().getDynamic(Skill.HITPOINTS) < 10) { eatFood(); } } return random(1000, 2000); // Delay between loops in milliseconds } private void activatePrayer() { // Implement logic to activate the Protection from Melee prayer // For example, you can open the Prayer tab and click on the prayer you want to activate. // getTabs().open(Tab.PRAYER); // Perform a mouse click on the prayer icon. } private boolean isPrayerActive() { // Implement logic to check if the Protection from Melee prayer is active // You'll need to check the color of the prayer icon or its state on the interface return false; } private void eatFood() { // Implement logic to eat food from your inventory Inventory inventory = getInventory(); if (inventory.contains(FOOD_NAME) && FOOD_AMOUNT > 0) { inventory.interact("Eat", FOOD_NAME); FOOD_AMOUNT--; } } private boolean hasFood() { // Implement logic to check if you have enough food in your inventory Inventory inventory = getInventory(); return inventory.contains(FOOD_NAME) && FOOD_AMOUNT > 0; } private void bank() { // Implement banking logic here // You can use the closest bank or any preferred method } @Override public void onExit() { log("GreenDragonKiller stopped."); } }
  2. Hey guys, I decided I wanted to try to build a max main through botting. I built my own bot manager so I want to put it to the test. I've never truly had a main account as I alternated through some mid level accounts. I decided that I wanted to capture my progress here seeing a few other posts on the forum doing the same. Seeing others on the forums as well as lots of videos of people making max accounts from scratch I thought it might be an interesting journey to try! There are a few goals that I will set out to achieve throughout the life of the account (hopefully) . I’ll list them below: Skills: Attack: 40/90 Strength: 40/90 Defense: 40/90 Ranged: 1/80 Prayer: 1/80 Magic: 1/90 Runecrafting: 1/99 Healthpoints: 40/99 Crafting: 1/99 Mining: 1/99 Smithing: 1/99 Fishing: 1/99 Cooking: 1/99 Firemaking: 1/99 Woodcutting: 1/99 Agility: 1/99 Herblore: 1/99 Thieving: 1/99 Fletching: 1/99 Slayer: 1/60 Farming: 1/80 Construction: 1/99 Hunter: 1/80 These skills are subject to change as I look into the feasibility of certain ones, however most should stay similar if not the same though! Quests: I am going to try to complete all quests available on Stealth Quester. Any quests that may be essential for the account I will do by hand if necessary. Big Goals: Fire Cape Infernal Cape Feel free to stick around and watch my progress. All tips are welcome so feel free to comment below! I might make a discord server later on in the account's life where people can come by and see more proggies!
  3. The code compiles fine, however when attempting to run via OSBot, the script doesn't run. Any idea? FYI: The script is meant to identify combat details of a player upon typing '!stats' and then type out this information. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.Arrays; import org.osbot.Hi; import org.osbot.rs07.api.ui.Message; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.net.MalformedURLException; import java.util.ArrayList; @ScriptManifest(name = "Highscores", author = "OsBot", version = 1, logo = " ", info = "Highscores") public class Highscores extends Script { private final ArrayList<String> stats = new ArrayList<String>(); public Highscores(final String player) { getStats(player); } public void onMessage(Message message) throws InterruptedException { String text = message.getMessage().toLowerCase(); String username = message.getUsername().toLowerCase(); Highscores highscores = new Highscores(username); if(text.contains("!stats")) { log("---"); getKeyboard().typeString("Atk:" + highscores.getSkillLevel(Skill.ATTACK) + ",Str:" + highscores.getSkillLevel(Skill.STRENGTH) + ",Def:" + highscores.getSkillLevel(Skill.DEFENCE) + ",Range:" + highscores.getSkillLevel(Skill.RANGED) + ",Mage:" + highscores.getSkillLevel(Skill.MAGIC)); } } @Override public void onStart() { this.getBot().addMessageListener(this); } @Override public int onLoop() throws InterruptedException { return random(400,600); } public int getSkillLevel(final Skill skill) { int index = getSkillIndex(skill); String[] array = stats.get(index).split(","); return Integer.parseInt(array[1]); } public int getSkillExperience(final Skill skill) { int index = getSkillIndex(skill); String[] array = stats.get(index).split(","); return Integer.parseInt(array[2]); } private void getStats(final String player) { try { URL url = new URL("https://secure.runescape.com/m=hiscore_oldschool/index_lite.ws?player=" + player); URLConnection con = url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { stats.add(inputLine); } in.close(); } catch (MalformedURLException e) { // CATCH } catch (IOException e) { // CATCH } } private int getSkillIndex(final Skill skill) { return Arrays.asList(Skill.values()).indexOf(skill) + 1; } }
  4. Hi guys, When i make a jar of a script it's now showing up in the scripts folder maybe there is something wrong with the code and I don't see it. this is the code: package woodcutter; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; public class woodcutter extends Script { final String TREE_NAME = "Tree"; @ScriptManifest(info="test", logo = "", version = 0, author = "Lupy", name = "Woodcutter script") @Override public int onLoop() throws InterruptedException { if(! getInventory().isFull()) { //chop Entity tree = objects.closest(TREE_NAME); if(tree != null && tree.isVisible()) { tree.interact("Chop Down"); } else { camera.toEntity(tree); } } else { //bank } return 0; } //when script is started public void onStart() { } //when script is exited public void onExit() { } } thanks in advance
  5. Hello, I've been trying for an hour to cast a spell but I get this error, someone knows I'm doing wrong? I'm looking at the documentation of the API and I do not know what can be wrong
  6. So I created a script, exported it as a .jar to the scripts folder but it's not showing up in the script selector. I've deleted the folder and restarted OSBot several times, then exported the script again. Other scripts, ones from the SDN, are there. How can I make this local script appear?
  7. Hi I'm a software engineer and interested in writing OSRS BOT's, do you guys have any BOT idea's that i can help you with?
  8. I have a script with a working gui but can't figure out how to open the gui mid script and adjust parameters to do different stuff. Can someone help me?
  9. Hello everyone! I'm trying to figure out widgets, and eventually want to get the text of a widget from a dialogue. This is my code: RS2Widget chatWidget = getWidgets().get(231, 4); NPC npc = getNpcs().closest(Area, "Doomsayer"); if (npc!= null && npc.isVisible() && !dialogues.inDialogue()) { npc.interact("Talk-to"); new ConditionalSleep(10000,500) { @Override public boolean condition() throws InterruptedException { return dialogues.inDialogue(); } }.sleep(); log("Im in dialogue"); log("Waiting for widget to become visible"); new ConditionalSleep(10000,500) { @Override public boolean condition() throws InterruptedException { return chatWidget != null; } }.sleep(); if (chatWidget != null) { log("Widget exists"); } else { log("Widget doesn't exist"); } } My bot opens the dialogue which should make the widget visible, but it doesn't recognise the widget: https://imgur.com/a/h69uvPc Does anyone know whats going on? Thanks in advance! Mephisto
  10. Introduction Hi all. I'm new here, so I figured I'd give a bit of background about myself. I'm a software engineer by trade (graduated with a CS degree several years ago and work full-time as a software engineer) and used to play a ton of Runescape. In the past, I've tried to get into script development, but always got sidetracked and gave up without producing anything. This time, I'm hoping to see it through by setting some short and long term goals to keep me motivated. I have experience in Java, although it's been a few years since I've used it; however, the OSBot devs did a great job with the API so I don't think it'll be too long till I'm making progress. Short Term Goals Develop script that can do tutorial island (DONE) This should give me a lot of practice as it's doing a large variety of tasks In order to not jump into this entirely blind, I've been looking at some open source tutorial island scripts as well (shout out to @lisabe96's RQ Tutorial Island Completer) This may end up being trashed if the ban rate is too high, but either way the scripting experience will be valuable. Write script to mine clay (DONE - With caveat. See Week 1 updates for more info) Build infrastructure to facilitate combining scripts well, and combine tutorial island + clay miner (DONE) This will aid in the future as I hope to have bots complete prerequisites, and then automatically jump to gold farming once those are finished Build script to automatically mule F2P Fishing Script (V1 Done, still a WIP to improve it to a gold-farm ready script) 10 mill automatically farmed and muled MySQL Server for managing bots and facilitating communication between them (see update for 9/25 for more info) Long Term Goals Automatic account replacement as they're banned Alerts (via email, twitter, or text message) when something seems off Profit in the black (should be a relatively quick one to complete as I won't be paying too much on servers at the start) Communication between bots (so I don't end up with to many on the same world, or to alert others should something go wrong (e.g. JMod in a certain world) 100m profit Progress 9/18: 9/19: 9/22: 9/23 9/24 9/25 9/28
  11. If you've messed with OSBot's CLI, perhaps in creating a bot farm, you've probably messed with the -script CLI argument and using Script.getParameters() in your code. Or maybe you're just looking into automating your OSBot scripts; this guide will show you everything you need to know What are Script Parameters? Parameters are a single String sent to your script via the command line (shell) using the -script CLI argument. It is accessed using Script.getParameters, which may return null if no parameters were provided. You'll need to learn a little bit of String manipulation in Java in order to work with them effectively. Here's some basics to get you started: // To get multiple delimited parameters, use split: // (Warning: you cannot use the comma or pipe character!) String[] params = getParameters().split(";"); // To parse an integer or float from a String, use: int itemsToUse = Integer.parseInt(params[0]); float ratio = Float.parseFloat(params[1]); // Test string equality - use .equals() not == if (params[2].equals("foobar")) log("Foobar mode enabled"); Requirements In order to use -script you must: Provide your OSBot forum credentials via -login Specify an account to log in with via -bot. If your script logs in manually (i.e. you use -allow norandoms and/or disable the auto login random solver then implement your own login handler like Explv's LoginEvent) then you should provide dummy credentials here eg. -bot LOGIN:PASS:0000 Restrictions You cannot use a comma (,) or pipe (|) character within a script name or parameter at all. Doing so may cause various runtime errors like java.lang.NumberFormatException or java.lang.NullPointerException. Most shells have a length limit for commands. See the section below. Escaping Spaces, Double Quotes and Backslashes (with Example) If you are using either spaces ( ), double quotes (") or backslashes in your script name or parameters, you'll need to escape these, potentially twice: once for OSBot, and once for your shell. I'll give an example below for the a script named My "Test" Script with parameters My "Test" Parameters. The example content will be in blue and inserted content will be green. If your script name contains either spaces ( ), double quotes (") or backslashes (\): Insert a backslash (\) before all existing double quotes or backslashes. My \"Test\" Script Surround the whole thing with double quotes that are not escaped with a backslash. "My \"Test\" Script" Do the process above (1) for your script parameters if they contain spaces, double quotes, backslashes: "My \"Test\" Parameters" Combine the script name and parameters with a colon in the middle. "My \"Test\" Script":"My \"Test\" Parameters" This is the raw string to be passed via the command line. If you are using a shell utility or sub-process library that takes an array/list of CLI args, stop here! Such a utility or library should do the next escaping step for you. If you are writing your own .bat/.sh scripts manually, continue on. Before every double quote (") or backslash (\), insert another backslash. \"My \\\"Test\\\" Script\":\"My \\\"Test\\\" Parameters\" Surround the entire thing with double quotes again. "\"My \\\"Test\\\" Script\":\"My \\\"Test\\\" Parameters\"" You're done! Yes, it's ugly, but it should work! Put the result directly after -script in your shell and you're good to go. Here's a combined example: java -jar OSBot.jar -login username:password -bot login:password:bankpin -script "\"My \\\"Test\\\" Script\":\"My \\\"Test\\\" Parameters\"" Once again, this runs a script with the following ScriptManifest name My "Test" Script: @ScriptManifest(name = "My \"Test\" Script", ...) public class MyTestScript extends Script { // .. } Using Files Instead of Script Parameters Sometimes shells can have surprisingly low limits on command length. If you expect your script input to be long (such as JSON, CSV or XML), you should be loading these from file instead instead of stuffing them in script parameters! These data formats may also contain incompatible characters (comma and pipe). Here's a few short examples to get you started (this isn't a guide on reading text from files in Java...) String filePath = getDirectoryData() + File.separator + getParameters(); File fp = new File(filePath); BufferedReader in = new BufferedReader(new FileReader(fp)); String line; while ((line = in.readLine()) != null) { // Process one line of input. } in.close(); If you want the entire file contents read into a string, you can use Files.readAllBytes and Paths.get: String filePath = getDirectoryData() + File.separator + getParameters(); String fileContent = new String(Files.readAllBytes(Paths.get(filePath))); Finally, using files has an added benefit of being able to provide default input data when script parameters aren't available (ie. the script was run via the Script Selector window): String filePath = getDirectoryData() + File.separator + (getParameters() != null ? getParameters() : "myDefaultInput.txt")); // Use the filePath as above And as usual, catch FileNotFound and other IOExceptions as necessary. Using files is a much better way to load in data than a lengthy script parameter! Additional Tips If you're having trouble escaping things properly, perhaps it's better to question if including the escaped content is even necessary at all. In other words, if it's easier to not name scripts using spaces, quotes or backslashes, then do that instead of escaping. Simplicity is better than being smart. For a good user experience, provide sensible defaults if parameters aren't provided. If your script requires input and can't come up with defaults, try using the Java Swing framework to show a UI (see Explv's AIO if you need an example). DON'T USE COMMAS (,) OR PIPE CHARACTERS (|) AS DELIMITERS. They aren't allowed and will break OSBot! If you need to delimit a parameter string, try a healthy low-carb alternative of a semicolon.
  12. Hi, I know this topic has been discussed many times but I still have my doubts, I hope someone can help me. Until a little over 1 month ago I installed an autoclicker and used it in my main account (all the risks that entails) without any shame, this autoclicker as normal allows me to record routines and run them, so I made one for the lunar spell superglass make that performed the spell and kept the molten glass, after doing 5 times collected the leftovers from the ground, to date I left it running all day and I could even sell my gold so I have several doubts. Autoclickers have lower ban rate? and if so, what is different from a script? I would like to have several accounts doing the same routine but the biggest drawback is that I can only have one autoclicker per pc, so I would like to make a script but I'm not sure if it is as "effective" as the autoclicker, I see no sense that such an obvious routine has lasted so long, the progress of the account I imagine does not influence much.
  13. if (myArea.contains(myPlayer())) { log("You are in the right area!"); } else { getWalking().walk(myArea); } IntelliJ is giving me and 'unreachable' error when located inside of the onLoop() and a bunch more outside in my Script class.
  14. Hello everyone; I've been helping a few people out on Discord with their scripts and understanding the API and I've come to the conclusion that I'm just going to make my own video series covering everything you need to know to get a script up and running in OSBot. Each episode will be streamed on YouTube, then edited down to only the essential information, uploaded as a video and embedded into this page under its heading. The main topics will be listed below. People comment additional topic ideas at the bottom of this thread or you can PM / Discord me. Legend: Not aired Airing now Aired Topics: Getting setup: Beginner scripting: Intermediate scripting: Advanced scripting: Other: All videos / streams can be viewed on: YouTube
  15. Hello! I'm an newbie working on some beginner scripts, but I've hit a problem I can't solve, or find any help with. I've combined two very helpful scripts from some astounding gentlemen to make a custom login handler with improved typing (I'm sure you know the two), but I'd like to be able to log in, even with username already entered. Currently, it works perfectly if the username is not saved, but if there is one entered, then it just breaks. If I could add a step to check if username field text is == to the saved username(the one to be entered), then just proceed to password step. But I don't know how to do this, and all of the debugging options don't seem to help. Sorry if this has been asked already, I did a bit of googling and couldn't find an answer, this is the first time this has happened. Cheers!
  16. Okay so, not 100% sure this is the right place to post this, but im trying to (key word trying) get my foot in the door scripting. Ive skimmed through and watched a couple tutorials for basic stuff, but im looking for an idea for a basic probably single task (likely without a GUI for now) script that isnt already covered by like a half dozen other free/nooby scripts. Because maybe then i'll be more motivated to get it running and/or keep up with it. So any ideas are Welcome. Also, heads up, like 99& chance i wont get anything suggested her up and running anytime soon. Sooooo, just wanting to set the expectations low. lol.
  17. first while works but second while does not. please help i know this is easy for some of you. Also want it to loop constantly.
  18. Hey guys anyone knows a good site that allows you to get price data using itemid i tried osbuddy api seems to be down 24/7 tho so kinda useless thanks!
  19. Hello! I'm trying to write my first combat script, but I can't figure out how to make it eat food + it has to be below a certain health percentage. I only have some expierence with HTML5,CSS and Python so I'm trying to learn Java as I go. This is my code so far: https://pastebin.com/TcGbX2Hw All critique and tips are welcome! Edit: I'm currently reading up on Enum states, is it better to use? And how do I define all states like: BANKING, EATING etc.?
  20. I can't figure out why this is always returning false... private boolean atBankPosition() { Position pos = new Position(3185, 3444, 0); if (myPosition() == pos) return true; else return false; } Any help?
  21. My Scripting Journey [ A Little About Me ] Hello, I have been part of the botting community since 2010 or so but I have always been that never post, just register and use the bots person. I am currently in college for Computer Networking and in my second semester out of 6. I have finished Police Foundations in college and currently work part time with school. My days are pretty packed between school, work and my fiance so this journey might take me some time as I believe I am starting from scratch (been learning Javascript in school but I have been told its totally different then Java). I am 23 and hopefully looking forward to be able to find a successful career job once I finish this course (connected to my Police Foundation course). [ Goals & Achievements ] I basically want to start off by learning Java from scratch (Codeacademy, books, Java tutorials) and the end goal is be able to have my own full farm running on its own by my own scripts and by my own hands. I will start off small and try to make a couple simple and non complex scripts (woodcutting, firemaking) and go from there. I have no doubt there will be failures, disappointments and just being plain unlucky throughout this but I do have an end goal that I plan on reaching. If anyone has any other tutorials, lessons that would help me for Scripting that would be great, I do plan on doing research on a term I have seen on other topics called CLI? [ Updates ] I will be updating this WEEKLY so expect an update on the weekends sometime if you care at all If you stick around I hope you enjoy this journey and maybe even join me on it! Week 1
  22. I can't seem to figure out which widget contains the options for smithing bars. When I look through the widgets each widget's tooltip seems to be one of the options. I would prefer to work with widgets in this context as opposed to MouseDestinations. Anybody worked with this before?
  23. Does Anyone know if you can insert a GIF in your scripts? So like rather than an icon that shows up while your bots are running, it will show a gif? Thanks! -Targon
×
×
  • Create New...