Jump to content

Search the Community

Showing results for tags 'scripthelp'.

  • 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 7 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. 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; } }
  3. I have read alot of other scripts and examples of how to loot before attacking again. I cannot understand this concept, could somebody explain me how to do this inside of my own code. This is my code for now: =============================================================================================== NPC npc = getNpcs().closest(o -> o.getName().equals("Cow") && o.getInteracting() == null && !o.isUnderAttack()); if (npc != null && npc.getName().equals("Cow") && npc.getHealthPercent() > 0 && npc.isAttackable() && npc.hasAction("Attack") && map.canReach(npc) && !npc.isUnderAttack()) { if (npc.equals(myPlayer().getInteracting())) { } else { npc.interact("Attack"); if (npc.interact("Attack")) { sleep(random(3500,5000)); } } } else { camera.toEntity(npc); npc = npcs.closest("Cow"); } ==================================================================================================
  4. I am new to scripting having troubles getting my script sent to my OsBot application. IntelliJ is sending the script to C:\Users\Me\OSBot\Scripts but this is not showing up on the OsBot application. Yes I have tried refreshing. Any feedback would be very helpful. ty
  5. This is the code that I'm using. My script is local. (the name is FishNetLooter) This is the path that it's set in CMD prompt gives me this error! So my question is, why cant it find the script and how do I make it load? I tried changing the name in the cmd file with the .jar extention but it still doesn't find the script. Any help would greatly be appreciated, thank you!
  6. 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.
  7. Hello Guys, Im working on a script that makes tuna potatoes from cooked ingredients in the bank It basically works like this: Inventory contains 9 Bowl, 9 Cooked sweetcorn, 9 Tuna and a Knife Combines items to 9 Corn and tuna Bank to get 9 Pat of butter and 9 Baked potato Combines items to get Potato with butter and after that makes the Tuna potatoes And leaves the inventory with 9 Bowl and 9 Tuna Potatoes But I can’t get the banking to work I’ve tried this: case BANK: if (!getBank().isOpen()) { getBank().open(); } else { // Inventory 9 Tuna and corn, 9 Pat of butter, 9 Baked Potato and 1 knife inventory ready for making Potato with butter and Tuna Potato. if (this.inventory.getAmount(new String[] { "Tuna and corn" }) == 9) { sleep(random(333, 666)); getBank().depositAllExcept(new String[] { "Knife", "Tuna and corn" }); sleep(random(300, 800)); getBank().withdraw("Pat of butter", 9); sleep(random(300, 800)); getBank().withdraw("Baked Potato", 9); sleep(random(300, 800)); if (this.inventory.getAmount(new String[] { "Pat of butter", "Baked Potato" }) == 18){ getBank().close(); sleep(random(300, 800)); return Main.random(300, 800); }} // Inventory 9 Bowl, 9 Tuna, 9 Cooked Sweedcorn and 1 knife start and finish of inventory. if (this.inventory.getAmount(new String[] { "Bowl" }) == 9) { sleep(random(333, 666)); getBank().depositAllExcept(new String[] { "Knife", "Bowl" }); sleep(random(300, 800)); getBank().withdraw("Tuna", 9); sleep(random(300, 800)); getBank().withdraw("Cooked Sweedcorn", 9); sleep(random(300, 800)); if (this.inventory.getAmount(new String[] { "Tuna", "Cooked Sweedcorn" }) == 18){ getBank().close(); sleep(random(300, 800)); return Main.random(300, 800); }} } break; Some help would be appreciated ;)
×
×
  • Create New...