Everything posted by Botre
-
ConditionalSleep class
A quick example of a ConditionalSleep 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 16, 2015 */ public abstract class ConditionalSleep { /** * The time in milliseconds to sleep for per loop. */ private final int sleep; /** * The maximum (exclusive) time of sleep, in milliseconds, after which the sleep loop will be broken. */ private final int timeout; /** * @param sleep The time in milliseconds to sleep for per loop. * @param timeout The maximum (exclusive) time of sleep in milliseconds after which the sleep loop will be broken. */ public ConditionalSleep(final int sleep, final int timeout) { this.sleep = sleep; this.timeout = timeout; } /** * @return Whether to continue to sleep. */ public abstract boolean condition(); /** * Sleeps until the condition returns false or the timeout is reached. */ public void sleep() { MilliTimer timer = new MilliTimer(); while (condition() && timer.getElapsedMilliSeconds() < timeout) { try { Thread.sleep(sleep); } catch (InterruptedException e) { e.printStackTrace(); } } } } Implementation example: // Wait while moving or making fire. new ConditionalSleep(300, 5000) { @Override public boolean condition() { return script.myPlayer().isMoving() || script.myPlayer().getAnimation() == FIREMAKING_ANIMATION; } }.sleep();
-
Botre AIO Woodcutting devlog
ARCHIVE: DAYS 1 - 11 Day 11 Skipped a couple of days of updating, had to do some school work / other programming. I managed to work on a couple of features though. Improved firemaking algorithm. Fletching product enum. Added support for fletching. Smart world hopping system. Custom experience tracker. Day 10.5 Improved firemaking, I'm still workin on an algo for optimized pathing. Tidied up a lot of code and started packing classes correctly. A lot of restructuring for more efficient coding. Day 10 Skipped day 9, working on a framework for more efficient scripting. Day 8 Added rudimentary support for firemaking. Day 7.5 Added log type to tree enum for smarter dropping. Significantly faster dropping. New proggy record. Day 7.25 Added randomized drop pattern. Wrote an RSWorld class to facilitate hopping. Added world hopping behavior. Improved the tree scanner (~15% faster). Added minimap drawing. Edited paint. Day 7 Wrote a simple Tree enum. Day 6.5 Started working on a PolyArea debugger / creator, as of know it only takes text input but I'll probably add drawing tools (main screen / minimap screen / rs map). Day 6.0 Client was down + not in the mood to script.Day 5.0 Not much coding done, got the first >12h proggy though. Day 4.5 Optimized RSExperienceTable Optimized tree focusing and interaction. First >9h proggy. Day 4 Code clean-up. Optimized paint data calculations. Added reversed dropping pattern. Day 3.5 Improved camera logic. Tidied up interaction logic. First >4h proggy. Day 3 Added experience and time till next level. Added "snake" drop order. Day 2.5 Custom stream-based object scanning. Improved distance calculations to get closest objects. Wrote an experience table class (snippet here). Day 2 Multithreaded object scanning. Efficient in-path tree retargeting. Camera fail-safes. Day 1.5 Improved tree detection (reachability and action fail-safes). Separated tree search and chop logic. Reduced time spent chopping stumps vastly. Smartened up camera and mouse behavior for efficiency. Wrote random/shuffled drop method. First >2h proggy. Day 1 Text input interface. Tree type prioritization. Log dropper. Tree chopper. Dialogue handler. Energy handler. Basic paint calculations (calculations, conversions, distributions). Log counter.
- Silly duck
- Count To 10,000!
- Count To 10,000!
-
Flexible Script Deals
I like the idea of packages. Limited times of usage could work if the pricing is correct. As long as scripters don't end up losing money (there isn't much left to lose as it is).
- An improved section for scripting.
- Count To 10,000!
-
Woodcutting Axe Enum [Snippet]
I can't think of an example other than being attacked tbh. Better safe than sorry I guess :x
-
Woodcutting Axe Enum [Snippet]
I got them from another site and it seems like they haven't changed in ages so I think they are relatively safe to use. isAnimating() isn't specific enough for some of my need so... :p
-
Woodcutting Axe Enum [Snippet]
package org.bjornkrols.woodcutting; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; /** * @author Bjorn Krols (Botre) * @version 0.1 * @since March 15, 2015 */ public enum Axe { BRONZE(1, 1), IRON(1, 1), STEEL(6, 5), BLACK(6, 10), MITHRIL(21, 20), ADAMANT(31, 30), RUNE(41, 40), DRAGON(61, 60); private final String name; private final int requiredWoodcuttingLevel; private final int requiredAttacklevel; private Axe(final int requiredWoodcuttingLevel, final int requiredAttacklevel) { String temp = super.toString().toLowerCase().concat(" axe"); name = Character.toUpperCase(temp.charAt(0)) + temp.substring(1); this.requiredWoodcuttingLevel = requiredWoodcuttingLevel; this.requiredAttacklevel = requiredAttacklevel; } public String getName() { return name; } public int getRequiredWoodcuttingLevel() { return requiredWoodcuttingLevel; } public boolean canUse(Script script) { return requiredWoodcuttingLevel <= script.getSkills().getDynamic(Skill.WOODCUTTING); } public int getRequiredAttackLevel() { return requiredAttacklevel; } public boolean canWield(Script script) { return requiredAttacklevel <= script.getSkills().getDynamic(Skill.ATTACK); } @Override public String toString() { return getName(); } }
- Count To 10,000!
-
Hello
Those didn't count. This one did though.
-
Hello
I know you are but what am I? gf my pants Should have called it "Hungry Hobos".
- Hello