Everything posted by FrostBug
-
Quick-Hopper
return list.isEmpty() ? null : list.get(random(list.size()));
-
Better Magic API
if (highAlch.canUse()) { highAlch.canUse(); } EDIT: Also, make a rune requirement enum, you lazy bum
-
Weird ClassNotFound Error?
The users would need the libraries as well, which they do not have. You'll need to include the library sources or remove the library
-
runecrafting
Probably has configs, try playing around with the clients config debugger tool
-
Fruity Barrows (Frost Barrows)
You have to specify equipment to use against all enemy types.
-
Fruity Barrows (Frost Barrows)
Looks like the update broke some things, thanks for reporting it. I just pushed a hotfix, should be live within 12 hours
-
Best way to generate Loot list?
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
-
Fruity Barrows (Frost Barrows)
live:frostbug_1
-
Fruity Barrows (Frost Barrows)
I can't reproduce the issue, can you add me on skype?
-
FrostHunter
Please show the logger output
-
How can I Interrupt a webwalk?
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.
-
FrostHunter
Not too sure; what did it say in the logger?
-
How can I Interrupt a webwalk?
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.
-
Error with webwalking maybe? Doesn't say.
Looks like you're just stopping the script? And the thread is killed as a result since it's busy.
-
Anyone here hold jobs?
Developer at an IT consulting company Also student
-
GUI Fonts?
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
-
Anyone got the code for GetImage?
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; }
-
i love maldesto
No template, no like
-
Monday funday?
Thursday is the supposed "Bot if you want to be banned" day
-
walker.waituntilIdle() alternative
the sleep method in ConditionalSleep returns true if the condition was met before it timed out
-
walker.waituntilIdle() alternative
Yes^
-
walker.waituntilIdle() alternative
Seems like it was removed from the documentation for some reason; my bad. You can still use it, though. It has not been deprecated
-
walker.waituntilIdle() alternative
You're not looking very hard then. new ConditionalSleep(TIMEOUT_IN_MS) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isMoving(); } }.sleep();
-
Detecting change of an integer's value
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
-
walker.waituntilIdle() alternative
ConditionalSleep? You'll have to define what 'idle' is, though.