Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dark Magician

Java Lifetime Sponsor
  • Joined

  • Last visited

Everything posted by Dark Magician

  1. Awesome job guys! So far so good today.
  2. private int r = 255; private int g = 0; private int b = 0;
  3. I'm using this Mouse Trail in all my scripts.
  4. Thanks a lot! My script has gotten me from 40-70 range, so no complaints here. Hill Giant Magician should be on the SDN very soon, free for a limited time!
  5. Thanks for the feedback! The code above works just as presented.
  6. Wow thanks for the information! Very helpful. Will now rewrite and make my method better.
  7. Pretty much the Tile box will not contain the NPC resulting in the mouse not being able to interact with the NPC. I believe this is because the Tile height is wrong.
  8. Sorry to be more correct, mouse movements to the Entity will be quicker and interaction more accurate, excluding Drops and RSObjects, since I prioritized fast NPC interaction whereas Drops and Objects need not be. Will edit my first post.
  9. Thanks for the information. Could you give an example on how to do moving Entities. Also reason I'm not using the normal interact is because of the Tile error where it will always fail to find the Hill Giant, which you can see if you drawTile. Run Hill Giant Magician V 2.1
  10. Yea can't even start the bot right now.
  11. This is more accurate than the standard GroundItem interact. public boolean isNpcValid(NPC npc) { if (npc != null && map.canReach(npc)) { int id = npc.getId(); if (id != -1) { for (NPC i : getNpcs().get(npc.getX(), npc.getY())) { if (i.getId() == id) return true; } } } return false; } public boolean isGroundItemValid(GroundItem item) { if (item != null && item.exists() && map.canReach(item) && item.getPosition().distance(myPlayer().getPosition()) <= 7) { int id = item.getId(); if (id != -1) { for (GroundItem i : getGroundItems().get(item.getX(), item.getY())) { if (i.getId() == id) return true; } } } return false; } public boolean isObjectValid(RS2Object object) { if (object != null && object.exists() && map.canReach(object) && object.isVisible()) { int id = object.getId(); if (id != -1) { for (RS2Object i : getObjects().get(object.getX(), object.getY())) { if (i.getId() == id) return true; } } } return false; } public boolean isPlayerInteracting(NPC npc) { for (Player p : players.getAll()) { if (p.getInteracting() != null && p.getInteracting() == npc || p.getInteracting() != null && p.getInteracting().getPosition() == npc.getPosition() || p.getInteracting() != null && p.getInteracting().isInteracting(npc)) { return true; } } return false; } public void walkPath(Position[] path) throws InterruptedException { Position[] var5 = path; int var4 = path.length; for(int var3 = 0; var3 < var4; ++var3) { Position p = var5[var3]; boolean success; if(this.myPosition().distance(p) <= 16 && this.myPosition().distance(p) >= 3) { do { success = this.walkTile(p); } while(!success); } } } public boolean walkTile(Position p) throws InterruptedException { if(this.myPosition().distance(p) > 13) { Position fail = new Position((p.getX() + this.myPosition().getX()) / 2 + random(-3, 3), (p.getY() + this.myPosition().getY()) / 2 + random(-3, 3), this.myPosition().getZ()); this.walkTile(fail); } this.mouse.click(new MiniMapTileDestination(this.bot, p), false); int var3 = 0; while(this.myPosition().distance(p) > 2 && var3 < 10) { sleep(500L); if(!this.myPlayer().isMoving()) { ++var3; } } return var3 != 10; } public void interact(NPC n, String action) throws InterruptedException { if (map.isWithinRange(n, 7)) { status = "Interacting with " + n.getName(); double x = n.model.getBoundingBox(n.getGridX(), n.getGridY(), n.getZ()).getCenterX(); double y = n.model.getBoundingBox(n.getGridX(), n.getGridY(), n.getZ()).getCenterY(); mouse.move((int) x, (int) y); if (mouse.getEntitiesOnCursor() != null && mouse.getEntitiesOnCursor().contains(n) && mouse.click(true)) { if (menu.isOpen() && menu.selectAction(action)) { sleep(random(900, 1200)); } else { mouse.moveRandomly(); } } else { camera.toEntity(n); } } else if (n.getPosition().isOnMiniMap(this.client.bot)) { status = "Walking to " + n.getName(); walkTile(n.getPosition()); } else if (localWalker.walk(n)) { status = "Walking to " + n.getName(); sleep(random(900, 1200)); } } public void interact(GroundItem g, String action) throws InterruptedException { if (g.getPosition().distance(myPlayer().getPosition()) <= 1) { status = "Interacting with " + g.getName(); if (g.interact(action)) { sleep(random(900, 1200)); } else { camera.toEntity(g); } } else if (g.getPosition().isOnMiniMap(this.client.bot)) { status = "Walking to " + g.getName(); walkTile(g.getPosition()); } else if (localWalker.walk(g)) { status = "Walking to " + g.getName(); sleep(random(900, 1200)); } } public void interact(RS2Object o, String action) throws InterruptedException { if (o.isVisible()) { status = "Interacting with " + o.getName(); if (o.interact(action)) { sleep(random(900, 1200)); } else { camera.toEntity(o); } } else if (o.getPosition().isOnMiniMap(this.client.bot)) { status = "Walking to " + o.getName(); walkTile(o.getPosition()); } else if (localWalker.walk(o)) { status = "Walking to " + o.getName(); sleep(random(900, 1200)); } } Example: if (isObjectValid(objects.closest(11748))) { interact(objects.closest(11748), "Bank"); sleep(random(1500, 1700)); } else { status = "Walking to Bank"; camera.movePitch(67); camera.moveYaw(270); walkPath(DOOR_TO_BANK); } NPC hillGiant = getNpcs().closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc != null && npc.exists() && npc.getName().contains("Hill Giant") && npc.isAttackable() && !npc.isUnderAttack() && npc.getHealth() != 0 && !isPlayerInteracting(npc) && map.isWithinRange(myPlayer().getPosition(), npc, 7); }}); if (isNpcValid(hillGiant)) { interact(hillGiant, "Attack"); }
  12. This is really cool if you want it for your paint. LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>(); public class MousePathPoint extends Point { private long finishTime; private double lastingTime; public MousePathPoint(int x, int y, int lastingTime) { super(x, y); this.lastingTime = lastingTime; finishTime = System.currentTimeMillis() + lastingTime; } public boolean isUp() { return System.currentTimeMillis() > finishTime; } } public void nextRGB() { if ( r == 255 && g < 255 && b == 0 ) { g++; } if ( g == 255 && r > 0 && b == 0 ) { r--; } if ( g == 255 && b < 255 && r == 0 ) { b++; } if ( b == 255 && g > 0 && r == 0 ) { g--; } if ( b == 255 && r < 255 && g == 0 ) { r++; } if ( r == 255 && b > 0 && g == 0 ) { b--; } } public Color nextColor() { nextRGB(); return makeColor(); } public Color makeColor() { return new Color(r, g, b); } Example: @Override public void onPaint(Graphics2D g) { while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = mouse.getPosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, 500); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { g.setColor(nextColor()); g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); } lastPoint = a; } }
  13. I figured people would change the settings to fit their script, radio buttons, checkboxes etc...
  14. Hello if you are wondering how to do this, here we go. Example: public class HillGiantMagicianGUI extends JFrame { Settings prop = new Settings(new File(System.getProperty("user.home") + File.separator + "OSBot" + File.separator + "data" + File.separator), this, myPlayer().getName()); public HillGiantMagicianGUI() { initComponents(); prop.load(); } private void button1ActionPerformed(ActionEvent e) { prop.save(); } public static class Settings { private File PATH_FILE; private String FILE_NAME = "SETTINGS.ini"; private HillGiantMagicianGUI gui; private final Properties prop = new Properties(); public Settings(File f, HillGiantMagicianGUI gui, String accountName) { if (!f.exists()) { f.mkdirs(); } FILE_NAME = accountName.toUpperCase() + "_" + FILE_NAME; PATH_FILE = new File(f, FILE_NAME); this.gui = gui; } public synchronized void save() { try { if (!PATH_FILE.exists() && !PATH_FILE.createNewFile()) { return; } if (!PATH_FILE.canWrite()) { PATH_FILE.setWritable(true); } prop.clear(); prop.put("I1", gui.comboBox1.getSelectedItem()); prop.put("T2", gui.textField2.getText()); prop.put("I2", gui.comboBox2.getSelectedItem()); prop.put("T3", gui.textField3.getText()); prop.put("I3", gui.comboBox3.getSelectedItem()); prop.put("T4", gui.textField4.getText()); prop.put("I4", gui.comboBox4.getSelectedItem()); prop.put("T5", gui.textField5.getText()); prop.put("I7", gui.comboBox7.getSelectedItem()); prop.put("T6", gui.textField6.getText()); prop.put("I5", gui.comboBox5.getSelectedItem()); prop.put("T7", gui.textField7.getText()); prop.put("I6", gui.comboBox6.getSelectedItem()); prop.put("T8", gui.textField8.getText()); prop.put("I8", gui.comboBox8.getSelectedItem()); prop.put("T9", gui.textField9.getText()); prop.put("c1", String.valueOf(gui.checkBox1.isSelected())); prop.put("c2", String.valueOf(gui.checkBox2.isSelected())); prop.put("c3", String.valueOf(gui.checkBox3.isSelected())); prop.put("c4", String.valueOf(gui.checkBox4.isSelected())); prop.put("c5", String.valueOf(gui.checkBox5.isSelected())); prop.put("c6", String.valueOf(gui.checkBox6.isSelected())); prop.put("r1", String.valueOf(gui.radioButton1.isSelected())); prop.put("r2", String.valueOf(gui.radioButton2.isSelected())); prop.put("r3", String.valueOf(gui.radioButton3.isSelected())); prop.put("r4", String.valueOf(gui.radioButton4.isSelected())); prop.put("r5", String.valueOf(gui.radioButton5.isSelected())); prop.put("r6", String.valueOf(gui.radioButton6.isSelected())); prop.put("r7", String.valueOf(gui.radioButton7.isSelected())); prop.put("r8", String.valueOf(gui.radioButton8.isSelected())); prop.put("r9", String.valueOf(gui.radioButton9.isSelected())); prop.put("r10", String.valueOf( gui.radioButton10.isSelected())); prop.put("r11", String.valueOf(gui.radioButton11.isSelected())); prop.put("r12", String.valueOf( gui.radioButton12.isSelected())); prop.put("r14", String.valueOf(gui.radioButton14.isSelected())); prop.put("r15", String.valueOf(gui.radioButton15.isSelected())); prop.put("r16", String.valueOf(gui.radioButton16.isSelected())); prop.put("r17", String.valueOf(gui.radioButton17.isSelected())); prop.put("r18", String.valueOf(gui.radioButton18.isSelected())); prop.put("r19", String.valueOf(gui.radioButton19.isSelected())); prop.put("r20", String.valueOf(gui.radioButton20.isSelected())); prop.put("r21", String.valueOf(gui.radioButton21.isSelected())); prop.store(new FileOutputStream(PATH_FILE), "GUI Settings"); PATH_FILE.setReadOnly(); } catch (Throwable e) { } } public synchronized void load() { try { if (PATH_FILE.exists()) { prop.load(new FileInputStream(PATH_FILE)); gui.comboBox1.setSelectedItem(prop.getProperty("I1")); if (prop.getProperty("T2").toString() != "") { gui.textField2.setText(prop.getProperty("T2")); } gui.comboBox2.setSelectedItem(prop.getProperty("I2")); if (prop.getProperty("T3").toString() != "") { gui.textField3.setText(prop.getProperty("T3")); } gui.comboBox3.setSelectedItem(prop.getProperty("I3")); if (prop.getProperty("T4").toString() != "") { gui.textField4.setText(prop.getProperty("T4")); } gui.comboBox4.setSelectedItem(prop.getProperty("I4")); if (prop.getProperty("T5").toString() != "") { gui.textField5.setText(prop.getProperty("T5")); } gui.comboBox7.setSelectedItem(prop.getProperty("I7")); if (prop.getProperty("T6").toString() != "") { gui.textField6.setText(prop.getProperty("T6")); } gui.comboBox5.setSelectedItem(prop.getProperty("I5")); if (prop.getProperty("T7").toString() != "") { gui.textField7.setText(prop.getProperty("T7")); } gui.comboBox6.setSelectedItem(prop.getProperty("I6")); if (prop.getProperty("T8").toString() != "") { gui.textField8.setText(prop.getProperty("T8")); } gui.comboBox8.setSelectedItem(prop.getProperty("I8")); if (prop.getProperty("T9").toString() != "") { gui.textField9.setText(prop.getProperty("T9")); } gui.checkBox1.setSelected(Boolean.valueOf(prop.getProperty("c1", "false"))); gui.checkBox2.setSelected(Boolean.valueOf(prop.getProperty("c2", "false"))); gui.checkBox3.setSelected(Boolean.valueOf(prop.getProperty("c3", "false"))); gui.checkBox4.setSelected(Boolean.valueOf(prop.getProperty("c4", "false"))); gui.checkBox5.setSelected(Boolean.valueOf(prop.getProperty("c5", "false"))); gui.checkBox6.setSelected(Boolean.valueOf(prop.getProperty("c6", "false"))); gui.radioButton1.setSelected(Boolean.valueOf(prop.getProperty("r1", "false"))); gui.radioButton2.setSelected(Boolean.valueOf(prop.getProperty("r2", "false"))); gui.radioButton3.setSelected(Boolean.valueOf(prop.getProperty("r3", "false"))); gui.radioButton4.setSelected(Boolean.valueOf(prop.getProperty("r4", "false"))); gui.radioButton5.setSelected(Boolean.valueOf(prop.getProperty("r5", "false"))); gui.radioButton6.setSelected(Boolean.valueOf(prop.getProperty("r6", "false"))); gui.radioButton7.setSelected(Boolean.valueOf(prop.getProperty("r7", "false"))); gui.radioButton8.setSelected(Boolean.valueOf(prop.getProperty("r8", "false"))); gui.radioButton9.setSelected(Boolean.valueOf(prop.getProperty("r9", "false"))); gui.radioButton10.setSelected(Boolean.valueOf(prop.getProperty("r10", "false"))); gui.radioButton11.setSelected(Boolean.valueOf(prop.getProperty("r11", "false"))); gui.radioButton12.setSelected(Boolean.valueOf(prop.getProperty("r12", "false"))); gui.radioButton14.setSelected(Boolean.valueOf(prop.getProperty("r14", "false"))); gui.radioButton15.setSelected(Boolean.valueOf(prop.getProperty("r15", "false"))); gui.radioButton16.setSelected(Boolean.valueOf(prop.getProperty("r16", "false"))); gui.radioButton17.setSelected(Boolean.valueOf(prop.getProperty("r17", "false"))); gui.radioButton18.setSelected(Boolean.valueOf(prop.getProperty("r18", "false"))); gui.radioButton19.setSelected(Boolean.valueOf(prop.getProperty("r19", "false"))); gui.radioButton20.setSelected(Boolean.valueOf(prop.getProperty("r20", "false"))); gui.radioButton21.setSelected(Boolean.valueOf(prop.getProperty("r21", "false"))); } } catch (Throwable e) {} } }
  15. That sounds like a good idea, I have submitted a SDN request hopefully they accept even though I don't have a previous script on the SDN. Update: I think I've finally nailed it, new prog i got with the latest version before I ran out of arrows. A truly stable build for the masses. Update: Download links are available for V 2.1!
  16. Yes indeed. I just uploaded a video, let me know what you think.
  17. Hill Giant Magician A magician never reveals his secrets. ........................................................................................................................................................................................................................... ................................................................................................................ ...................................................................................................... ............................................................................................ .................................................................................. ........................................................................ .............................................................. .................................................... .......................................... ................................ ...................... ............ .. . GUI ........................................................................................................................................................................................................................... Achievements ........................................................................................................................................................................................................................... Progress Reports ........................................................................................................................................................................................................................... Download ........................................................................................................................................................................................................................... Updates Version 1.0 - Initial release Version 1.1 - Fixed bugs, New paint, Fixed jar, Method cleanup, Food support, Melee support Version 1.2 - More bug fixes, Fail-safes implemented, Method cleanup, Mini-map detection Version 1.3 - Fixed player health, Fixed banking, Fixed eating food Version 1.4 - Added script logo, Method cleanup, Added death counter, Added forum link Version 1.5 - GUI Implemented, Method cleanup, More bug fixes, Percent bars Version 2.0 - Fixed all bugs, Full GUI implementation, Full method cleanup, Fixed paint Version 2.1 - Fixed Percent bars, Model Interaction, Fixed Tile height, Method cleanup Version 2.2 - Fixed lag, Added Paint hide, Method cleanup, Added Mouse Trail Version 2.3 - Fixed Paint, Bug Fixes, Method cleanup
  18. Ah yes yes, think I will add that in now. Guess i will add: return String.format(formatter, duration.toDays()) + " : " + String.format(formatter, duration.toHours()) + " : " + String.format(formatter, duration.toMinutes() % 60) + " : " + String.format(formatter, duration.getSeconds() % 60);
  19. How about Class: public class Timer { private Instant start; private static final String formatter = "%02d"; public Timer() { reset(); } public void reset() { start = Instant.now(); } public Duration duration() { return Duration.between(start, Instant.now()); } @Override public String toString() { Duration duration = duration(); return String.format(formatter, duration.toHours()) + " : " + String.format(formatter, duration.toMinutes() % 60) + " : " + String.format(formatter, duration.getSeconds() % 60); } } Setup: Timer t = new Timer(); Usage: g.drawString("Time: " + t.toString(), 55, 401);
  20. Wating for Admin to delete.
  21. Awesome work, really like the API. My script is nearly complete.
  22. V 1.0 is ready, just finalized walking back and forward from bank.
  23. Yes finally got a good method working + script is nearly complete! public boolean interact(String name, String action, Entity e) { EntityDestination x = new EntityDestination(getBot(), e); mouse.move(x); if (!mouse.getEntitiesOnCursor().isEmpty()) { mouse.click(true); } else { mouse.moveOutsideScreen(); return false; } for (Option option : menu.getMenu()) { if (option != null) { if (option.name.contains(name)) { if (option.action.contains(action)) { return menu.selectAction(action); } } } } return false; }
  24. Released V 1.0 of Hill Giant Magician1 Thanks everyone for the support! http://osbot.org/forum/topic/80435-hill-giant-magician-v-10-bank-safe-spot/#entry893442

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.