Everything posted by Botre
- Count To 10,000!
- Count To 10,000!
- Count To 10,000!
- Count To 10,000!
-
Intel Yew Chopper [Draynor Village]
if(!getCamera().equals(yewTree)) { getCamera().toEntity(yewTree); } getCamera() Obtains the Camera instance it will never ever return an Entity. If you'd like to know whether or not your object is visible call object.isVisible() private int cameraPitch = (0 - 50); ... if(getCamera().getPitchAngle() != cameraPitch) { getCamera().movePitch(random.nextInt(20) + 5); }else if(getCamera().getYawAngle() != cameraPitch) { getCamera().moveYaw(random.nextInt(25 + 10)); } What's the purpose of this? if(YEW_AREA.contains(myPlayer()) && !myPlayer().isAnimating() && !getInventory().isFull()) return State.CHOP; if(YEW_AREA.contains(myPlayer()) && myPlayer().isAnimating() && !getInventory().isFull()) return State.CHOPPING; Merge these if(YEW_AREA.contains(myPlayer()) && !getInventory().isFull()) return myPlayer().isAnimating() ? State.CHOPPING : State.CHOP; http://en.wikipedia.org/wiki/%3F: There are a few other things I'd do differently, but good job PS: once you are happy with it you should consider making this premium
-
this movie....
lol shit editing
-
RSBuddy/OSBuddy Exchange Price Lookup
nice. close your streams and readers :|
- Count To 10,000!
- Delayed Object Registering
-
Next script is on its way
I could do that and even add task scheduling to it, but for now I just want to make the individual tasks perfect. But it wouldn't be hard at all to do so why not ^^
-
Next script is on its way
I have this partially written already
- Next script is on its way
-
How to find if you changed region?
Thanks!
-
Osbot Members Snapchats
Anne sent me a snap and her prettiness killed my phone. y u so pretty anne y
-
My TreeFilter
One looks good with my logo, the other not so much
-
My TreeFilter
sendMessage(getBrochachos(CoolestBrochachos.APAEC), "no"); Such coincidence
-
My TreeFilter
I wrote this after realizing that calling @getMap().canReach(...) is really expensive. package org.bjornkrols.events; import java.util.HashMap; import java.util.Map; import org.bjornkrols.script.BotreMethodProvider; import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; /** * @author Bjorn Krols (Botre) * @version 0.2 * @since March 26, 2015 */ public class TreeFilter implements Filter<RS2Object> { /** * The script instance. */ private final Script script; /** * The tree's name. */ private String name; /** * The chop radius's center. */ private Position chopCenter; /** * The chop radius. */ private int chopRadius; /** * <Position, reachable && in range> */ private Map<Position, Boolean> validityMap; public TreeFilter(final Script script) { this.script = script; validityMap = new HashMap<Position, Boolean>(); } @Override public boolean match(RS2Object o) { if (!BotreMethodProvider.isValid(o)) return false; if (!o.hasAction("Chop down")) return false; if (!o.getName().equals(name)) return false; Position p = o.getPosition(); if (validityMap.containsKey(p)) return validityMap.get(p); validityMap.put(p, chopCenter.distance(o) < chopRadius && script.getMap().canReach(o)); return validityMap.get(p); } public String getName() { return name; } public void setName(String name) { this.name = name; } public Position getChopCenter() { return chopCenter; } public void setChopCenter(Position chopCenter) { this.chopCenter = chopCenter; } public int getChopRadius() { return chopRadius; } public void setChopRadius(int chopRadius) { this.chopRadius = chopRadius; } }
-
How to find if you changed region?
Nope. The last method could work but you'd have to check every 300 milliseconds. The first one just doesn't work. I just want an id/config/hash method.
-
How to find if you changed region?
You could probably do it via getClippingPanes() but f that. getTiles() is super confusing. Each region should return a proper identifier / hash imo..
-
How to find if you changed region?
getRegion() always returns the same hash and equals always returns true.
-
Osbot Members Snapchats
Mine is: drmstrm
- Anne4Red
-
ConditionalLoop class
A quick example of a ConditionalLoop class. The API one is great and I suggest you use that one, this is more for learning purposes. package org.bjornkrols.conditional; import org.bjornkrols.imported.MilliTimer; /** * @author Bjorn Krols (Botre) * @version 0.1 * @since March 26, 2015 */ public abstract class ConditionalLoop extends Thread { /** * This loop's timer (millisecond precision). */ private MilliTimer timer; /** * The maximum (exclusive) time of looping, in milliseconds, after which the loop will be broken. */ private int timeout; public ConditionalLoop(final int timeout) { setDaemon(true); setTimeout(timeout); } /** * A no-argument constructor with a default timeout of 10 seconds. */ public ConditionalLoop() { this(10000); } @Override public void run() { preLoop(); while (condition()) { if (timer.getElapsedMilliSeconds() > timeout) { onTimeout(); break; } try { Thread.sleep(onLoop()); } catch (InterruptedException e) { e.printStackTrace(); } } postLoop(); } /** * @return Whether to continue to loop. */ public abstract boolean condition(); /** * Executes before the loop starts. */ public void preLoop() { timer = new MilliTimer(); }; /** * The actual loop. * * @return The time to sleep for, in milliseconds, after each iteration. */ public abstract int onLoop(); /** * Executes after the loop. */ public void postLoop() { }; /** * Executes when the loop has timed out. */ public void onTimeout() { } /** * Sets the timeout (in milliseconds). * * @param milliseconds The time out (in milliseconds). */ public void setTimeout(int milliseconds) { timeout = milliseconds; } }
- ExperienceTable Class / snippet
- Woodcutting Axe Enum [Snippet]