-
Posts
201 -
Joined
-
Last visited
-
Days Won
1 -
Feedback
0%
Everything posted by Lol_marcus
-
Lifetime VIP Giveaway WINNERS (ZOMBO + JUJU)
Lol_marcus replied to Maldesto's topic in Spam/Off Topic
*Spins and headbangs for good luck* -
Instructions unclear - bot is killing zulrah with addy halberd.
-
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.
-
Ahh right, I see what I was doing wrong. Thanks guys.
-
Effect of old expired/quashed macoring bans.
Lol_marcus replied to AdamantPlatebody's topic in Botting & Bans
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. -
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.
-
Nope. That's a feature for clients such as Runelite, Osbuddy, Konduit, etc. The vanilla OSRS client doesn't support that.
-
Oops. The ID was 3, not 2. Thanks. ^^
-
getEquipment().isWearingItem(EquipmentSlot.HAT, "Bronze med helm"); getEquipment().isWieldingWeapon("Bronze scimitar"); getEquipment().isWearingItem(EquipmentSlot.CHEST, "Bronze plateobody"); https://osbot.org/api/org/osbot/rs07/api/Equipment.html
-
Once it finishes the dialog with the wizard, it loops back to the bank and tries to get beads again. What am I doing wrong here? I've tried different variations and can't get it to stop once it sees the "Congratulations" message! package quests; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.*; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.utility.ConditionalSleep; public class ImpCatcher extends QuestObject { private Area wizardsTower; private Area[] area = { new Area(3103, 3162, 3105, 3164).setPlane(2), // wizards tower }; private String[] items = new String[] { "Red bead", "Black bead", "Yellow bead", "White bead" }; public ImpCatcher() { wizardsTower = area[0]; } @Override public int run() throws InterruptedException { if (!checkInventory()) { return 1; } switch (configs.get(808)) { case 0: startQuest(); break; case 1: if (completeQuest()) { log("Quest Complete!"); return 2; } case 2: log("Quest has already been completed!"); default: return 2; } return 1; } private boolean checkInventory() throws InterruptedException { boolean inventoryReady = getInventory().contains(items); if (!inventoryReady && !Banks.DRAYNOR.contains(myPosition())) { getWalking().webWalk(Banks.DRAYNOR); return false; } else if (!inventoryReady && Banks.DRAYNOR.contains(myPosition())) { openBank(); bankItems(); takeBankItems(); return true; } else { log("Inventory does not need to be banked!"); return true; } } private void openBank() throws InterruptedException { if (!getBank().isOpen()) { getBank().open(); log("Opening Bank..."); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep(); } else { log("Bank is already open!"); } } private void takeBankItems() { for (String item : items) { if (getBank().contains(item)) { log("Found item for quest: " + item); getBank().withdraw(item, 1); } } } private void bankItems() { if (getBank().depositAll()) { log("Deposited all items!"); } else { log("There was an issue depositing all items!"); } } private void walkToArea(Area area, String location) { log("Walking to: " + location); if (!area.contains(myPosition())) { getWalking().webWalk(area); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return area.contains(myPosition()); } }.sleep(); } else { log("Already in Area: " + location); } } private void startQuest() throws InterruptedException { RS2Widget widget = getWidgets().get(277, 1); // walk to the tower walkToArea(wizardsTower, "Wizard's tower"); talkToWizard(); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return widget != null && widget.isVisible(); } }.sleep(); } public boolean completeQuest() { RS2Widget widget = getWidgets().get(277, 1); return (widget != null && widget.isVisible()); } private void talkToWizard() throws InterruptedException { Entity wizard = npcs.closest("Wizard Mizgog"); if (wizard != null) { if (!getDialogues().inDialogue()) { log("Not talking to Mizgog. Starting conversation."); wizard.interact("Talk-to"); log("Sleeping until conversation starts!"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getDialogues().inDialogue(); } }.sleep(); } String[] options = new String[] { "Click here to continue", "Give me a quest please." }; if (getDialogues().completeDialogue(options)) { log("Dialogue complete successfully!"); } else { log("Dialogue failed!"); } log("Just spoke with Mizgog!"); } } }
-
Not sure if maybe something like this would work? //ignore the lack of format, it was fine in Eclipse, not sure why it messed up when I posted. ^^ private String[] pouches = new String[] { "Small pouch", "Medium pouch", "Large pouch", "Giant pouch" }; public void pouch() throws InterruptedException { for (String pouch : pouches) { if (!getInventory().contains(pouch); { getBank().withdraw(pouch, 1); } else if (getInventory().contains(pouch)){ if(pouch.hasAction("Fill")){ pouch.interact("Fill"); sleep(random(50, 500)); } new ConditionalSleep(1500, 20) { @Override public boolean condition() throws InterruptedException { return (pouch.hasAction("Empty")); } }.sleep(); } }
-
You could just check if it has the action to retrieve the bars, rather than get a change in ID. Just a suggestion. Even something as simple as: public void takeBars() throws InterruptedException { RS2Object dispencer = getObjects().closestThatContains("Bar dispenser"); if (dispencer != null); { if (dispencer.hasAction("Take bars")){ //don't remember the actual action name, let's pretend it's Take bars lol. dispencer.interact("Take bars"); sleep(random(50, 500)); } new ConditionalSleep(5000, 20) { @Override public boolean condition() throws InterruptedException { return (dispencer.hasAction("Take bars")); } }.sleep(); }
-
Features Makes any type of plank at the Woodcutting Guild How to use Download or compile the .jar file and add it to your C:\Users\*YOURUSERNAME*\OSBot\Scripts. IMPORTANT NOTICE Make sure you make the planks manually at least once. This enables the script to use the space bar to create the planks in the future. Source Code package core; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import utils.MouseTrail; import utils.ZoomControl; import java.awt.*; import javax.swing.JOptionPane; @ScriptManifest(name = "WC Guild Plank Maker", version = 1.1, author = "Marcus", logo = "", info = "Makes planks in the WC Guild") public class Main extends Script { private final Area bankPos = new Area(1593, 3476, 1591, 3478); private final Area operatorPos = new Area(1626, 3498, 1624, 3501); private MouseTrail trail = new MouseTrail(0, 255, 255, 2000, this); private long startTime = System.currentTimeMillis(); String userOptions[] = { "Logs", "Oak logs", "Teak logs", "Mahogany logs" }; String userChoice = "" + (String) JOptionPane.showInputDialog(null, "Choose a log type", "Log Selection Menu", JOptionPane.PLAIN_MESSAGE, null, userOptions, userOptions[1]); @Override public void onStart() throws InterruptedException { if (!ZoomControl.isInRange(getCamera().getScaleZ(), 500)) { ZoomControl.setZoom(getBot(), 350); } } @Override public int onLoop() throws InterruptedException { if (isReady()) { walkOperator(); if (hasOperator()) { tradeOperator(); if (chatExists()) { selectOption(); } } } else { if (!inventory.contains(userChoice)) { bank(); } } return 700; } public boolean isReady() { return (inventory.contains(userChoice) && (inventory.contains(userChoice) && inventory.isFull())); } public boolean hasOperator() { NPC operator = getNpcs().closest("Sawmill operator"); return (operator != null && operator.isVisible()); } public boolean chatExists() { RS2Widget chat = getWidgets().get(270, 17); return (chat != null && chat.isVisible()); } private void bank() throws InterruptedException { if (!bankPos.contains(myPosition())) { getWalking().webWalk(bankPos); } else if (bankPos.contains(myPosition()) && (!getBank().isOpen())) { getBank().open(); } else if (!getInventory().isEmptyExcept("Coins", userChoice)) { getBank().depositAllExcept("Coins", userChoice); } else if (getBank().contains("Coins", userChoice)) { getBank().withdrawAll("Coins"); sleep(random(2, 5)); getBank().withdrawAll(userChoice); sleep(random(2, 5)); getBank().close(); sleep(random(2, 5)); new ConditionalSleep(2000, 600) { @Override public boolean condition() { return (inventory.contains("Coins") && (inventory.contains(userChoice) && inventory.isFull())); } }.sleep(); } else { stop(false); } } public void selectOption() throws InterruptedException { RS2Widget chat = getWidgets().get(270, 17); if (chat != null && chat.isVisible()) { sleep(random(200, 700)); keyboard.typeString(" "); new ConditionalSleep(2000, 20) { @Override public boolean condition() { return (!inventory.contains(userChoice)); } }.sleep(); } } public void tradeOperator() throws InterruptedException { NPC operator = npcs.closest("Sawmill operator"); if (operator != null && operator.isVisible()) { operator.interact("Buy-plank"); new ConditionalSleep(2500, 20) { @Override public boolean condition() { return (chatExists()); } }.sleep(); } } private void walkOperator() throws InterruptedException { if (!operatorPos.contains(myPosition())) { getWalking().walk(operatorPos); sleep(random(50, 50)); } new ConditionalSleep(3000, 50) { @Override public boolean condition() { return (operatorPos.contains(myPosition())); } }.sleep(); } @Override public void onPaint(Graphics2D g) { g.setColor(new Color(0, 0, 0, 155)); g.fillRect(5, 238, 238, 99); g.setColor(new Color(255, 255, 255)); g.drawRect(5, 238, 238, 99); g.setFont(g.getFont().deriveFont(14.0f)); trail.paint(g); Point mP = getMouse().getPosition(); g.drawLine(mP.x, 501, mP.x, 0); g.drawLine(0, mP.y, 764, mP.y); super.onPaint(g); g.drawString("WC Guild Plank Maker", 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); } } PlankMaker.jar
-
Can anyone figure out the problem with this code?
Lol_marcus replied to Lol_marcus's topic in Scripting Help
It's not passing on the option to the rest of the script. I'm getting "userChoice is an invalid variable" if I try to do something like getBank().withdrawAll(userChoice); with the code that doesn't work. If I remove all the code to add my icon it works fine. The code itself works, it's just not passing the users choice for some odd reason. -
Basically, if I add an icon to the JOptionPane, it doesn't recognize my option anymore. If I leave it without an image, it does recognize the option. It's obviously something with the code, but what is it? O_O What it does is, I let the user select the type of log they want, and then perform an action based on that. Here's a snippet: Code that works @Override public void onStart() throws InterruptedException { String userOptions[] = { "Logs", "Oak logs", "Teak logs", "Mahogany logs" }; String userChoice = "" + (String) JOptionPane.showInputDialog(null, "Choose a log type", "Log Selection Menu", JOptionPane.PLAIN_MESSAGE, null, userOptions, userOptions[1]); } Code that doesn't work @Override public void onStart() throws InterruptedException { ImageIcon icon = null; try { icon = new ImageIcon(new URL( "https://vignette.wikia.nocookie.net/2007scape/images/6/65/Demon_butler_chathead.png/revision/latest?cb=20151103211007")); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } String userOptions[] = { "Logs", "Oak logs", "Teak logs", "Mahogany logs" }; String userChoice = "" + (String) JOptionPane.showInputDialog(null, "Choose a log type", "Log Selection Menu", JOptionPane.PLAIN_MESSAGE, icon, userOptions, userOptions[1]); }
-
I've updated the OP with a newer version I have.
-
I made a blast furnace pedal bot that drinks energy potions every 2-3 minutes. A whole inventory of 4 doses costs 14k gp and lasts around 20 minutes. It's only 6k agility xp per hour, but it's very AFK and low user input considering it's agility. I'll share it soon in the unofficial script section.
-
Use sleep(random) Ex. getDepositBox().open(); sleep(random(50,500); getDepositBox().deposit(#### 0); sleep(random(50, 500); getDepositBox().close(); sleep(random(50,500); or private final Area BANK_POS = new Area(X,Y,X,Y); private void bank() throws InterruptedException { if (BANK_POS != null && (!getDeposit().isOpen())) { getDeposit().open(); } else if (getInventory().isFull() { getDeposit().depositAll; } else if (getInventory().isEmpty() { getDeposit().close(); new ConditionalSleep(2000, 600) { @Override public boolean condition() { return ((!getDeposit().isOpen()) && (inventory.isEmpty()); } }.sleep(); } else { stop(false); } }
-
Lemme give that a go. I'll report back. It worked. Fancy that. ^^ Thanks. I wonder why settings. didn't work. o_O
-
Hi, Is there any reason why it's not sipping a pot when my run energy goes below 30%? Ignore the fact that I only have a 4 dose on there, I'll use an array later to add all doses later. public void drinkPots() throws InterruptedException { if (settings.getRunEnergy() < 30) { getInventory().interact("Drink", "Energy potion(4)"); sleep(random(50, 500)); } new ConditionalSleep(4000, 200) { @Override public boolean condition() { return (settings.getRunEnergy() > 90); } }.sleep(); }
-
I highly recommend these 2 videos, as well as the tutorials in the tutorial section by Apaec and Explv.
-
You don't need to use "Client." You can use "Inventory.isFull()" or "getInventory().isFull()". You can do something like this: private void drop() throws InterruptedException { if (getInventory().isFull()) { getInventory().dropAllExcept("Rune axe"); sleep(random(50, 105)); new ConditionalSleep(5000, 600) { @Override public boolean condition() { return (getInventory().isEmptyExcept("Rune axe")); } }.sleep(); } else { stop(false); } } Furthermore, when using Eclipse you can press "cntrl+space" and it'll give you all possible options for what you're trying. So if you type "getInven" and pres cntrl+space, it'll show "getInventory()", and after you type ".", it'll show everything like "getInventory.isFull" "getInventory.isEmpty", etc.
-
A simpler method would be to use: keyboard.typeString("2"); for 2 keyboard.typeString(" "); for space Another example: public void example() throws InterruptedException { if (//something) { keyboard.typeString("2"); new ConditionalSleep(200, 200) { @Override public boolean condition() { return //somethingelse; } }.sleep(); } } or if you want to use widgets: public void example2() throws InterruptedException { RS2Widget test= getWidgets().get(458, 1); if (test!= null && test.isVisible()) { keyboard.typeString("2"); new ConditionalSleep(200, 200) { @Override public boolean condition() { return (//something); } }.sleep(); } }
-
Would these scripts be suitable for being free on SDN?
Lol_marcus replied to Lol_marcus's topic in Community Discussion
Easy enough to make. How would the iron men come across nats? Is it something I could implement into the script or would it have to be separate?