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
  • Gorn

    Members
    • Posts

      23
    • Joined

    • Last visited

    Reputation Activity

    1. Like
      Gorn reacted to botmaker_01 in Task framework, but I want it to be more general   
      Ok ty bro, now can you explain why you're calling ENUM? that doesn't follow clean code best practices and I have no idea what's happening
    2. Upvote
      Gorn reacted to Diggington in Bunch of error in the code   
      Shit bro if ChatGPT checked your code and said nothing was wrong then I'm all out of ideas
      Seriously, follow the guide: https://dreambot.org/guides/scripter-guide/script-dev/setting-up-dev-env/
    3. Like
      Gorn reacted to Blastpop in Bunch of error in the code   
      Hi, I was wondering why my script isn't detected by the client?
       
      Like, I used the right JDK found in the doc, I used Eclipse, I imported external JAR library from the client.jar file in the Dreambot foler and chatGPT checked my code and don't see any error but, the script is just not detected. Someone can explaine me why I can't make it work?
    4. Upvote
      Gorn reacted to hashbang in Is there a way of counting the rune in runepouch?   
      It's all stored in the Varbits.
      The runelite source code on GitHub is very useful for things like this
      //Varbit ids for runes in the pouch (These are not Item IDs, see below) RUNE_POUCH_RUNE1: 29 RUNE_POUCH_RUNE2: 1622 RUNE_POUCH_RUNE3: 1623 // Varbit ids for the quantity of each rune RUNE_POUCH_AMOUNT1: 1624 RUNE_POUCH_AMOUNT2: 1625 RUNE_POUCH_AMOUNT3: 1626 // This list maps the varbit value to a given Rune type (1 = Air Rune, etc) AIR(1, AIR_RUNE), WATER(2, WATER_RUNE), EARTH(3, EARTH_RUNE), FIRE(4, FIRE_RUNE), MIND(5, MIND_RUNE), CHAOS(6, CHAOS_RUNE), DEATH(7, DEATH_RUNE), BLOOD(8, BLOOD_RUNE), COSMIC(9, COSMIC_RUNE), NATURE(10, NATURE_RUNE), LAW(11, LAW_RUNE), BODY(12, BODY_RUNE), SOUL(13, SOUL_RUNE), ASTRAL(14, ASTRAL_RUNE), MIST(15, MIST_RUNE), MUD(16, MUD_RUNE), DUST(17, DUST_RUNE), LAVA(18, LAVA_RUNE), STEAM(19, STEAM_RUNE), SMOKE(20, SMOKE_RUNE), WRATH(21, WRATH_RUNE);  
    5. Thonking
      Gorn got a reaction from Diggington in How to pass enums in Java?   
      No you don't pass enums like that because enums are static. But the problem u have here isnt with enums. All the enums u showed here are just lists of strings anyway (that's how u are using them). This item system is just bad so creating anything in it is gonna be a headache. Like how do you represent for example mithril gloves in this? enum + enum? One enum for mithril and one enum for gloves and then turn it into a string to get mithril gloves lol. I hope u see the problem here isnt passing around enums.
       
      Not even talking about all that extra string formatting which is cancer because it needs memory allocation.
    6. Like
      Gorn reacted to GhostData in Live Scripting w/ Lua   
      Live Scripting w/ Lua
      Write scripts with lua using LuaJ
      Wanted to write something where i can see the results immediately. Please post any errors here or on the Github. Thanks!
       

       
      Source: https://github.com/GhostDataIsDreaming/GhostIsDreamingScripts/tree/main/LiveScripting
      Download Link: https://github.com/GhostDataIsDreaming/GhostIsDreamingScripts/releases
      VirusTotal: https://www.virustotal.com/gui/file/7ef83bd0e0880409ecd78c65a971f9d5f6f7752fe0ab7537f89e74a3964d7d32?nocache=1
    7. Like
      Gorn reacted to holic in WindMouse - Custom Mouse Movement Algorithm   
      Hey all,
      Since DB3 officially supports custom mouse algorithms I thought I would port over a classic one: WindMouse.
      WindMouse was written by BenLand100 for SCAR some years back (maybe 10 years?) and has been used on so many damn bots throughout the years because it functions really well so it only seemed right to bring it here.
      In the source code below, there are two implementations of WindMouse:
      Point windMouse(int x, int y) Which comes directly from the SMART github with minor adjustments to work with DB3.
      Better in fixed mode.
        void windMouse2(Point point) My tweaked version from years back that supports all screen sizes.
      I've added a random point between the original and the destination point if the distance between them is large to feel more human but has a 50% chance of happening. By default my implementation is the active algorithm (as it handles all sizes), swap the comments in handleMovement to change to the original.
       
      To use it, simply add the file WindMouse.java to your project and add the following to your onStart method:
      Client.getInstance().setMouseMovementAlgorithm(new WindMouse());  
      All credits go to Benjamin J. Land a.k.a. BenLand100
      WindMouse.java:
      /** * WindMouse from SMART by Benland100 * Copyright to Benland100, (Benjamin J. Land) * * Prepped for DreamBot 3 **/ import org.dreambot.api.Client; import org.dreambot.api.input.Mouse; import org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm; import org.dreambot.api.input.mouse.destination.AbstractMouseDestination; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.input.mouse.MouseSettings; import java.awt.*; import static java.lang.Thread.sleep; public class WindMouse implements MouseMovementAlgorithm { private int _mouseSpeed = MouseSettings.getSpeed() > 15 ? MouseSettings.getSpeed() - 10 : 15; private int _mouseSpeedLow = Math.round(_mouseSpeed / 2); private int _mouseGravity = Calculations.random(4, 20); private int _mouseWind = Calculations.random(1, 10); @Override public boolean handleMovement(AbstractMouseDestination abstractMouseDestination) { //Get a suitable point for the mouse's destination Point suitPos = abstractMouseDestination.getSuitablePoint(); // Select which implementation of WindMouse you'd like to use // by uncommenting out the line you want to use below: //windMouse(suitPos.x, suitPos.y); //Original implementation windMouse2(suitPos); //Tweaked implementation return distance(Client.getMousePosition(), suitPos) < 2; } public static void sleep(int min, int max) { try { Thread.sleep(Calculations.random(min,max)); } catch (InterruptedException e) { log(e.getMessage()); } } public static void sleep(int ms) { try { Thread.sleep(ms); } catch (InterruptedException e) { log(e.getMessage()); } } /** * Tweaked implementation of WindMouse * Moves to a mid point on longer moves to seem a little more human-like * Remove the if statement below if you'd rather straighter movement * @param point The destination point */ public void windMouse2(Point point) { Point curPos = Client.getMousePosition(); if (distance(point, curPos) > 250 && Calculations.random(1) == 2) { Point rp = randomPoint(point, curPos); windMouse2(curPos.x, curPos.y, rp.x, rp.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); sleep(1, 150); } windMouse2(curPos.x, curPos.y, point.x, point.y, _mouseGravity, _mouseWind, _mouseSpeed, Calculations.random(5, 25)); _mouseGravity = Calculations.random(4, 20); _mouseWind = Calculations.random(1, 10); _mouseSpeed = Calculations.random(_mouseSpeedLow, MouseSettings.getSpeed()); } /** * Tweaked implementation of WindMouse by holic * All credit to Benjamin J. Land for the original. (see below) * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling */ private void windMouse2(double xs, double ys, double xe, double ye, double gravity, double wind, double speed, double targetArea) { double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; double sqrt2 = Math.sqrt(2); double sqrt3 = Math.sqrt(3); double sqrt5 = Math.sqrt(5); int tDist = (int) distance(xs, ys, xe, ye); long t = System.currentTimeMillis() + 10000; while (!(Math.hypot((xs - xe), (ys - ye)) < 1)) { if (System.currentTimeMillis() > t) break; dist = Math.hypot((xs - xe), (ys - ye)); wind = Math.min(wind, dist); if ((dist < 1)) { dist = 1; } long d = (Math.round((Math.round(((double) (tDist))) * 0.3)) / 7); if ((d > 25)) { d = 25; } if ((d < 5)) { d = 5; } double rCnc = Calculations.random(6); if ((rCnc == 1)) { d = 2; } double maxStep = (Math.min(d, Math.round(dist))) * 1.5; if ((dist >= targetArea)) { windX = (windX / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); windY = (windY / sqrt3) + ((Calculations.random((int) ((Math.round(wind) * 2) + 1)) - wind) / sqrt5); } else { windX = (windX / sqrt2); windY = (windY / sqrt2); } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; if ((Math.hypot(veloX, veloY) > maxStep)) { maxStep = ((maxStep / 2) < 1) ? 2 : maxStep; double randomDist = (maxStep / 2) + Calculations.random((int) (Math.round(maxStep) / 2)); double veloMag = Math.sqrt(((veloX * veloX) + (veloY * veloY))); veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { Mouse.hop(new Point((int) Math.round(xs), (int) Math.round(ys))); } int w = Calculations.random((int) (Math.round(100 / speed))) * 6; if ((w < 5)) { w = 5; } w = (int) Math.round(w * 0.9); sleep(w); } if (((Math.round(xe) != Math.round(xs)) || (Math.round(ye) != Math.round(ys)))) { Mouse.hop(new Point(((int) (Math.round(xe))), ((int) (Math.round(ye))))); } } /** * Internal mouse movement algorithm from SMART. Do not use this without credit to either * Benjamin J. Land or BenLand100. This was originally synchronized to prevent multiple * motions and bannage but functions poorly with DB3. * * BEST USED IN FIXED MODE * * @param xs The x start * @param ys The y start * @param xe The x destination * @param ye The y destination * @param gravity Strength pulling the position towards the destination * @param wind Strength pulling the position in random directions * @param minWait Minimum relative time per step * @param maxWait Maximum relative time per step * @param maxStep Maximum size of a step, prevents out of control motion * @param targetArea Radius of area around the destination that should * trigger slowing, prevents spiraling * @result The actual end point */ private Point windMouseImpl(double xs, double ys, double xe, double ye, double gravity, double wind, double minWait, double maxWait, double maxStep, double targetArea) { final double sqrt3 = Math.sqrt(3); final double sqrt5 = Math.sqrt(5); double dist, veloX = 0, veloY = 0, windX = 0, windY = 0; while ((dist = Math.hypot(xs - xe, ys - ye)) >= 1) { wind = Math.min(wind, dist); if (dist >= targetArea) { windX = windX / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; windY = windY / sqrt3 + (2D * Math.random() - 1D) * wind / sqrt5; } else { windX /= sqrt3; windY /= sqrt3; if (maxStep < 3) { maxStep = Math.random() * 3D + 3D; } else { maxStep /= sqrt5; } } veloX += windX + gravity * (xe - xs) / dist; veloY += windY + gravity * (ye - ys) / dist; double veloMag = Math.hypot(veloX, veloY); if (veloMag > maxStep) { double randomDist = maxStep / 2D + Math.random() * maxStep / 2D; veloX = (veloX / veloMag) * randomDist; veloY = (veloY / veloMag) * randomDist; } int lastX = ((int) (Math.round(xs))); int lastY = ((int) (Math.round(ys))); xs += veloX; ys += veloY; if ((lastX != Math.round(xs)) || (lastY != Math.round(ys))) { setMousePosition(new Point((int) Math.round(xs), (int) Math.round(ys))); } double step = Math.hypot(xs - lastX, ys - lastY); sleep((int) Math.round((maxWait - minWait) * (step / maxStep) + minWait)); } return new Point((int) xs, (int) ys); } /** * Moves the mouse from the current position to the specified position. * Approximates human movement in a way where smoothness and accuracy are * relative to speed, as it should be. * * @param x The x destination * @param y The y destination * @result The actual end point */ public Point windMouse(int x, int y) { Point c = Client.getMousePosition(); double speed = (Math.random() * 15D + 15D) / 10D; return windMouseImpl(c.x, c.y, x, y, 9D, 3D, 5D / speed, 10D / speed, 10D * speed, 8D * speed); } private void setMousePosition(Point p) { Mouse.hop(p.x, p.y); } private static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((Math.pow((Math.round(x2) - Math.round(x1)), 2) + Math.pow((Math.round(y2) - Math.round(y1)), 2))); } public double distance(Point p1, Point p2) { return Math.sqrt((p2.y - p1.y) * (p2.y - p1.y) + (p2.x - p1.x) * (p2.x - p1.x)); } public static float randomPointBetween(float corner1, float corner2) { if (corner1 == corner2) { return corner1; } float delta = corner2 - corner1; float offset = Calculations.getRandom().nextFloat() * delta; return corner1 + offset; } public Point randomPoint(Point p1, Point p2) { int randomX = (int) randomPointBetween(p1.x, p2.x); int randomY = (int) randomPointBetween(p1.y, p2.y); return new Point(randomX, randomY); } }  
      Happy botting!
    ×
    ×
    • 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.