Jump to content

Botre

Members
  • Posts

    5883
  • Joined

  • Last visited

  • Days Won

    18
  • Feedback

    100%

Everything posted by Botre

  1. This (most of them at least)
  2. Started porting yesterday ;) Of course you'll get a trial!
  3. Scripters get 10 so they can advertise their products. More advertisement = more sales = good for OSBot (considering they get a cut).
  4. When would you like the trial to start ?
  5. 10/10 would bond
  6. #Dext
  7. Maybe this'll help you. http://osbot.org/forum/topic/48602-osbot2-event-node-driven-script-skeleto/
  8. This sentence makes absolutely no sense.
  9. Botre

    Prayers

    Nice Any reason why you use MethodProvider.sleep() instead of Script.sleep() ?
  10. Botre

    Rekt.

    gf'ed
  11. Just revisited the class in question: public static void wholeInventory(Script script, ArrayList<String> exceptionList, boolean dropCondition) throws InterruptedException { if (dropCondition) { Item[] i = script.inventory.getItems(); for (Item inventoryItem : i) { if (!dropCondition) { break; } if ((exceptionList == null || !exceptionList.contains(inventoryItem.getName())) && Arrays.asList(inventoryItem.getDefinition().getActions()).contains("Drop")) { int s = script.inventory.getSlot(inventoryItem); Timer failsafe = new Timer(); while (script.inventory.getSlot(inventoryItem) == s && failsafe.getElapsed() < 5000L) { inventoryItem.interact("Drop"); Script.sleep(Script.random(600, 1200)); } } if (script.inventory.isItemSelected()) { script.inventory.deselectItem(); } } } } public static void inventoryItems(Script script, ArrayList<String> itemList, boolean dropCondition) throws InterruptedException { if (dropCondition) { Item[] i = script.inventory.getItems(); for (Item inventoryItem : i) { if (!dropCondition) { break; } if (itemList != null) { if (itemList.contains(inventoryItem.getName()) && Arrays.asList(inventoryItem.getDefinition().getActions()).contains("Drop")) { int s = script.inventory.getSlot(inventoryItem); Timer failsafe = new Timer(); while (script.inventory.getSlot(inventoryItem) == s && failsafe.getElapsed() < 5000L) { inventoryItem.interact("Drop"); Script.sleep(Script.random(600, 1200)); } } } if (script.inventory.isItemSelected()) { script.inventory.deselectItem(); } } } }
  12. public void dropAll(Script script, ArrayList<String> exceptionList) throws InterruptedException { Item[] i = script.inventory.getItems(); for (Item inventoryItem : i) { if ((exceptionList == null || !exceptionList.contains(inventoryItem.getName())) && Arrays.asList(inventoryItem.getDefinition().getActions()).contains("Drop")) { int s = script.inventory.getSlot(inventoryItem); Timer failsafe = new Timer(); while (script.inventory.getSlot(inventoryItem) == s && failsafe.getElapsed() < 5000L) { inventoryItem.interact("Drop"); Script.sleep(Script.random(600, 1200)); } } if (script.inventory.isItemSelected()) { script.inventory.deselectItem(); } } } Not sure if it's faster considering it relies on the API's interaction method.
  13. Don't mind the .AIOMagic naming, I turned that project into my OSB2 library I'll rename the packages later Come at me haters
  14. Please list all the LOCAL scripts you have been using.
  15. If you have any criticisms / ideas to improve the snippet I'll gladly listen If you are here only to bash on someone trying help and learn then you should probably just leave.
  16. Experience distance: package xp.Botrepreneur; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; public class XpDistance { /** * @author Botrepreneur * @Version: 00.11 */ private static final int[] XP = { 0, 83, 174, 276, 388, 512, 650, 801, 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523, 3973, 4470, 5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031, 13363, 14833, 16456, 18247, 20224, 22406, 24815, 27473, 30408, 33648, 37224, 41171, 45529, 50339, 55649, 61512, 67983, 75127, 83014, 91721, 101333, 111945, 123660, 136594, 150872, 166636, 184040, 203254, 224466, 247886, 273742, 302288, 333804, 368599, 407015, 449428, 496254, 547953, 605032, 668051, 737627, 814445, 899257, 992895, 1096278, 1210421, 1336443, 1475581, 1629200, 1798808, 1986068, 2192818, 2421087, 2673114, 2951373, 3258594, 3597792, 3972294, 4385776, 4842295, 5346332, 5902831, 6517253, 7195629, 7944614, 8771558, 9684577, 10692629, 11805606, 13034431 }; public static int getLevelExperience(int level) { return XP[level - 1]; } public static int getDistanceBetweenLevels(int levelA, int levelB) { int d = 0; if (levelA > levelB) { d = XP[levelA - 1] - XP[levelB - 1]; } else if (levelB > levelA) { d = XP[levelB - 1] - XP[levelA - 1]; } return d; } public static int getXpUntilLevel(Script script, Skill skill, int level) { int d = XP[level - 1] - script.skills.getExperience(skill); return d > 0 ? d : 0; } public static int getXpUntilNextLevel(Script script, Skill skill) { int d = XpDistance.XP[script.skills.getStatic(skill)] - script.skills.getExperience(skill); return d > 0 ? d : 0; } public static int getXpPastCurrentLevel(Script script, Skill skill) { int d = script.skills.getExperience(skill) - XpDistance.XP[script.skills.getStatic(skill) - 1]; return d > 0 ? d : 0; } public static int getPercentageUntilNextLevelFromZero(Script script, Skill skill) { int p = script.skills.getExperience(skill) * 100 / XpDistance.XP[script.skills.getStatic(skill)]; return p > 0 ? p : 0; } public static int getPercentageUntilNextLevelFromCurrentLevel(Script script, Skill skill) { int p = XpDistance.getXpUntilNextLevel(script, skill) * 100 / (XpDistance.XP[script.skills.getStatic(skill)] - XpDistance.XP[script.skills.getStatic(skill) - 1]); return p > 0 ? p : 0; } }
  17. Mainly useful for combat situations with aggressive monsters: package myplayer.Botrepreneur; import java.util.ArrayList; import java.util.List; import java.util.Random; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; public class WhoIsInteractingWithMe { /** * @author Botrepreneur * @Version: 00.21 */ public static List<NPC> getList(Script script) { List<NPC> returnList = new ArrayList<NPC>(); List<NPC> allList = script.npcs.getAll(); if (allList != null && !allList.isEmpty()) { for (NPC npc : allList) { if (npc != null && npc.getInteracting() != null && npc.getInteracting().getName().equals(script.myPlayer().getName())) { returnList.add(npc); } } } return returnList; } public static NPC getRandom(Script script) { List<NPC> list = WhoIsInteractingWithMe.getList(script); return list != null && !list.isEmpty() ? list.get(new Random().nextInt(list.size()) - 1) : null; } public static NPC getClosest(Script script) { double lowestDistance = Double.MAX_VALUE; List<NPC> allList = script.npcs.getAll(); List<NPC> closestList = new ArrayList<NPC>(); if (allList != null && !allList.isEmpty()) { for (NPC npc : allList) { if (npc == null || !npc.exists() || npc.getInteracting() == null || !npc.getInteracting().getName().equals(script.myPlayer().getName())) { continue; } if (npc.getPosition().distance(script.myPosition()) < lowestDistance) { closestList.clear(); closestList.add(npc); lowestDistance = npc.getPosition().distance(script.myPosition()); } else if (npc.getPosition().distance(script.myPosition()) == lowestDistance) { closestList.add(npc); } } } return closestList != null && !closestList.isEmpty() ? closestList.get(new Random().nextInt(closestList.size()) - 1) : null; } }
  18. Does it less or more bugged than OSBot1? More bugs atm. Does it consume less or more CPU? Same performance for me. Does its random solvers flawless? No Will OSBot1 emulator will work flawless in OSBot2? Doubt it. Am I forced to go to OSBot2 now, or can continue use OSBot1? Yes you are forced to go OSB2 So, support of OSBot1 ended? Not yet
  19. Botre

    Uber Dragon

    Cute
×
×
  • Create New...