Jump to content

Flamezzz

Members
  • Posts

    763
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Flamezzz

  1. Over the last few days i have been incorporating a new technique. Wait wut? How did you test this?
  2. Why wouldn't it be successful? Those things are static, so you can safely say success iff mouse.click is successful, right?
  3. I briefly looked at org.osbot.core.debug.HoverDebug and I think it does the same thing, looping through every tile but it compares points in a polygon.
  4. Perhaps you can do something like: for each tile in myplayer.getArea(radius): if tile.polygon contains (mx, my): return tile not the most efficient solution tho
  5. http://osbot.org/api/org/osbot/rs07/GameConstants.html I think you can write a value here and it should work.
  6. I would still prefer the most readable solution of all: bank.getItem(new ContainsNameFilter<>("Amulet of glory")); It reads nicely like a sentence and is equal in performance when rounded to nanoseconds. @OP Nice script
  7. dont you dare to touch my cookies
  8. Because then it is obvious the bot is detected and bot creators would immediately change their bots.
  9. Flamezzz

    Menu

    MethodProvider#stripFormatting removes HTML tags
  10. Sooo scheduling an additional thread is not more expensive than some minor computations?
  11. I suggest you read the following to get an idea of what you're doing: https://docs.oracle.com/javase/tutorial/essential/exceptions/ https://docs.oracle.com/javase/tutorial/essential/concurrency/sleep.html There's also more essential Java stuff on the oracle website. Also, it's kind of annoying (at least for me) to look at a gif. Please copy-paste the classes if you still need help.
  12. I'm quite sure that's not in the API. I think this will answer your question, although the widget IDs have changed (it's now 162,38). Once you have selected the correct widget containing the item name, you call widget.interact()
  13. Can you post a minimal script which causes the lag?
  14. You should use webWalking(Position... positions), so if you have a single position you have to create an array until they remove the deprecated one... Position p = new Position(x,y,z); walking.webWalk(new Position[]{p});
  15. That's a nice solution, although I don't like how decorators can be abused and add unnecessary complexity (java IO )
  16. Yes but you have to use the 'low level' api (events): Position dst = new Position(0,0,0); INodeRouteFinder nrf = INodeRouteFinder.threadSafeWrapper(INodeRouteFinder.createAdvanced()); WebWalkEvent e = new WebWalkEvent(nrf, dst); e.disableRun(); boolean failed = execute(e).hasFailed();
  17. I think something like this would work: Position dst = new Position(0,0,0); INodeRouteFinder nrf = INodeRouteFinder.threadSafeWrapper(INodeRouteFinder.createAdvanced()); WebWalkEvent e = new WebWalkEvent(nrf, dst); e.setBreakCondition(new Condition() { @Override public boolean evaluate() { return random(100) == 1; } }); boolean success = execute(e).hasFinished(); if(!success) { // Couldn't walk to dst or we breaked } You can either add a sleep in the evaluate of the break condition or if success = false
  18. IsPendingContinuation() returns true iff it finds "to continue" or "please wait..." so your logic is flawed here.
  19. Drawing a button is of course just g.drawX(...) in onPaint. Next, you basically just implement MouseListener (or extend MouseAdapter) and tell osbot you want to receive mouse events bot.addMouseListener(yourListener). Then you implement mouseClicked(MouseEvent e), e has a property which gives you the location of the click, you can use this to determine if the click was within the bounds of your button.
  20. If there's no documentation then just create it yourself ^^
  21. It will not work because the condition is evaluated exactly once, when the method is called. I've created something similar using a custom interface: public interface Condition { boolean eval(MethodProvider api); } In your script: private boolean sleep(int millis, Condition cond) { MethodProvider api = this; return new ConditionalSleep(millis) { public boolean condition() { return cond.eval(api); } }.sleep(); } Now you can do: sleep(2000, api -> api.myPlayer().isAnimating());
  22. Yep, some post the source and if there's no source you can just decompile it. Note that a lot of scripts posted there are not the most well-structured programs around, but it's useful to see how the API is being used by others.
×
×
  • Create New...