Jump to content

Dark Magician

Lifetime Sponsor
  • Posts

    1899
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Dark Magician

  1. 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; } }
  2. I figured people would change the settings to fit their script, radio buttons, checkboxes etc...
  3. 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) {} } }
  4. 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);
  5. 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);
  6. Wating for Admin to delete.
  7. Awesome work, really like the API. My script is nearly complete.
  8. V 1.0 is ready, just finalized walking back and forward from bank.
  9. 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; }
  10. 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
  11. Yes Runespan but I think the most popular was WaterFiend Magician. I personally got 99 Summoning using it. Here's an early build maybe v 1.0 from 2011.
  12. Thanks everyone. First script to release is a Hill Giant FTP with banking + safe spot ranging.
  13. I am from way back in the day -> 2011 Would like to update a lot my scripts.
×
×
  • Create New...