Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • jmarsiglio2

    Banned
    • Posts

      8
    • Joined

    • Last visited

    Profile Information

    • Gender
      Not Telling

    Recent Profile Visitors

    1429 profile views

    jmarsiglio2's Achievements

    1. I'm not sure how to do that haha My RockCrab script can go on the SDN but this one still needs a couple of changes until it's ready
    2. Hey, I made a VERY specific script for myself to make Camelot tele tabs. It's rudimentary so far but if people use it I can flesh it out. - You will need to modify the hostName variable with the name of whoever is hosting the house - Your house needs to be in Rimmington - You need to start in the host house - You will need an air staff equipped and law runes in your inventory - You will need VARROCK and HOUSE TELEPORT TABS in your inventory (to teleport back and forth) If people use this I can make it so this can be configured at runtime and support other teleport methods. Cheers MainClass.java package MageTabs; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.methods.widget.Widget; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.InventoryMonitor; import org.dreambot.api.utilities.Timer; import org.dreambot.api.wrappers.interactive.GameObject; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.items.Item; import org.dreambot.api.wrappers.widgets.WidgetChild; import java.awt.*; import java.util.HashMap; @ScriptManifest(category = Category.MAGIC, name = "Mage tabs", author = "JM", version = 1.0) public class MainClass extends AbstractScript { private Area rimmingtonPortal = new Area(2950, 3227, 2955, 3222, 0); private Area varrockSquare = new Area(3208, 3426, 3219, 3422, 0); private Area varrockBank = new Area(3179, 3432, 3191, 3450, 0); private Area outsideVarrockBank = new Area(3184, 3434, 3180, 3436, 0); private Tile lecternTile; // learns the tile of the lectern private String bankKeep[] = {"Varrock teleport", "Teleport to house", "Air rune", "Law rune", "Fire rune"}; private String state = "null"; private String hostName = "name_of_host"; private HashMap<String, Integer> widgetIDs = new HashMap<>(); private String tabType = "Camelot"; private final int TAB_WIDGET_ID = 79; private int tabCount = 0; private int lastTabCount = 0; private Timer timer; private InventoryMonitor monitor; @Override public void onStart(){ log("Starting MageTabs"); state = "started"; widgetIDs.put("Varrock", 11); widgetIDs.put("Camelot", 14); getWalking().setRunThreshold(Calculations.random(20, 70)); lastTabCount = getInventory().count(tabType + " teleport"); timer = new Timer(); monitor = new InventoryMonitor(this); getSkillTracker().start(Skill.MAGIC); } private boolean openBank() { int i = Calculations.random(2); if (i == 0) { return getBank().open(); } else { NPC banker = getNpcs().closest((npc) -> npc != null && npc.hasAction("Bank")); if (banker != null) { sleep(500, 1500); return banker.interact("Bank"); } return false; } } private boolean doBank() { openBank(); if (sleepUntil(() -> getBank().isOpen(), 3000)) { if (getBank().isOpen()) { if (getBank().depositAllExcept(bankKeep)) { if (sleepUntil(() -> getInventory().onlyContains(bankKeep), 3000)) { if (getBank().withdrawAll("Soft clay")) { sleepUntil(() -> getInventory().isFull(), 3000); if (getInventory().isFull() && getBank().close()) { return sleepUntil(() -> !getBank().isOpen(), 3000); } } } } } } return false; } private boolean bank() { if (outsideVarrockBank.contains(getLocalPlayer())) { log("doing banking"); return doBank(); } else { log("walking to bank"); getWalking().walk(outsideVarrockBank.getRandomTile()); sleep(1500, 3500); return bank(); } } private boolean insideBank() { return varrockBank.contains(getLocalPlayer()); } private boolean insideVarrock() { return varrockSquare.contains(getLocalPlayer()); } private boolean teleportToHouse() { log("teleporting to house"); if (getInventory().interact("Teleport to house", "Break")) { if (sleepUntil(() -> !insideBank(), 10000)) { log("teleported successfully"); return true; } } return false; } private boolean takePlayerPortal() { sleepUntil(() -> getGameObjects().closest("Portal") != null, 5000); GameObject portal = getGameObjects().closest("Portal"); if (portal != null) { if (portal.interact("Enter")) { return true; } else { log("failed to interact with portal"); } } else { log("couldn't find the portal :("); } return false; } private boolean teleportToHost() { log("teleporting to host"); sleepUntil(() -> rimmingtonPortal.contains(getLocalPlayer()), 3000); if (rimmingtonPortal.contains(getLocalPlayer())) { sleepUntil(() -> getGameObjects().closest("Portal") != null, 5000); GameObject portal = getGameObjects().closest("Portal"); if (portal != null) { if (portal.interact("Enter")) { if (sleepUntil(() -> getDialogues().getOptionIndex("Go to a friend's house") == 3, 5000)) { if (getDialogues().chooseOption(3)) { // enter a friend's house sleep(1500, 2500); getKeyboard().type(hostName); sleepUntil(() -> !(rimmingtonPortal.contains(getLocalPlayer())), 10000); if (rimmingtonPortal.contains(getLocalPlayer())) { log("Couldn't join host's house. Try a different hose"); this.stop(); } else { return true; } } } } } else { log("no portal found"); } } else { log("not at Rimmington portal"); } return false; } private boolean backToHost() { if (teleportToHouse()) { if (takePlayerPortal()) { return teleportToHost(); } } return false; } private boolean teleportToVarrock() { log("teleporting to varrock"); if (getInventory().interact("Varrock teleport", "Break")) { return sleepUntil(() -> insideVarrock(), 10000); } return false; } private Widget getWidget(int i) { Widget tabWidget = getWidgets().getWidget(i); if (tabWidget != null) { if (tabWidget.isVisible()) { return tabWidget; } } return null; } private WidgetChild getWidgetChild(Widget parent, int child) { WidgetChild c = parent.getChild(child); if (c != null) { if (c.isVisible()) { return c; } } return null; } private void saveLecternTile() { log("saving lectern tile"); lecternTile = getLocalPlayer().getTile(); } private boolean lecternInteract(GameObject lectern) { if (lectern.interact("Study")) { sleepUntil(() -> getWidget(TAB_WIDGET_ID) != null, 10000); Widget tabs = getWidget(TAB_WIDGET_ID); if (tabs != null) { sleepUntil(() -> getWidgetChild(tabs, widgetIDs.get(tabType)) != null, 10000); WidgetChild tab = getWidgetChild(tabs, widgetIDs.get(tabType)); if (tab != null) { return tab.interact("Make-All"); } } } return false; } private boolean doTabbing() { if (getLocalPlayer().getAnimation() != -1) { return true; } else { log("Sleeping for animation"); sleep(800); // potentially in the middle of the animation if (getLocalPlayer().getAnimation() != -1) { return true; } } if (lecternTile != null) { // lectern has been used before if (lecternTile.distance() < 5) { GameObject lectern = getGameObjects().closest("Lectern"); return lecternInteract(lectern); } else { getWalking().walk(lecternTile); sleep(500, 1000); } return false; } else { GameObject lectern = getGameObjects().closest("Lectern"); if (lectern != null) { if (lectern.distance() < 3) { saveLecternTile(); return lecternInteract(lectern); } else { getWalking().walk(lectern); sleep(500, 1000); } } else { log("Couldn't find a lectern!"); } return false; } } private boolean hasClay() { return getInventory().count("Soft clay") > 0; } private void setRunThreshold() { if (getWalking().getRunEnergy() == 0) { getWalking().setRunThreshold(Calculations.random(20, 70)); } } private void checkRequirements() { if ( (getInventory().count("Law rune") < 28) || (getInventory().count("Varrock teleport") < 2) || (getInventory().count("Teleport to house") < 2)) { log("Stopping because you do not have enough law runes or tabs"); this.stop(); } } private void listenInventory() { monitor.updateContext(this); if (monitor.hasChanged()) { Item items[] = monitor.getChanges(); for (Item i : items) { if (i.getName().contains(tabType + " teleport")) { if (i.getAmount() < lastTabCount) { lastTabCount = i.getAmount(); } else { tabCount += i.getAmount() - lastTabCount; lastTabCount = i.getAmount(); } } } } } @Override public int onLoop() { listenInventory(); getDialogues().clickContinue(); checkRequirements(); setRunThreshold(); if (!hasClay()) { if (state.equals("banking")) { if (bank()) { if (backToHost()) { state = "tabbing"; } } } else { if (teleportToVarrock()) { state = "banking"; } } } else { doTabbing(); } return Calculations.random(300, 500); } @Override public void onExit() { log("Bye"); } @Override public void onPaint(Graphics g) { Font font = new Font("Times new roman", Font.PLAIN, 15); Color bg = new Color(155, 155, 155, 127); // grey transparent g.setColor(bg); g.fillRect(5, 5, 510, 80); g.setFont(font); g.setColor(Color.BLUE); g.drawString("Time: ", 10, 25); g.setColor(Color.WHITE); g.drawString(timer.formatTime(), 100, 25); g.setColor(Color.BLUE); g.drawString("Tabs made: ", 10, 45); g.setColor(Color.WHITE); g.drawString(tabCount + " (" + timer.getHourlyRate(tabCount) + ")", 100, 45); g.setColor(Color.BLUE); g.drawString("Magic xp: ", 10, 65); g.setColor(Color.WHITE); g.drawString(getSkillTracker().getGainedExperience(Skill.MAGIC) + " (" + getSkillTracker().getGainedExperiencePerHour(Skill.MAGIC) + ")", 100, 65); } }
    3. Hi, here's a script I made for Waterbirth island Rock Crabs! - Supports a single rock crab spot - Resets aggression when rock crabs no longer attack - Picks up arrows / knives that you specify - Doesn't support eating (I never had to eat) Wasn't able to upload the .jar so here's the source. To compile it, save the code in with the file name specified above each code block and then compile to a JAR. RockCrab.java package RockCrab; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.items.GroundItem; import java.awt.*; @ScriptManifest(category = Category.COMBAT, name = "RockCrabs", author = "Josh", version = 1.0) public class RockCrab extends AbstractScript { private String WEAPON; private boolean outOfCombatFlag = false; private boolean started = false; private Tile SPOT = new Tile(2513, 3766, 0); private Tile RESET = new Tile(2553, 3744, 0); private String state = "walking back"; private Timer runningTimer; private Timer combatTimer; @Override public void onStart(){ new RockGUI(this); } private void pickupLoot() { if (!getLocalPlayer().isInCombat()) { GroundItem i = getGroundItems().closest(WEAPON); if (i != null && getLocalPlayer().distance(i) < 4) { int c = getInventory().count(i.getID()); if (i.interact("Take")) { sleepUntil(() -> getInventory().count(i.getID()) > c, 3000); } } } } public void onGuiClose() { log("Gui closed"); this.stop(); } public void onGuiStart(String pickup) { log("Gui start"); WEAPON = pickup; started = true; runningTimer = new Timer(); combatTimer = new Timer(); getSkillTracker().start(Skill.RANGED); } private void attack() { if (isResetting() || isWalkingBack()) { return; } if (getLocalPlayer().isInCombat()) { outOfCombatFlag = false; combatTimer.reset(); } else { if (outOfCombatFlag) { NPC crab = getNpcs().closest("Rock Crab"); if (crab != null && getLocalPlayer().distance(crab) < 3 && !crab.isInCombat()) { if (crab.interact("Attack")) { sleepUntil(() -> getLocalPlayer().isInCombat(), 3000); } } } else { outOfCombatFlag = true; combatTimer.reset(); } } } private void resetCombat() { if ((combatTimer.elapsed() > 20000 || isResetting()) && !isWalkingBack()) { state = "resetting"; getWalking().walk(RESET); sleep(1500); } if (getLocalPlayer().distance(RESET) < 5) { state = "walking back"; } } private boolean isResetting() { return state.equals("resetting"); } private boolean isWalkingBack() { return state.equals("walking back"); } private boolean isOnSpot() { return SPOT.getTile().equals(getLocalPlayer().getTile()); } // go to the rock crab spot (defined by the tile SPOT) private void gotoSpot() { if (isResetting()) { return; } if (isWalkingBack()) { combatTimer.reset(); } if (isOnSpot()) { state = "in spot"; } else { if (getLocalPlayer().distance(SPOT) < 5) { getWalking().walkOnScreen(SPOT); sleepUntil(this::isOnSpot, 3000); state = "in spot"; } else { getWalking().walk(SPOT); sleep(1500); } log("walking to spot..."); } } @Override public int onLoop() { if (!started || !getClient().isLoggedIn()) return 1000; if (getInventory().count(WEAPON) > 10) { getInventory().interact(WEAPON, "Wield"); } getDialogues().clickContinue(); gotoSpot(); attack(); pickupLoot(); resetCombat(); return Calculations.random(400, 800); } @Override public void onExit() { } @Override public void onPaint(Graphics g) { if (!started) return; Font font = new Font("Times new roman", Font.PLAIN, 15); Color bg = new Color(155, 155, 155, 127); // grey transparent g.setColor(bg); g.fillRect(5, 5, 510, 70); g.setFont(font); g.setColor(Color.BLUE); g.drawString("Time: ", 10, 25); g.setColor(Color.WHITE); g.drawString(runningTimer.formatTime(), 100, 25); g.setColor(Color.BLUE); g.drawString("Ranged xp: ", 10, 45); g.setColor(Color.WHITE); g.drawString(getSkillTracker().getGainedExperience(Skill.RANGED) + " (" + getSkillTracker().getGainedExperiencePerHour(Skill.RANGED) + ")", 100, 45); g.setColor(Color.BLUE); g.drawString("State: ", 10, 65); g.setColor(Color.WHITE); g.drawString(state, 100, 65); } } RockGUI.java package RockCrab; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class RockGUI extends JFrame { private RockCrab ctx; public RockGUI(RockCrab main){ this.ctx = main; initComponents(); this.setVisible(true); } private void button1ActionPerformed(ActionEvent e) { ctx.onGuiStart(this.getPickupItem()); this.setVisible(false); } private void initComponents() { button1 = new JButton(); textField1 = new JTextField(); label1 = new JLabel(); setTitle("RockCrab"); Container contentPane = getContentPane(); GridBagConstraints c = new GridBagConstraints(); contentPane.setLayout(new GridBagLayout()); c.weightx = 1.0; c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = 0; c.insets = new Insets(5, 5, 5, 20); label1.setText("Type your pickup item: "); contentPane.add(label1, c); c.gridx = 1; c.gridy = 0; c.insets = new Insets(5, 5, 5, 5); textField1.setText("Iron knife"); textField1.setPreferredSize(new Dimension(150, 20)); contentPane.add(textField1, c); c.gridx = 0; c.gridy = 1; c.weightx = 1; c.gridwidth = 2; c.insets = new Insets(20, 5, 5, 5); button1.setText("Start"); button1.addActionListener(e -> button1ActionPerformed(e)); contentPane.add(button1, c); pack(); setLocationRelativeTo(getOwner()); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { e.getWindow().dispose(); ctx.onGuiClose(); } }); } private String getPickupItem() { return textField1.getText(); } private JButton button1; private JTextField textField1; private JLabel label1; }
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.