Jump to content

Lol_marcus

Members
  • Posts

    193
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

1832 profile views

Lol_marcus's Achievements

Steel Poster

Steel Poster (4/10)

48

Reputation

  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?
×
×
  • Create New...