Jump to content

Apaec

Scripter III
  • Posts

    11174
  • Joined

  • Last visited

  • Days Won

    91
  • Feedback

    100%

Everything posted by Apaec

  1. Hmm, this is certainly a niche situation, but can definitely be done. Might be a little trickier though. Typically, when the players inventory is full of junk so a script cannot run, the script should either terminate and let the player know this, or do something loss-less, such as going to a bank and depositing the junk. Arbitrarily dropping items isn't a great idea in general: what is the inventory was full of godswords? Anyway, to achieve what you're looking for, the default API entries won't seem to provide this functionality. We'll have to create our own filter: (Note that I haven't tested this code and wrote it here in the reply box so there could be errors, let me know if it doesn't work!) if (getInventory().isFull()) { getInventory().dropForFilter(new Filter<Item>(){ @Override public boolean match(Item x) { return !x.getName().equals("Cup of Tea"); } }); }
  2. Sounds like the relevant part of the API to you would be the inventory API: https://osbot.org/api/org/osbot/rs07/api/Inventory.html Something like inventory#dropAllExcept sounds about right. For example: if (getInventory().isFull()) { getInventory().dropAllExcept("Cup of Tea"); }
  3. Both trials started -Apa
  4. Hmm, this might be useful, though I would need a few more lines than just those three. Could you perhaps send me (here or in a PM if you prefer) a slightly longer snippet of the console when this happens? Cheers
  5. Hmm, that's odd, thanks for letting me know. Not sure what might be causing this, as the bank pin solver is an OSBot thing and so the script won't be in control. Next time this happens, please could you see if there is anything unusual displayed in the console logger? (accessed via the settings gear). Let me know -Apa
  6. Sure - trial started Apa
  7. APIs can take a bit of scavenging to find what you need. Useful links are the alphabetical 'index' at the top of the docs, when you are looking for a method but don't know which class it might belong to. Also, the '!' is a negation operator, i.e., if you take something that evaluates to true and negate it with a '!', the result will be false (just thought i'd clear that up as that's unrelated to the OSBot API). It just takes a bit of practice to learn where most things are, as with all APIs. I'd suggest asking for help on specifics when you get stuck (perhaps in the OSBot discord). Good luck!
  8. Sure - trial started! -Apa
  9. Sure thing - trial started! Apa
  10. Sure - trial started Apa
  11. Activated
  12. Sure- trial activated! Apa
  13. Sure thing - trial activated ! Apa
  14. Sure thing - trial started Apa
  15. Sure - trial started Apa
  16. No, but it can cook them thoroughly or poorly. Apa
  17. Sure thing - both trials started Apa
  18. Sure - trial started Apa
  19. Sure -trial started Apa
  20. Ok - I assume a trial - activated! -Apa
  21. Sure - trial activated ! Apa
  22. Yes! That's an option Let me know if you'd be interested in trying it out for yourself. -Apa
  23. Hey, I'm not sure what you mean by this - a trial perhaps? If so, please refer to this thread: https://osbot.org/forum/topic/61445-apa-script-trials Best Apa
  24. Hi all,

    My laptop is going in for repairs tomorrow, this may take up to a week (but should only be a few days). I will be available to answer any questions/offer trials/help as soon as this repair is complete.

    Apa

×
×
  • Create New...