Jump to content

Botre

Members
  • Posts

    5883
  • Joined

  • Last visited

  • Days Won

    18
  • Feedback

    100%

Everything posted by Botre

  1. 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
  2. You're a great not-cba
  3. 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; } }
  4. Botre

    ;o

    :Maldoge:
  5. Botre

    MirrorClient v1.04

    neatski
  6. Obviously :x :x Ofcourse you did. You were supposed to say 11/10 would bang. I cry every time.
  7. It's finished guys :x Go show your love here: http://osbot.org/forum/topic/64749-free-chop-drop-woodcutting-open-source/?p=710962 Obviously going to be free
  8. 1490
  9. My man ;) My man ;)
  10. I've never scammed. But... Would I scam a random person for a million dollars if I were 100% sure I'd get away with it? Probably. But scamming on OSBot? Nah that's just sad, if I desperately needed 100$ I'd find another way to get them.
  11. I don't watch the show for her. But yeah I agree :x I don't watch the show for her. But yeah I agree :x
  12. It's already happening all over the place Alek. A fair system could be found for everyone, by forbidding these all you're doing is excluding yourself from this market, just saying. I don't get why you are so stubborn about it when there are successful implementations of such systems all over the landscape.
  13. I watch my big bang theory episodes on a similar machine
  14. There's nothing athletic about watching sports on television.
  15. 1486
  16. Can someone please PM me the contents of that thread, I don't have access to the forum in question....
  17. 1484
  18. I'm currently reading "Catch-22", "Effective java" and "Java killer game programming". After "Catch-22" I plan on reading "Under the Dome", I've never actually read a Stephen King novel because I used to think of him as too much of a "pulp" author, but the plot of this particular one really intrigues me. It'd also like to read "Neuromancer" sometime soon. Oh and "Live From New York, An Uncensored History of Saturday Night Live" (another non-fiction one).
  19. Fuck basketball, I want my Big Bang Theory episode.
  20. 1478
  21. 1476
×
×
  • Create New...