Jump to content

Swizzbeat

Members
  • Posts

    7986
  • Joined

  • Last visited

  • Days Won

    58
  • Feedback

    100%

Everything posted by Swizzbeat

  1. At least add the rest of the access modifiers if you added one of them Also, in my opinion instantiating variables looks better if done from within the constructor instead of right up top. That's opinionated though :p
  2. The exception thrown will be logged to the console output anyway, so it seems pretty redundant to add a try/catch block :p
  3. Why throw onLoop in a try/catch block if all you're doing is printing an exception is thrown (no help for debugging what so ever) Create BasicStroke as class variable so there aren't 40+ of them being created every second and killing the GC Create an int variable to hold mouse x/y coords so you're not retrieving 8 of the same Point object (same reason as above)
  4. public class ProgressReport { private Image image; private ProgressReport(Image image) { this.image = image; } public static ProgressReport getReport(Script sI) throws AWTException { Canvas c = sI.bot.getCanvas(); return new ProgressReport(new Robot().createScreenCapture(new Rectangle(c.getX(), c.getY(), c.getWidth(), c.getHeight()))); } public boolean save(String filename) throws IOException { Graphics imageGraphics = image.getGraphics(); imageGraphics.setColor(Color.BLACK); imageGraphics.fillRect(7, 458, 71, 15); return ImageIO.write((BufferedImage) image, "png", new File(filename + ".png")); } } That's what I have however my issue is that I can't seem to grab the canvas with the script paint on it before the script exits From what you can see above I tried using Toolkit as well but even that doesn't get the paint. Also, what is the original gameBuffer representing?
  5. I hope community isn't angry when I get hit by a bus tomorrow
  6. Create image -> draw shapes or whatever on it -> save image with those graphic modifications That's what I'd like to do. nevermind got it lol if anyone wants to clue me in on how to grab script paint in the onExit method before the bot itself clears it that would be great
  7. Perfectly stated.Unlike you botters, what we do takes a lot more skill and ingenuity than a couple mouse clicks or mindlessly playing a game. You have no idea what it's like to literally sit there and stare at documentation on bitwise operators/shifts just for the sake of gaining knowledge to make your scripts that much better (and programming knowledge as well). It's a tiring task which is why you see 99% of this site classified as script users while the other 1% make them. tl;dr fuck george clooney
  8. It's actually less work for the user + reduced ban rates. Custom path means no one else is using it, plus even creating specific locations in general is extremely limiting.
  9. Or be like me and be a true AIO: All user to create multiple paths and save them.
  10. Do you people not realize that OSB2 NEEDS to happen? After scripting with it for a couple days now I really see the benefit it is going to have towards botting in general. The mouse movements are more human like and overall it seems to be pretty undetectable. Also, in case anyone is not aware, the only reason they started development on a brand new bot in the first place was because the original was poorly constructed. It is in all of our best interests that they started anew.
  11. What pathing algorithm did you use to plot the route between you and the imp?
  12. The real question is why are you still using ID's brah.
  13. Swizzbeat

    onPaint

    They switched the argument to Graphics2D in OSB2. For the love of God just use one catch block.
  14. Swizzbeat

    OSBot 2.1.10

    Why are you commenting, you don't even script lol
  15. Swizzbeat

    OSBot 2.1.10

    Now that I can run a script without getting a ton of errors, I admit OSB2 is actually really nice O_o
  16. Just move the Mouse to a MouseDestination and click.
  17. import org.osbot.rs07.api.map.Position; import org.osbot.rs07.input.mouse.MiniMapTileDestination; import org.osbot.rs07.script.Script; /** * Created with IntelliJ IDEA * User: Anthony * Date: 5/31/2014 */ public class Walker { private final Script sI; public Walker(final Script sI) { this.sI = sI; } public boolean walkPath(final Position[] path) throws InterruptedException { return walkPath(path, 3); } public boolean walkPath(final Position[] path, int skipDist) throws InterruptedException { final Position nextTile = getNextTile(path, skipDist); if (nextTile != null) { if (sI.map.canReach(nextTile)) { clickMiniMapPosition(nextTile); } else { handleObstacleForPosition(nextTile); } } return path[path.length - 1].distance(sI.myPlayer()) < skipDist; } private Position getNextTile(final Position path[], int skipDist) { int dist = -1, closest = -1; for (int i = path.length - 1; i >= 0; i--) { Position tile = path[i]; int d = sI.map.distance(tile); if (d < dist || dist == -1) { dist = d; closest = i; } } int feasibleTileIndex = -1; for (int i = closest; i < path.length; i++) { if (sI.map.distance(path[i]) <= skipDist) { feasibleTileIndex = i; } else { break; } } return (feasibleTileIndex == -1) ? null : path[feasibleTileIndex]; } public Position[] reversePath(final Position[] path) { Position[] reversedPath = new Position[path.length]; for (int i = 0; i < reversedPath.length; i++) { reversedPath[i] = path[path.length - i - 1]; } return reversedPath; } private boolean clickMiniMapPosition(final Position position) throws InterruptedException { return sI.mouse.click(new MiniMapTileDestination(sI.bot, position)); } private boolean handleObstacleForPosition(final Position position) { return sI.doorHandler.handleNextObstacle(position); } } I ported over a walking snippet I had laying around. Haven't tested it yet so it may need some tweaking.
  18. They even provided a getRandomPoint method for the area class :p
  19. I'm pretty sure there's a localWalker instance available.
  20. lol how many sales u got m8 i have 3 gf goml such slut l2script prod nice nested if else blocks buddy boo
  21. I now pronounce you king fag of dragon land
×
×
  • Create New...