Jump to content

Lol_marcus

Members
  • Posts

    193
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Lol_marcus

  1. No one can give me a PC on this?
  2. What would that go for? Consider all other stats irrelevant, just 99 smithing and 94 fishing. Thanks
  3. Feel free to modify as you wish. It fishes for sardines and herrings, if you want to make it fish shrimps just change the "Bait" part to "Net", and edit the string to "Fishing net". package osrs; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(name = "Draynor Village Fisher & Banker", author = "Marcus", version = 1.0, info = "Fishes and banks at Draynor", logo = "") public class Main extends Script { private final String[] TOOLS = {"Fishing rod", "Fishing bait"}; private Area fishArea = new Area(3084, 3234, 3088, 3224); @Override public void onStart() { log("Starting script..."); } @Override public int onLoop() throws InterruptedException { if (getInventory().isFull()) { walkToBank(); depositInventory(); } else { walkToSpot(); fish(); } return random(200, 300); } private void walkToBank() throws InterruptedException { log("Walking to bank..."); getWalking().webWalk(Banks.DRAYNOR); } private void depositInventory() throws InterruptedException { Bank bank = getBank(); Inventory inventory = getInventory(); log("Depositing inventory..."); if (Banks.DRAYNOR.contains(myPosition())) { bank.open(); Sleep.sleepUntil(() -> bank.isOpen(), random(500, 1000)); if (!inventory.contains(TOOLS) && !bank.contains(TOOLS)) { log("Tools not found in the bank. Stopping script..."); stop(false); } bank.depositAllExcept(TOOLS); Sleep.sleepUntil(() -> inventory.isEmptyExcept(TOOLS), random(500, 1000)); if (bank.contains(TOOLS) && !inventory.contains(TOOLS)) { bank.withdraw("Fishing rod", 1); bank.withdrawAll("Fishing bait"); Sleep.sleepUntil(() -> getInventory().contains(TOOLS), random(500, 1000)); } bank.close(); Sleep.sleepUntil(() -> !bank.isOpen(), random(500, 1000)); } } private void walkToSpot() throws InterruptedException { log("Walking to fishing spot..."); getWalking().webWalk(fishArea); } private void fish() throws InterruptedException { log("Fishing..."); NPC fishingSpot = getNpcs().closest("Fishing spot"); if (fishingSpot != null && fishingSpot.exists()) { fishingSpot.interact("Bait"); sleep(random(1500,2000)); getMouse().moveOutsideScreen(); Sleep.sleepUntil(() -> !myPlayer().isAnimating() || inventory.isFull(), random(90000, 120000)); } } }
  4. Hi all, I've missed writing osrs scripts, so I sat down today and came up with this little guy. In short, it will ask you to input whatever fish you want to cook through a simple GUI, and then it'll use the lumbridge cooking range (burns less fish) to drop all the fish, picking them up 1 by 1 to cook them at a 2-tick cycle. The only requirement is cooks assistant to be completed, and to have the level to cook whichever fish you input. I've pasted the full script, feel free to use it/leech it/customize it! I've left a lot of // commentary to help me remember what I was doing. I've been running it for about 2 hours now and it's run flawlessly, I've even added failsafes for when it picks up 2 fish by mistake, or a few other things that can go wrong. package osrs; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import javax.swing.*; import java.awt.*; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; @ScriptManifest(name = "Efficient 2-tick Cooker", author = "Marcus", version = 1.0, info = "A script that drops fish in order to 2-tick cook them", logo = "") public class Main extends Script { private String itemName; // Item to cook private Area dropArea = new Area(3211, 3215, 3211, 3215); // Area of itemName on the ground private long startTime; private int startingXP; private int currentXP; private int xpGained; long amountLeft; private final NumberFormat numberFormat = NumberFormat.getInstance(Locale.US); private final DecimalFormat decimalFormat = new DecimalFormat("#,###"); @Override public void onStart() { // Prompt user to input item name through a simple GUI itemName = JOptionPane.showInputDialog("Enter the item name to cook:"); startTime = System.currentTimeMillis(); startingXP = getSkills().getExperience(Skill.COOKING); xpGained = 0; getExperienceTracker().start(Skill.COOKING); } @Override public int onLoop() throws InterruptedException { GroundItem groundItem = getGroundItems().closest(itemName); if (getInventory().contains(itemName) && getInventory().getAmount(itemName) >= 2) { // If inventory is full, drop all items at the collection area if (dropArea.contains(myPosition())) { getInventory().dropAll(itemName); // Conditional sleep Sleep.sleepUntil(() -> getInventory().getAmount(itemName) == 1, random(500, 1000)); } else { getWalking().webWalk(dropArea); sleep(random(500, 1000)); // Sleep between 0.5-1 seconds } } else if (!getInventory().contains(itemName) && groundItem != null) { // If inventory is empty and item found on the ground, take 1 item groundItem.interact("Take"); // Conditional sleep Sleep.sleepUntil(() -> getInventory().contains(itemName), random(500, 1000)); } else if (getInventory().contains(itemName) && getInventory().getAmount(itemName) == 1) { getObjects().closest("Cooking range").interact("Cook"); // Conditional sleep Sleep.sleepUntil(() -> !getInventory().contains(itemName), random(500, 1000)); } else { // If no item on the ground and inventory is not full, walk to the collection area if (Banks.LUMBRIDGE_UPPER.contains(myPosition())) { getBank().open(); // Conditional sleep Sleep.sleepUntil(() -> getBank().isOpen(), random(500, 1000)); if (!getBank().contains(itemName)) { log("Item not found in the bank. Stopping script..."); stop(false); } getBank().depositAll(); // Conditional sleep Sleep.sleepUntil(() -> getInventory().isEmpty(), random(500, 1000)); if (getBank().contains(itemName)) { getBank().withdraw(itemName, 28); amountLeft = getBank().getAmount(itemName); // Conditional sleep Sleep.sleepUntil(() -> getInventory().contains(itemName) && getInventory().getAmount(itemName) == 28, random(500, 1000)); } getBank().close(); // Conditional sleep Sleep.sleepUntil(() -> !getBank().isOpen(), random(500, 1000)); } else { getWalking().webWalk(Banks.LUMBRIDGE_UPPER); sleep(random(500, 1000)); // Sleep between 0.5-1 seconds } } return 0; // Return 0 } @Override public void onExit() { log("Thank you for using Efficient 2-tick Cooker!"); } @Override public void onPaint(Graphics2D g) { currentXP = getSkills().getExperience(Skill.COOKING); xpGained = currentXP - startingXP; int xpHour = getExperienceTracker().getGainedXPPerHour(Skill.COOKING); Point mP = getMouse().getPosition(); g.drawLine(mP.x, 501, mP.x, 0); g.drawLine(0, mP.y, 764, mP.y); g.setColor(Color.white); // Paint background g.setColor(Color.BLACK); g.fillRect(5, 5, 200, 110); // Paint border g.setColor(Color.WHITE); g.drawRect(5, 5, 200, 110); // Paint text g.setColor(Color.WHITE); g.drawString("Efficient 2-tick Cooker", 15, 25); g.drawString("Time Running: " + formatTime(System.currentTimeMillis() - startTime), 15, 45); g.drawString("Total XP Gained: " + decimalFormat.format(xpGained), 15, 65); g.drawString("Total XP Per hour: " + decimalFormat.format(xpHour), 15, 85); g.drawString(itemName + " in Bank: " + numberFormat.format(amountLeft), 15, 105); } private String formatTime(long ms) { long seconds = ms / 1000; long minutes = seconds / 60; long hours = minutes / 60; minutes %= 60; seconds %= 60; return String.format("%02d:%02d:%02d", hours, minutes, seconds); } }
  5. Anyone ever try making a 1 tick prayer flick script for "infinite" prayer? If so, how did you guys go about making it?
  6. I'm plannig a 99 hp pure.. all 1 combats apart from HP wish me luck
  7. Nvm, just bought the script.
  8. 99 RCing, 73 agility, 70+ mining and crafting. All other stats negligable. What would this sell for?
  9. If it's not too much trouble, could I take a look at your lambda for filtering the text displayed inside the chatbox dialogue, and/or lambda for getting the npc to handle dialogue? The conditional sleep I have implemented.
  10. Found the error. It's sorted now.
  11. Hi guys, I've tried doing this without states and enums, and then thought that maybe it would be easier doing it with them. I'm trying to make an incremental alcher, basically what it does is it buys an X amount of a certain item, alches it, and then buys an X amount of another item. The reason is that I don't want to (nor can I afford on multiple accounts) to buy the limit of a lot of alches at one time, like rune items, etc. So the script should: if 0 alches for item 1 buy item 1 alch item 1 if X alches for item 1 is done buy item 2 alch item 2 if X alches for item 1 & 2 done buy item 3 alch item 3 Any guidance would be fantastic. Here's what I have, but I can't for the life of me get it to work: package core; import org.osbot.rs07.api.GrandExchange; import org.osbot.rs07.api.Magic; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.MagicSpell; import org.osbot.rs07.api.ui.Spells; import org.osbot.rs07.input.mouse.RectangleDestination; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.Condition; import org.osbot.rs07.utility.ConditionalSleep; import java.awt.*; @ScriptManifest(name = "Incremental Alcher", version = 1, author = "Marcus", logo = "", info = "Buys items in increments to high alch.") public class Main extends Script { private long startTime = System.currentTimeMillis(); int rune2h; int runepl8; int runelegs; @Override public void onStart() throws InterruptedException { rune2h = 0; runepl8 = 0; runelegs = 0; } private enum State { BUY_R2H, ALCH_R2H, BUY_RPL8, ALCH_RPL8, EXIT } private State getState() { if (rune2h == 0 && !getInventory().contains("Rune 2h Sword")) return State.BUY_R2H; if (rune2h == 0 && getInventory().contains("Rune 2h Sword")) return State.ALCH_R2H; if (rune2h == 2 && runepl8 == 0 && !getInventory().contains("Rune platebody")) return State.BUY_RPL8; if (rune2h == 2 && runepl8 == 0 && getInventory().contains("Rune platebody")) return State.ALCH_RPL8; return State.EXIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case BUY_R2H: buyRune2h(); break; case ALCH_R2H: alchR2h(); break; case BUY_RPL8: buyRunepl8(); break; case ALCH_RPL8: alchRpl8(); break; case EXIT: stop(false); break; } return 700; } public void buyRune2h() throws InterruptedException { NPC clerk = getNpcs().closest("Grand Exchange clerk"); if (clerk != null && clerk.isVisible()) { clerk.interact("Exchange"); Sleep.sleepUntil(() -> grandExchange.isOpen(), 5000); grandExchange.buyItem(1319, "Rune 2h", 38000, 2); Sleep.sleepUntil( () -> (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.FINISHED_BUY), 5000); grandExchange.collect(false); Sleep.sleepUntil(() -> (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.EMPTY), 5000); } } public void alchR2h() throws InterruptedException { while (getInventory().contains("Rune 2h Sword")) { if (!getPlayers().myPlayer().isAnimating()) { magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); Sleep.sleepUntil(() -> magic.isSpellSelected(), 5000); getInventory().interact("cast", "Rune 2h Sword"); rune2h =+ 1; } } } public void buyRunepl8() throws InterruptedException { NPC clerk = getNpcs().closest("Grand Exchange clerk"); if (clerk != null && clerk.isVisible()) { clerk.interact("Exchange"); Sleep.sleepUntil(() -> grandExchange.isOpen(), 5000); grandExchange.buyItem(1127, "Rune plate", 38500, 2); Sleep.sleepUntil( () -> (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.FINISHED_BUY), 5000); grandExchange.collect(false); Sleep.sleepUntil(() -> (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.EMPTY), 5000); } } public void alchRpl8() throws InterruptedException { if (getInventory().contains("Rune platebody")) { if (!getPlayers().myPlayer().isAnimating()) { magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); Sleep.sleepUntil(() -> magic.isSpellSelected(), 5000); getInventory().interact("cast", "Rune platebody"); runepl8 =+ 1; } } } @Override public void onPaint(Graphics2D g) { g.setColor(new Color(0, 0, 0, 155)); g.fillRect(5, 258, 200, 80); g.setColor(new Color(255, 255, 255)); g.drawRect(5, 258, 200, 80); super.onPaint(g); g.drawString("Essence Runner", 65, 275); g.drawString("Run time: " + String.valueOf(formatTime(System.currentTimeMillis() - startTime)), 15, 295); g.drawString("Rune 2h Alches: " + rune2h, 15, 305); g.drawString("Rune Platebody Alches: " + runepl8, 15, 320); } private String formatTime(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } }
  12. Did both and it seems to have stabilized. Thanks for that.
  13. As soon as it collects the chaos rune, it starts lagging and giving null point exception errors. I have NO idea why. Can anyone shed some light please? @Override public int onLoop() throws InterruptedException { GroundItem cRune = getGroundItems().closest("Chaos rune"); if (cRune.isVisible() && cRune != null) { cRune.interact("Take"); Sleep.sleepUntil(() -> !cRune.isVisible(), 1000); } else { getWorlds().hopToF2PWorld(); sleep(random(500, 1500)); } return 700; }
  14. That's awesome. Thanks for the snippet.
  15. Is it crashing at a specific time, or does it just randomly crash?
  16. Here you go. [SPOILER] package core; import java.awt.Graphics2D; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(name = "Jug Filler", version = 1.1, author = "Marcus", logo = "", info = "Fills jugs in falador") public class Main extends Script { private final Area waterPump = new Area(2949, 3382, 2950, 3383); private long startTime = System.currentTimeMillis(); @Override public void onStart() throws InterruptedException { } @Override public int onLoop() throws InterruptedException { if (hasJugs()) { walkPump(); if (hasPump()) { fillJugs(); } } else { if (!hasJugs()) ; { bank(); } } return 700; } public boolean hasJugs() { return (getInventory().contains("Jug") && (getInventory().isFull())); } public boolean hasPump() { RS2Object pump = getObjects().closest("Waterpump"); return (pump != null && pump.isVisible()); } private void bank() throws InterruptedException { if (!Banks.FALADOR_WEST.contains(myPosition())) { getWalking().webWalk(Banks.FALADOR_WEST); } else if (Banks.FALADOR_WEST != null && (!getBank().isOpen())) { getBank().open(); } else if (!getInventory().isEmptyExcept("Jug")) { getBank().depositAllExcept("Jug"); } else if (getBank().contains("Jug")) { getBank().withdrawAll("Jug"); sleep(random(50, 150)); getBank().close(); sleep(random(50, 150)); new ConditionalSleep(2000, 600) { @Override public boolean condition() { return ((!getBank().isOpen()) && (inventory.getAmount("Jug") == 28)); } }.sleep(); } else { stop(false); } } public void fillJugs() throws InterruptedException { RS2Object waterPump = getObjects().closest("Waterpump"); if ((!myPlayer().isAnimating()) && waterPump != null) { if (!getInventory().isItemSelected()) { getInventory().getItem("Jug").interact("Use"); sleep(random(100, 250)); waterPump.interact("Use"); sleep(random(100, 200)); getMouse().moveOutsideScreen(); sleep(random(1000, 1500)); } new ConditionalSleep(20000, 600) { @Override public boolean condition() { return ((!myPlayer().isAnimating()) && (waterPump != null)); } }.sleep(); } } private void walkPump() throws InterruptedException { if (getInventory().isFull() && getInventory().contains("Jug")) { getWalking().walk(waterPump); sleep(random(50, 105)); new ConditionalSleep(20000, 600) { @Override public boolean condition() { return (waterPump.contains(myPosition())); } }.sleep(); } else { stop(false); } } @Override public void onPaint(Graphics2D g) { super.onPaint(g); g.drawString("Jug Filler", 65, 255); g.drawString("Run time: " + String.valueOf(formatTime(System.currentTimeMillis() - startTime)), 15, 275); } private String formatTime(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } } [/SPOILER]
  17. Instructions unclear - bot is killing zulrah with addy halberd.
  18. Does worlds.hoptop2pworld not work in mirror mode? I ran it in injection and it was fine, but on mirror it just opens the tab and then stops.
  19. Ahh right, I see what I was doing wrong. Thanks guys.
  20. An account of mine had a quashed ban from 2 years ago, and got perm banned for running a money making script. It was members too.
  21. How would I go about logging on my paint how many items I have left in my bank? If I'm running multiple accounts it's good to know which account is about to run out of a certain item in it's bank. I've tried something like int itemsLeft = getBank.contains(item); g.drawString("Items left: " + itemsLeft); but that shows me the amounts left only when I have the bank open. If it's not opened it doesn't show anything.
  22. Nope. That's a feature for clients such as Runelite, Osbuddy, Konduit, etc. The vanilla OSRS client doesn't support that.
  23. Oops. The ID was 3, not 2. Thanks. ^^
×
×
  • Create New...