Jump to content

Explv

Scripter II
  • Posts

    2314
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    100%

Everything posted by Explv

  1. You don't need to download the source code, you can just go to the website: https://explv.github.io/
  2. Look at the API. https://osbot.org/api/org/osbot/rs07/api/Dialogues.html I would recommend using an IDE that handles imports for you.
  3. The MethodProvider class has a bunch of variables in it such as inventory, bank, etc. Your main class that extends Script (which extends MethodProvider) will have these variables set automatically when it is initialized, which is why you can access the OSBot API from onStart() or onLoop() without doing anything. However, when you create a class that extends MethodProvider and initialize it, those variables will not be automatically set. So you need to exchange the context (by calling exchangeContext(Bot bot)) between your instance that does have those variables set, and your other instance that does not. " public MethodProvider exchangeContext(Bot bot) Deprecated. For internal use only. This class and method can be used to create extensions to the API with full direct access to the OSBot 2 API within your extensions. If you create your own extensions you extend the API class or MethodProvider and if you want to provide the existing API components to your own extensions you override this method with a call to this method first by calling super.exchangeContext(bot) followed by the initialization of your own components on which you call this method on. Specified by: exchangeContext in class AbstractMethodProvider<Bot> Parameters: bot - The Bot instance. Returns: The instance of this API extension."
  4. Everything working for you now?
  5. Explv

    Explv's Walker

    Changes were released, let me know if you notice any more freezing. Edit: some changes have been released, some are still pending
  6. Will take a look at these issues asap Thanks
  7. Make sure the positions you are using are walkable, I just web walked from GE to the rune shop & back with no issues.
  8. Explv

    Explv's Walker

    Made some changes that will hopefully prevent freezing, will let you know when released
  9. Yeah fair enough, you don't need those for loops though, you can create a LinkedList<Position> like so: public static final LinkedList<Position> HILLS_PATH = new LinkedList<>( Arrays.asList( new Position(1, 2, 0), new Position(2, 3, 0) ) );
  10. The default min distance threshold is 3, and the default mini map distance threshold is 5 so I don't think he really needs to change those values. Also mini map distance threshold does not affect whether the player walks to the same position or not: "This method sets the property of this walking event that determines whether the next position you're walking to in the path from A to B will be walked to by using the mini map or the main screen. The next location you're walking to is not necessarily the destination of this event, but the next clickable position in the path from A to B. If the distance to the next clickable position is equal or higher than the mini map distance threshold, this event will walk using the mini map. If not, it will use the main screen. The default value of this property is 5." This is correct, can be simplified a little though (and you shouldn't create the LinkedList every time you want to walk) public static final Area HILLS_AREA = new Area(1, 2, 3, 4); public static final LinkedList<Position> HILLS_PATH = new LinkedList<>( Arrays.asList( new Position(1, 2, 0), new Position(2, 3, 0) ) ); public final void someMethod() { WalkingEvent walkingEvent = new WalkingEvent(); walkingEvent.setPath(HILLS_PATH); walkingEvent.setBreakCondition(new Condition() { return HILLS_AREA.contains(myPosition()); }); execute(walkingEvent); } If you don't need to use setBreakCondition or any of the other functions though, then this will do: private static final List<Position> HILLS_PATH = Arrays.asList(new Position(1, 2, 0), new Position(2, 3, 0)); public final void someMethod() { getWalking().walkPath(HILLS_PATH); }
  11. @RagBoys III Looks like the widget text and interaction text are incorrect, it should be "Hard leather" not "Hard Leather", and "Tan All" not "Tan all", the case matters.
  12. Thank you @ThatGamerBlue for adding some labels to the map https://github.com/Explttv/Explv.github.io/pull/3 Much appreciated!
  13. Updated to latest map revision
  14. isSlotVisible takes two different slots as parameters, the tab slot and the absolute slot https://osbot.org/api/org/osbot/rs07/api/Bank.html#isSlotVisible-org.osbot.rs07.Bot-int-int- Right now you are passing absolute slot for both of the parameters, which is incorrect. I don't think there is a public method in the API to get the tab slot, there is a private one though. You can try the following code: public boolean isVisible(int itemID) { return getBank().isSlotVisible(bot, getTabSlot(itemID), getBank().getSlot(itemID)); } private int getTabSlot(final int itemId) { int tabForItem = getBank().getTabForItem(itemId); if (tabForItem == -1) { return -1; } Item[] itemsInTab = getBank().getItemsInTab(tabForItem); for(int i = 0; i < itemsInTab.length; i++) { if(itemsInTab[i] != null && itemsInTab[i].getId() == itemId) { return i; } } return -1; }
  15. Yeah, I guess they changed the boot message. I may be able to work some magic to call onStop. As a temporary workaround, if it's your own script, you could probably add something like Runtime.getRuntime().addShutdownHook(new Thread(() -> onStop())) to your onStart(). If you want to make changes you can just create a pull request and i'll take a look at it Will take a look
  16. Explv

    Explv's Walker

    Web walking does not support paths from and to every position on the map. If this issue occurs, you're probably standing in an unsupported location, or trying to walk to an unsupported location, and need to move your character somewhere else / select a different destination.
  17. Then why not post on their forum? Yes there are websites which you could use to lookup the name from ID for example http://www.itemdb.biz/ (may not support all items though) Not going to spoonfeed you a snippet to do it either
  18. ItemDefinition def = ItemDefinition.forId(id); if (def != null) { String name = def.getName(); } https://osbot.org/api/org/osbot/rs07/api/def/ItemDefinition.html#forId-int-
  19. IntelliJ built-in GUI builder is fine. Best way to do it is writing the code yourself though.
  20. Looks to me like your local script Khal's Staking Overlay, or whatever it's called, is broken (not updated to latest API revision) If you remove that local script it should work. I thought I had updated the manager so that it wouldn't crash if a local script was broken, are you using the latest version? https://github.com/Explv/osbot_manager/releases
×
×
  • Create New...