Jump to content

FrostBug

Scripter III
  • Posts

    3967
  • Joined

  • Last visited

  • Days Won

    5
  • Feedback

    100%

Everything posted by FrostBug

  1. Your way of doing it is not really incorrect. Tho I find it highly strange that you do the same thing in 2 very different ways in those 2 halves of the if statement.. The else block has a bunch of unnecessary array/list conversions. You can avoid all the conversions using an approach like such: String[] itemArr = new String[Constants.ARMOR.length + Constants.TOKENS.length]; System.arrayCopy(Constants.ARMOR, 0, itemArr, 0, Constants.TOKENS.length); System.arrayCopy(Constants.TOKENS, 0, itemArr, Constants.ARMOR.length, Constants.TOKENS.length); return itemArr; (wrote that out in hand, mite have some typos). Do what you want tho, the difference in performance wont be noticable if its just gonna be used once
  2. I can't reproduce the issue, can you add me on skype?
  3. FrostBug

    FrostHunter

    Please show the logger output
  4. Run it on the same client version as you're compiling against. Also please don't perform actual interactions within a condition. Do it after the condition interrupts the walker.
  5. FrostBug

    FrostHunter

    Not too sure; what did it say in the logger?
  6. The reasons this doesn't work are too many to list. Don't create your own webwalker, use the one osbot has made for you. INodeRouteFinder nodeFinder = INodeRouteFinder.createSimple(); WebWalkEvent evt = new WebWalkEvent(nodeFinder, position); evt.setBreakCondition(new Condition() { @Override public boolean evaluate() { return getObjects().closest("Gate") != null; } }); execute(evt); In addition to this however, you also need to check that you're on the wrong side of the gate. Otherwise it's gonna keep breaking and going thru the gate even after passing it.
  7. Looks like you're just stopping the script? And the thread is killed as a result since it's busy.
  8. Developer at an IT consulting company Also student
  9. If you load it from a resource included in your jar, then you're fine. If you simply specify the font name/family, it will look for it in the system running the script. If it can't find it, it'll probably fall back to its default font
  10. You should promote loose coupling where you can. The majority of image drawing methods in Graphics2D (mostly inherited from Graphics) take Image, as they do not require any specific methods located in BufferedImage. For this reason, returning Image is the less restrictive option. Saying that people should return BufferedImage just because that's the specific implementation of the Image is pretty much your own preference. Would you also use LinkedList or ArrayList as a return type rather than List? It's fine if you do, but at least when writing API for others to use, you should use the highest level class or interface you can. Also to add to the 3 (identical) previous answers; some image hosts may have browser checks to prevent automated use. This can be bypassed by adding the User-Agent property. public static Image loadImageByURL(String surl) { Image img = null; try { URL url = new URL(surl); URLConnection urlc = url.openConnection(); urlc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"); img = ImageIO.read(urlc.getInputStream()); } catch (IOException ex) { Logger.getLogger(ResourceLoader.class.getName()).log(Level.SEVERE, null, ex); } return img; }
  11. Thursday is the supposed "Bot if you want to be banned" day
  12. the sleep method in ConditionalSleep returns true if the condition was met before it timed out
  13. Seems like it was removed from the documentation for some reason; my bad. You can still use it, though. It has not been deprecated
  14. You're not looking very hard then. new ConditionalSleep(TIMEOUT_IN_MS) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isMoving(); } }.sleep();
  15. uh.. you define the old one the same was as you would the new one. You only really need one variable Alternatively, it might be possible to do it async using a config listener
  16. ConditionalSleep? You'll have to define what 'idle' is, though.
  17. It's probably not gonna be easy to have it do a callback to some listener; so your only options are something to have asynchronous checks on the value, or just check it in onloop as kevzilla suggested
  18. Don't create a new doorhandler instance; use the one in your Script class. If you want to create a new doorhandler instance, you have to exchange contexts with it before using it.
  19. Starting all 3 now Please check every step in the troubleshooting section; lmk if that doesn't help.
  20. As soon as it drops below the number specified in 'minimum casts', yes.
  21. You can cancel it either from the Client Area of this website, or through the subscription in your paypal control panel
×
×
  • Create New...