Jump to content

Lol_marcus

Members
  • Posts

    201
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by Lol_marcus

  1. Hi I made this to train RCing in F2P; in short, you have 1 account that's the "master" account that sits at the air altar and waits for trades to come in, and the "slave" accounts run back and forth between the altar and the bank and trade pure essence to the master account. You choose this when you start the script (master or slave). It prompts you to put a username in, so it'll know to always trade the master account. I don't have it set up to trade accounts with a space in the name (it's fairly simple to do, I just never have usernames with spaces xD) so you'll have to change that yourself if you want to. Other than that, just start with the air tiara equipped and the script'll do the rest for you. It's a work in progress, but works fine at the moment!
  2. Depends what your end goal is. If you want an account to last ages and maybe even max, I would probably start with a few quests, get those annoying level 1-30 stats out of the way fairly quick.
  3. Lost a few accounts yesterday, but also have 2 accounts that have been going strong for nearly 5 months, over 50m xp gained between them. I start them after 7 pm UK time and run them for 6 hours until it's auto logged. Have been doing that daily for these last 5 months.
  4. Hi! In Alfred Grimhands Barcrawl, when he's looking for Zembo, I think the script is set to look for an NPC called "zAmbo" however the NPC is called "zEmbo". Other than that, worked flawlessly. (;
  5. Thank you, I appreciate that! Likely never, my motivation to play tends to come and go
  6. Hi! Today I remembered void armour was a thing, so I made this; it works well and as intended - around 350 points gained so far between testing and actually running. In a nutshell: it will cross the nearest gangplank (that way you can use it on any of the boat levels) it will wait until the game starts when the game starts, it will click between 14-18 tiles south (because the PC map's coords change constantly) it will stay around the void knight and kill any enemies within a specified radius it will constantly 1 tick prayer flick (so you never take too much damage and you always get boosts) rinse and repeat Feel free to use as-is, copyfor your own projects, or suggest improvements! @ScriptManifest(info = "", logo = "", name = "Pest Control", author = "Marcus", version = 1.0) public class pestControl extends Script { private InvokeHelper invokeHelper; private Position ATTACK_ZONE_POSITION; private boolean gameStarted = false; public void onStart() throws InterruptedException { super.onStart(); invokeHelper = new InvokeHelper(this); log("Bot Started!"); } @Override public int onLoop() { if (!isInGame()) { gameStarted = false; if (!isInBoat()) { crossGangplank(); } } else { if (!gameStarted) { setAttackZonePosition(); gameStarted = true; } if (shouldGoToAttackZone()) { goToAttackZone(); } else { attackNearbyNPC(); } } return random(200, 300); } @Override public void onGameTick() { super.onGameTick(); RS2Widget quickPrayerWidget = getQuickPrayerWidget(); if (quickPrayerWidget == null) { return; } if (getPrayer().isQuickPrayerActive()) { invokeHelper.invoke(quickPrayerWidget, 0); invokeHelper.invoke(quickPrayerWidget, 0); } else { invokeHelper.invoke(quickPrayerWidget, 0); } } private RS2Widget getQuickPrayerWidget() { return getWidgets().get(160, 19); } private boolean isInGame() { RS2Widget gameWidget = getWidgets().get(408, 5); return gameWidget != null && gameWidget.isVisible(); } private boolean isInBoat() { RS2Widget boatWidget = getWidgets().get(407, 4); return boatWidget != null && boatWidget.isVisible(); } private void crossGangplank() { RS2Object gangplank = getObjects().closest("Gangplank"); if (gangplank != null && gangplank.interact("Cross")) { Sleep.until(() -> isInBoat(), 5000); if (isInBoat()) { log("Waiting for the game to start..."); Sleep.until(() -> isInGame(), 5000); } } } private void setAttackZonePosition() { Position playerStartPosition = myPosition(); if (playerStartPosition != null) { ATTACK_ZONE_POSITION = new Position(playerStartPosition.getX(), playerStartPosition.getY() - (random(14,18)), 0); log("Attack zone position set to: " + ATTACK_ZONE_POSITION); } } private boolean shouldGoToAttackZone() { return ATTACK_ZONE_POSITION != null && myPlayer().getPosition().distance(ATTACK_ZONE_POSITION) > 7; } private void goToAttackZone() { if (!myPlayer().isAnimating() && !myPlayer().isMoving()) { log("Running to the attack zone at position: " + ATTACK_ZONE_POSITION); getWalking().walk(ATTACK_ZONE_POSITION); Sleep.until(() -> myPlayer().getPosition().distance(ATTACK_ZONE_POSITION) <= 7, 10000); } else { log("Player is moving..."); } } private void attackNearbyNPC() { NPC target = getNpcs().closest(npc -> npc != null && npc.exists() && npc.hasAction("Attack") && getMap().canReach(npc) && isNearAttackZone(npc) ); if (target != null) { log("Attacking NPC: " + target.getName()); if (invokeHelper.invoke(target, "Attack")) { Sleep.until(() -> myPlayer().isAnimating() || myPlayer().isUnderAttack(), 1000); } } else { log("No suitable NPC found."); } } private boolean isNearAttackZone(NPC npc) { return npc != null && ATTACK_ZONE_POSITION != null && ATTACK_ZONE_POSITION.distance(npc.getPosition()) < 7; } @Override public void onExit() { log("Bot Stopped!"); } }
  7. Hi, This script will mainly uses invokes and scatters vile ashes in f2p for upwards of 70k prayer XP/h. Enjoy!
  8. Hi, I've been meaning to write this for a while now and have always gotten carried away with other projects. To set up, just select your quick prayers, and the script will do the rest. It activates your quick prayers, then identifies the game's tick, and then double clicks in a loop every time the tick changes (I've left a random wait in the middle, feel free to remove or adjust if you'd like). Hope you enjoy!
  9. No one can give me a PC on this?
  10. What would that go for? Consider all other stats irrelevant, just 99 smithing and 94 fishing. Thanks
  11. 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)); } } }
  12. 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); } }
  13. Anyone ever try making a 1 tick prayer flick script for "infinite" prayer? If so, how did you guys go about making it?
  14. I'm plannig a 99 hp pure.. all 1 combats apart from HP wish me luck
  15. Nvm, just bought the script.
  16. 99 RCing, 73 agility, 70+ mining and crafting. All other stats negligable. What would this sell for?
  17. 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.
  18. Found the error. It's sorted now.
  19. 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); } }
  20. Did both and it seems to have stabilized. Thanks for that.
  21. 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; }
  22. That's awesome. Thanks for the snippet.
  23. Is it crashing at a specific time, or does it just randomly crash?
  24. 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]
×
×
  • Create New...