-
Posts
59 -
Joined
-
Last visited
-
Days Won
1
Everything posted by ImLife
-
I personally skipped taskscript and went straight to treescript. Regardless i would suggest you look at open source repos on github. just search "dreambot" with java as language and sort by newest
-
Made one now, let me know if you're still looking
-
Just wondering if anyone is working on a Corrupted Gauntlet bot?
ImLife replied to hoolahoop's topic in General Discussion
I'm working towards getting my accounts there to see if I can create a bot for it. -
Ahh, jesus christ... its the height of the projectile 🥲 Dm me that paypal link
-
Upping the bounty to 50$ for a solution
-
Hit a major milestone within the botting community!
ImLife replied to KCBot's topic in General Discussion
Love posts like these! Great work, keep it up -
Bumping this will give 25$ to anyone with a code snippet or tips leading to a solution for dodging wintertodt brazier breaking and wintertodt dodge snowfall.
-
will you be adding uim support?
-
marked in red, "Patch dreambot into launcher"
-
As a developer fresh into the dreambot ecosystem i wasn't aware of how good the dreambot walker was/is. Tested yesterday, the native walker seamlessly walked to catherby through port sarim charter without telling it to do so.
- 25 replies
-
-
why?...
-
im using this as a reference, its great: https://github.com/rroarings/dreambot_scripts/blob/master/src/pfcows/src/PFCows.java
-
Tried adding the package to my project. Lot's of errors not easily buildable
- 25 replies
-
Could you update us on the varbits you have found so far?
-
Great initiative! Was not working straight out of the box on java, but I made some modifications: Main.Java public class Main extends TreeScript { private Timer timer; private long startTime; private GridPainter gridPainter = new GridPainter(true, 5, 5, 100, 35, new Color(255, 255, 255, 225)); public static String formatElapsedTime(long milliseconds) { long seconds = milliseconds / 1000; long hours = seconds / 3600; long minutes = (seconds % 3600) / 60; long remainingSeconds = seconds % 60; return String.format("%02d:%02d:%02d", hours, minutes, remainingSeconds); } @Override public void onPause() { if (timer != null) { timer.pause(); } } @Override public void onStart() { timer = new Timer(); startTime = System.currentTimeMillis(); timer.start(); gridPainter.addCell( new Cell( "Time", 1, "52", 1, false, new Color(255, 255, 255, 255), new Color(255, 255, 255, 255) ) ); gridPainter.addCell( new Cell( "Woodcutting EXP", 2, "0", 2, false, new Color(255, 255, 255, 255), new Color(255, 255, 255, 255) ) ); gridPainter.addCell( new Cell( "Fletching EXP", 3, "0", 2, false, new Color(255, 255, 255, 255), new Color(255, 255, 255, 255) ) ); } @Override public int onLoop() { if (timer != null && timer.isPaused()) { timer.resume(); } return this.getRoot().onLoop(); } @Override public void onPaint(Graphics2D graphics) { gridPainter.updateCell("Time", formatElapsedTime(timer.elapsed())); gridPainter.updateCell("Woodcutting EXP", String.valueOf(SkillTracker.getGainedExperience(Skill.WOODCUTTING)) + "exp"); gridPainter.updateCell("Fletching EXP", String.valueOf(SkillTracker.getGainedExperience(Skill.FLETCHING)) + "exp"); gridPainter.draw(graphics); } } ScriptPaint.Cell.java package ScriptPaint; import java.awt.*; import java.awt.geom.Rectangle2D; public class Cell { public static final Font font = new Font("Arial", Font.PLAIN, 14); private String name; private int rowNum; private String data; private int span; private boolean prefixWithName; private Color bgColor; private Color textColor; public Cell(String name, int rowNum, String data, int span, boolean prefixWithName, Color bgColor, Color textColor) { this.name = name; this.rowNum = rowNum; this.data = data; this.span = span; this.prefixWithName = prefixWithName; this.bgColor = bgColor; this.textColor = textColor; } public void draw(Graphics2D g, double x, double y, double cellWidth, double cellHeight, Color cellBorderColor) { double w = cellWidth * span; String text = prefixWithName ? name + ": " + data : data; Rectangle2D.Double rect = new Rectangle2D.Double(x, y, w, cellHeight); g.setColor(new Color(0, 0, 0, 100)); g.fill(rect); g.setColor(cellBorderColor); g.draw(rect); g.setFont(font); FontMetrics fm = g.getFontMetrics(); float textX = (float) (x + ((w - fm.stringWidth(text)) / 2)); float textY = (float) (y + (((cellHeight - fm.getHeight()) / 2) + fm.getAscent())); g.setColor(Color.WHITE); //text color g.drawString(text, textX, textY); } public String getName() { return name; } public int getRowNum() { return rowNum; } public void setData(String data) { this.data = data; } public void setPrefixWithName(boolean prefixWithName) { this.prefixWithName = prefixWithName; } public void setBgColor(Color bgColor) { this.bgColor = bgColor; } public void setTextColor(Color textColor) { this.textColor = textColor; } } ScriptPaint.GridPainter.java package ScriptPaint; import org.dreambot.api.utilities.Logger; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.util.LinkedList; import java.util.List; public class GridPainter { public static final Color GRAY = new Color(70, 61, 50, 156); public static final Color RED = new Color(255, 61, 50, 156); public static final Color GREEN = new Color(70, 255, 50, 156); public static final Color WHITE = new Color(255, 255, 255, 156); public static final Font font = new Font("Arial", Font.PLAIN, 14); private boolean show; private double x; private double y; private double cellWidth; private double cellHeight; private Color cellBorderColor; private List<LinkedList<Cell>> grid; public GridPainter(boolean show, double x, double y, double cellWidth, double cellHeight, Color cellBorderColor) { this.show = show; this.x = x; this.y = y; this.cellWidth = cellWidth; this.cellHeight = cellHeight; this.cellBorderColor = cellBorderColor; this.grid = new LinkedList<>(); } public void draw(Graphics2D g) { if (show) { double x = this.x; double y = this.y; for (LinkedList<Cell> row : grid) { for (Cell cell : row) { cell.draw(g, x, y, cellWidth, cellHeight, cellBorderColor); x += cellWidth; } x = this.x; y += cellHeight; } } } public void addCell(Cell cell) { int targetRowIndex = cell.getRowNum() - 1; // Ensure the grid has enough rows while (grid.size() <= targetRowIndex) { grid.add(new LinkedList<>()); } // Add the cell to the appropriate row grid.get(targetRowIndex).add(cell); } public void updateCell(String name, String data) { Cell cell = findCell(name); if (cell != null) { if (data != null) { cell.setData(data); cell.setPrefixWithName(true); cell.setBgColor(new Color(70, 61, 50, 156)); cell.setTextColor(new Color(255, 0, 0, 255)); } } } public void removeCell(String name) { for (LinkedList<Cell> row : grid) { row.remove(findCell(name)); } } private Cell findCell(String name) { for (LinkedList<Cell> row : grid) { for (Cell cell : row) { if (cell.getName().equals(name)) { return cell; } else { Logger.log("UABLE TO FIND CELL " + name); } } } return null; } } The updated code is arguably less clean and worse than originally proposed. but it works