Jump to content

DCHILLING

Members
  • Posts

    8
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DCHILLING's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. Thank you both for the information
  2. I am trying to use some fish on a fire in order to cook it, and it works if nothing is in the way, but with an NPC over an RS2Object it doesn't and so the functions need to be improved: public void interactInventoryEntity(EEntities e1, EEntities e2, EAction action, EAnimations sleepingAnimation) { if (!widgetHandler.isTabOpen(Tab.INVENTORY)) { widgetHandler.openTab(Tab.INVENTORY); } if (inventoryHandler.containsByIndex(e1)) { t1 = inventoryHandler.interactItem(e1, action); if (t1) { t1 = false; t2 = entityHandler.getRS2Object(e2.getEntityIndex()).interact(); } if (t2) { t2 = false; CSleep.sleepUntil(() -> script.myPlayer().getAnimation() == sleepingAnimation.getAnimationId(), 4000); CSleep.sleepUntil(() -> script.myPlayer().getAnimation() == -1, 9000); } } } The interact function is from the api, and the entityHandler function is this: public RS2Object getRS2Object(int id){ return script.getObjects().closest(id); } Then I pass the fire entity to the function FIRE("Fire", 26185), interactInventoryEntity(EEntities.FISH, EEntities.FIRE, EAction.INTERACTION_USE, EAnimations.ANIMATION_COOKING_ON_FIRE); So it selects the fish okay, clicks on the NPC instead of selecting the fire and then sleeps for 4 seconds Does interact() without parameters always left click?
  3. Hello, I've been writing a script and while testing an NPC walked over the same tile where the object was. The script tried interacting left click -> left click, but it kept clicking the NPC on the second click, not opening the context menu. I found this class InteractionEvent in the Osbot API, but I am unsure if this would help. Maybe adding an action to the "interact()" would help, but I don't know what the "->" action stands for (indicated in the top left corner in the game). Relevant snippet: entityHandler.getRS2Object(e2.getEntityIndex()).interact(); On another note, I only found one topic on invokes I was wondering if anyone could share an example on how to send an action (invoke action) on some kind of entity? Since Gunman's code there is hidden behind his own custom class.
  4. To get a list you need to collect the objects like so List<RS2Object> objectsNearby = mp.getObjects().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList());
  5. Do you know of a way to discard this cache? I've got scripts where walking is infrequent or is used once to get in position. It would be really nice to have as much memory on the machine to accompany as many bots possible
  6. You can see your scripts in your client if you have your scripts' .jar files in the scripts directory
  7. If you're on intellij: Under File -> Project Structure... -> Artifacts you need create a new empty jar by pressing the "+" button. Then add compile output to the jar by double clicking it under the available elements tab. Once it is added, in the output path give the osbot directory for scripts. After you apply the changes and exit the window, under Build -> Build artifacts... -> Build. After that the script should appear in osbot client.
  8. Hello OSBot community, I'm making my second script, which includes fishing and cooking with banking. I've seen answers to other optimization posts, that web walking accounts for most of the memory usage when running a script. Is this true? If so, does garbage collector discard this resource or do I need some special way of removing it if it is not used? Also, does returning higher waiting values in onLoop() function make the script less demanding or just slower?
×
×
  • Create New...