Jump to content

Divine

Members
  • Posts

    148
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Divine

  1. I HATE ALL OF THE CANDIDATES.
  2. There is not in this specific code. This doesn't handle building paths though, this makes the character walk to the path you create yourself.
  3. Divine

    BETA v1.7.19

    I don't like the Run From Combat, because most scripts have that built-in, so now if it's in combat it'll run the fuck away from where it should be, and then the script will stop cuz it's too far away.
  4. My mistake, forgot to include it in the code!
  5. public boolean WalkAlongPath(int[][] path, boolean AscendThroughPath, int distanceFromEnd) { if (distanceToPoint(AscendThroughPath ? path[path.length - 1][0] : path[0][0], AscendThroughPath ? path[path.length - 1][1] : path[0][1]) <= distanceFromEnd) return true; else { WalkAlongPath(path, AscendThroughPath); return false; } } public void WalkAlongPath(int[][] path, boolean AscendThroughPath) { int destination = 0; for (int i = 0; i < path.length; i++) if (distanceToPoint(path[i][0], path[i][1]) < distanceToPoint(path[destination][0], path[destination][1])) destination = i; if (script.client.getMyPlayer().isMoving() && distanceToPoint(path[destination][0], path[destination][1]) > (script.isRunning() ? 3 : 2)) return; if (AscendThroughPath && destination != path.length - 1 || !AscendThroughPath && destination != 0) destination += (AscendThroughPath ? 1 : -1); try { log("Walking to node:" + destination); script.walk(new Position(path[destination][0], path[destination][1], 0)); Thread.sleep(700 + MethodProvider.random(600)); } catch (InterruptedException e) { e.printStackTrace(); } } private int distanceToPoint(int pointX, int pointY) { return (int) Math.sqrt(Math.pow(script.client.getMyPlayer().getX() - pointX, 2) + Math.pow(script.client.getMyPlayer().getY() - pointY, 2)); } This allows you to have your character walk along a path, starting at any point along the path. It will walk like a human, not like a bot. This is how you'd use it: private int[][] path1 = new int[][] { { 3206, 3209 }, { 3215, 3211 }, { 3217, 3218 }, { 3225, 3218 }, { 3235, 3220 }, { 3242, 3226 }, { 3252, 3226 }, { 3251, 3235 }, }; public void walkToGoblins() { WalkAlongPath(path1, true); } public void walkToBankFromGoblins() { WalkAlongPath(path1, false); } public void walkToGoblinsThenAttack() { if(WalkAlongPath(path1, true, 1)) //The 1 is the distance away from destination state = State.AttackGoblins; } Enjoy.
  6. Good for starting Scripters.
  7. Download: http://uppit.com/tfpejnqlq0t1/ScriptBase.java In Text: import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import org.osbot.script.Script; import org.osbot.script.ScriptManifest; @ScriptManifest(name = "Script Name", author = "Author", version = 1.0D, info = "Description goes here.") public class ClassName extends Script { /* * Variables */ private BufferedImage paint; private long startTime; /* * Inherited Methods */ // Called at start public void onStart() { try { startTime = System.currentTimeMillis(); this.paint = ImageIO.read(new URL("IMAGE URL GOES HERE.")); } catch (Exception e) { // Catch } } // Called more than once. public int onLoop() { try { } catch (Exception e) { // Catch } return 1; } // Called at script stop public void onExit() { } // Called more than once, even during pause. public void onPaint(java.awt.Graphics g) { if (paint != null) g.drawImage(paint, 0, 0, null); //0,0 = X,Y } /* * Non-Inherited Methods */ //Non-Inherited methods go here. /* * Useful Methods */ //XP for level public int getXPForLevel(int level) { int points = 0; int output = 0; for (int lvl = 1; lvl <= level; lvl++) { points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0)); if (lvl >= level) return output; output = (int) Math.floor(points / 4); } return 0; } } onStart is called at the start of script, onLoop is called over and over. onExit is called on script stop. onPaint is for the drawing.
  8. Nope, not shopped. I have witnesses.
  9. Fish herpes grant ovary deeds. OSJKA
  10. Edit... Messed up.
  11. Divine

    BETA v1.7.5

    Great!! The prison pete issue SUCKED! Thank you for fixing this, But molly still needs to be fixed, then all randoms will work correctly! :-).
  12. Soon adding support for custom paint, but inside another window. Basically imagine instead of painting an image with text on it on top of the client, have it paint the image with text inside of a Canvas in a Collapsible, GUI Window. Expect that in Version 2 as an additional type of GUI, coming out in the future.
  13. Divine's GUI Paint System What is this paint system, and how can it benefit me?: This is an open source class which you can implement into any script for extremely quick + clean paint. It is not paint, but can be used instead or along with paint. It is a seperate window which displays whatever information you wish to display!How easy is it?: Notice how few lines create and draw the entire window: Media: Does it consume a lot of memory?: Very low memory usage, much smaller than drawing paint on the client screen.Instructions for use: Add the new .java file into your project (GUIPaint.java). Code with few easy methods. Make sure to include the compiled .class inside the script jar, or along with the other script classes. Code Syntax: This code goes in onPaint(Graphics g) inside YOUR script. Always start with this line: GUIPaint.buildFrame("GUI WINDOW TITLE"); Then, you MUST define a category. When you want to set a new category, after the last cell in the previous category, use the same code again. GUIPaint.setCategory("Category Name"); Next, add as many cells as you wish! If you go too high, specify in GUIPaint.buildFrame(name, MAX_CELLS) to increase the maximum amount of cells. The default is 20. Also, addCell supports value types of String, doubles, booleans, longs, and integers. GUIPaint.addCell("NAME OF ITEM (WITHOUT COLON)", "VALUE"); Always End with RefreshPaint(): GUIPaint.RefreshPaint(); To have the Window CLOSE on script exit, add GUIHandler.CloseGUI() inside your onExit(): public void onExit() { GUIPaint.CloseGUI(); } A good example of a full implementation, displaying static text: public void onPaint(Graphics g) { GUIPaint.buildFrame("Clay Miner"); GUIPaint.setCategory("Time"); GUIPaint.addCell("Time Running", "00:00:00"); GUIPaint.setCategory("Clay"); GUIPaint.addCell("Clay", 0); GUIPaint.addCell("Clay / Hour", 0); GUIPaint.setCategory("Experience"); GUIPaint.addCell("Experience", 0); GUIPaint.addCell("Experience / Hour", 0); GUIPaint.RefreshPaint(); } public void onExit() { GUIPaint.CloseGUI(); } Download the GUIPaint class HERE: http://uppit.com/vrkhkxohfryb/GUIPaint.java
  14. I used all but getXPForLevel in my Firemaking code. The distance for finding the closest bank, and the LevelforXP for XP till next level. If it's useless to YOU, don't use it :-).
  15. That is, the oddest combination of person. That's odd without the transgender, then put em together it's really odd! Interesting video though.
  16. Here are some awesome, useful snippets: DistanceToPoint (Distance from character to point, can be used for finding the closest thing to the character at any distance): private int distanceToPoint(int pointX,int pointY) { return (int) Math.sqrt(Math.pow(this.client.getMyPlayer().getX() - pointX, 2) + Math.pow(this.client.getMyPlayer().getY() - pointY, 2)); } Get XP for Level: public int getXPForLevel(int level) { int points = 0; int output = 0; for (int lvl = 1; lvl <= level; lvl++) { points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0)); if (lvl >= level) return output; output = (int)Math.floor(points / 4); } return 0; } Get Level for XP: public int getLevelForXP(int exp) { int points = 0; int output = 0; if (exp > 13034430) return 99; for (int lvl = 1; lvl <= 99; lvl++) { points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0)); output = (int) Math.floor(points / 4); if (output >= exp) { return lvl; } } return 0; }
×
×
  • Create New...