Everything posted by Botre
- I'm back?
- Count To 10,000!
- Count To 10,000!
-
OSBot 2.3.56 - All kinds of things
Maxi, would you please consider updating your compiler to Java 8...
-
Incase you were wondering how much a Scripter makes...
Even the current best selling scripts make peanuts compared to last year. The reason why sales are low is because of the current market model: One time fees + slow growth of potential customers = market dries up. (OSBot is very aware of this, it's why ranks such as VIP have recurrent fees). The only thing you can do as a scripter is to create a script no-one has bought yet. Good luck with that. OSBot should have stuck with the obligatory monthly fee system, it was fair to both script providers and consumers.
- Count To 10,000!
- Count To 10,000!
- Count To 10,000!
- Count To 10,000!
-
Incase you were wondering how much a Scripter makes...
ew
- Count To 10,000!
- Botre AIO Woodcutting devlog
- Count To 10,000!
-
isCharacterFacing(Character<?> character, RS2Object object)
Quickly wrote this, feel free to improve! Precision: 45° You could probably calculate the angle much more precisely, I'll maybe give that a shot another time ^^ public static boolean isCharacterFacing(Character<?> character, Position position) { int rotation = character.getRotation(); Position charPos = character.getPosition(); int xDiff = charPos.getX() - position.getX(); int yDiff = charPos.getY() - position.getY(); // Character position equals position. if (xDiff == 0 && yDiff == 0) { return false; } // Position is east of character. if (xDiff < 0) { if (rotation < 1024) { return false; } } // Position is west of character. else if (xDiff > 0) { if (rotation > 1024) { return false; } } // Position is on the same vertical axis. else { // Position is exactly south of character. if (yDiff > 0) { return rotation < 256 || rotation > 1792; } // Position is exactly north of character. else { return rotation > 762 && rotation < 1286; } } // Position is south of character. if (yDiff > 0) { if (rotation > 512 && rotation < 1536) { return false; } } // Position is north of character. else if (yDiff < 0) { if (rotation < 512 || rotation > 1536) { return false; } } // Position is on the same horizontal axis. else { // Position is exactly east of character. if (xDiff < 0) { return rotation > 1286 && rotation < 1792; } // Position is exactly west of character. else { return rotation > 256 && rotation < 762; } } return true; } public static boolean isCharacterFacing(Character<?> character, RS2Object object) { return isCharacterFacing(character, object.getPosition()); }
-
I just lost $600.00
"Threw it away" sure m8 But forealz that suck /:
- Hello :)
-
Using certain slots help
Then cache the rectangle slots.
-
Using certain slots help
l2sleep. new ConditionalSleep(5000, 100) { @Override public boolean condition() throws InterruptedException { return !getTabs().getOpen().equals(Tab.INVENTORY); } }.sleep();
-
Using certain slots help
Sleep after you cast the spell. So the script has enough time to process which tab is open.
-
Using certain slots help
You could use a for loop like this: package org.bjornkrols.script; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.ui.Spells.NormalSpells; import org.osbot.rs07.script.Script; public class EnchantExample extends Script { private int[] pattern = new int[] {27, 26, 25, 24, 20, 21, 22, 23, 19, 18, 17, 16, 12, 13, 14, 15, 11, 10, 9, 8, 4, 5, 6, 7, 3, 2, 1, 0}; @Override public int onLoop() throws InterruptedException { for (int i = 0; i < pattern.length; i++) { Item item = getInventory().getItemInSlot(pattern[i]); if(item.getName().equals("Sapphire ring")) { if(getMagic().castSpell(NormalSpells.LVL_1_ENCHANT)) { item.interact("Enchant"); } } } return 133 + 7; } }
- How am I doing as a
-
Walking to a single tile not doing anything (localWalker)
public static boolean walkExact(Script script, Position position) { WalkingEvent event = new WalkingEvent(position); event.setMinDistanceThreshold(0); return script.execute(event).hasFinished(); } ^From Xerion or Frostie if I'm not mistaken. Works like a charm
-
How am I doing as a
You're a great not-cba
-
Using certain slots help
Here's what I use, you won't be able to copy/paste it in your project and use it, but it should be somewhat educational nevertheless. package org.bjornkrols.inventory_patterns; import org.bjornkrols.imported.ArrayUtilities; import org.bjornkrols.imported.KnuthShuffle; /** * @author Bjorn Krols (Botre) * @version 0.1 * @since March 15, 2015 */ public final class InventoryPattern { private InventoryPattern() { // This class should never be instantiated. // Do not delete or make accessible. } private static final byte ROWS = 7; private static final byte COLUMNS = 4; private static final byte SLOTS = ROWS * COLUMNS; public static final int[] REGULAR = buildRegularPattern(); public static final int[] SNAKE = buildSnakePattern(); public static final int[] REVERSED_REGULAR = reversePattern(REGULAR); public static final int[] REVERSED_SNAKE = reversePattern(SNAKE); public static int[] getRandomizedPattern() { int[] array = REGULAR; KnuthShuffle.shuffle(array); return array; } private static int[] buildRegularPattern() { int[] array = new int[SLOTS]; for (int index = 0; index < array.length; index++) { array[index] = index; } return array; } private static int[] buildSnakePattern() { int[] array = new int[SLOTS]; byte index = 0; byte value = - COLUMNS - 1; byte row = 0; while (row < ROWS) { if (row % 2 == 0) { value += COLUMNS + 1; for (int iterator = 0; iterator < COLUMNS; iterator++) { array[index++] = value++; } } else { value += COLUMNS - 1; for (int iterator = 0; iterator < COLUMNS; iterator++) { array[index++] = value--; } } row++; } return array; } private static int[] reversePattern(int[] array) { int[] copy = array; ArrayUtilities.reverse(copy); return copy; } // REGULAR // 00 01 02 03 // 04 05 06 07 // 08 09 10 11 // 12 13 14 15 // 16 17 18 19 // 20 21 22 23 // 24 25 26 27 // SNAKE // 00 01 02 03 // 07 06 05 04 // 08 09 10 11 // 15 14 13 12 // 16 17 18 19 // 23 22 21 20 // 24 25 26 27 // M //TODO // 06 07 20 21 // 05 08 19 22 // 04 09 18 23 // 03 10 17 24 // 02 11 16 25 // 01 12 15 26 // 00 13 14 27 // W //TODO // 00 13 14 27 // 01 12 15 26 // 02 11 16 25 // 03 10 17 24 // 04 09 18 23 // 05 08 19 22 // 06 07 20 21 // REVERSED_REGULAR // 27 26 25 24 // 23 22 21 20 // 19 18 17 16 // 15 14 13 12 // 11 10 09 08 // 07 06 05 04 // 03 02 01 00 // REVERSED_SNAKE // 27 26 25 24 // 20 21 22 23 // 19 18 17 16 // 12 13 14 15 // 11 10 09 08 // 04 05 06 07 // 03 02 01 00 } package org.bjornkrols.events; import java.util.Arrays; import org.bjornkrols.inventory_patterns.InventoryPattern; import org.bjornkrols.script.ConditionalSleep; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; /** * @author Bjorn Krols (Botre) * @version 0.6 * @since March 17, 2015 */ public abstract class DropAllEvent extends BotreEvent { private int[] pattern = InventoryPattern.REVERSED_SNAKE; private int iterator; public DropAllEvent(Script script) { super(script); setTimeout(60); } public abstract String[] itemsToDrop(); @Override public int onLoop() { Item item = script.getInventory().getItemInSlot(pattern[iterator]); if (item != null && Arrays.asList(itemsToDrop()).contains(item.getName()) && script.getInventory().interact(pattern[iterator], "Drop")) { new ConditionalSleep(100, 2000) { @Override public boolean condition() { Item item = script.getInventory().getItemInSlot(pattern[iterator]); return item != null; } }; } iterator++; return MethodProvider.random.nextInt(75) + 75; } @Override public void postLoop() { // Reset iterator. iterator = 0; super.postLoop(); } @Override public boolean isFinished() { return iterator >= pattern.length; } }
- ;o