Jump to content

Botre

Members
  • Posts

    5883
  • Joined

  • Last visited

  • Days Won

    18
  • Feedback

    100%

Everything posted by Botre

  1. Ah well, FML You should state that somewhere tbh, so people don't waste their time writing scripts in J8 (which run fine locally btw) and get a bunch of errors thrown in their face by the script manager when they make an SDN upload request, resulting in tedious rewrites. It's extremely frustrating. I'm not sure why you wouldn't make the upgrade but whatever. Feeling salty.
  2. Maxi, would you please consider updating your compiler to Java 8...
  3. 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.
  4. 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()); }
  5. "Threw it away" sure m8 But forealz that suck /:
  6. Then cache the rectangle slots.
  7. l2sleep. new ConditionalSleep(5000, 100) { @Override public boolean condition() throws InterruptedException { return !getTabs().getOpen().equals(Tab.INVENTORY); } }.sleep();
  8. Sleep after you cast the spell. So the script has enough time to process which tab is open.
  9. 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; } }
×
×
  • Create New...