Jump to content

Apaec

Scripter III
  • Posts

    11152
  • Joined

  • Last visited

  • Days Won

    91
  • Feedback

    100%

Everything posted by Apaec

  1. You could use a Map for this, however if you wanted to store more information, you would need something else. Probably your best bet is to store the information in an enum, as below (I wrote the code in the reply box so apologies if I made any mistakes, fingers crossed they should be easy enough to correct!). I included an additional parameter, 'colour', which is just the colour of the axe. In practice this is useless, but I included it to illustrate how to add a second parameter. public enum Axe { BRONZE(1, Color.BROWN), IRON(1, Color.DARK_GRAY), RUNE(41, Color.CYAN); // Add all axes here private final int levelRequirement; private final Color colour; Axe (int levelRequirement, Color colour) { this.levelRequirement = levelRequirement; this.colour = colour; } // Returns whether the current level is sufficient for the axe public boolean hasRequiredLevel(int currentLevel) { return currentLevel >= levelRequirement; } // Returns the associated level requirement public int getRequiredLevel() { return levelRequirement; } // Returns the colour of the axe public Color getColour() { return colour; } // Make it return a cleanly formatted String, e.g 'Rune' public String getTier() { String lower = super.toString().toLowerCase().replace("_", " "); return Character.toUpperCase(lower.charAt(0)) + lower.substring(1, lower.length()); } // Make it return a cleanly formatted String for whole axe, e.g 'Rune axe' public String getName() { return getTier() + "axe"; } @Override public String toString() { return getName(); } } Usage: Axe toUse = Arrays.stream(Axe.values()).filter(a -> a.hasLevelRequirement(getSkills().getStatic(Skill.WOODCUTTING))).reduce(Axe.BRONZE, (a, b) -> b); It is untested but it should hopefully work !! Good luck! Apa
  2. Apologies, I must have entered the wrong script ID! I've given you a fresh trial starting now, which will last for 48 hours instead of 24, as compensation. Sorry about that...! Apa
  3. Just a super quick status update, I've been very busy at the moment doing some contractor work but I found the time today to have a quick look at the (work in progress) script re-write. The structure is pretty much there so I just need to gather some game data (Areas, paths, positions etc), and once that's done the script should be ready to go. I will do a bit more work on the script today while I have the time, but there's still quite a way to go. I'm structuring the script to maximise both reliability and flexibility - something that isn't really that easy to do - I'm also doing it in such a way that in the future it will be easy to add new routes to the bank and new methods of banking (e.g phials). Cheers Apa
  4. Nice work! Just a few tips - Firstly, be sure to check out Conditional Sleeps https://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html (Note that the class is abstract so you will have to provide your own implementation, anonymous or otherwise). They will help cut slack time in your script, and make your script suitable for SDN application! Secondly, perhaps you have considered not using static widget child ids? I noticed that when you're checking for widgets in your 'getState()' method, you check for child and grandchild ids; since these values often change, it is advised to use other filters like perhaps checking for the presence of text. Since the parent id rarely (if ever) changes when new content is added, you should be able to refine your filters by providing the root id as a parameter to the Widgets#containingText method. Again, you will probably need to do this for SDN submission. Finally, maybe add a paint? (: Keep it up Apa
  5. Hopefully it lives up to your expectations (:
  6. Hey! I've started a 24h trial on your account; the script is currently up and running well! Cheers Apa
  7. Woo, thanks for the awesome proggie! Glad the script is living up to your expectations (: Apa Hi cjbrown, thanks for getting in touch. Unfortunately the store is handled by OSBot and as a result I have no power to access payments/give scripts. That being said, the process is normally more or less instant when purchasing a script - If you still don't have the script and you didn't pay via e-cheque (these can take up to a week to process i've heard), then i'd suggest getting in contact with the community administrator @Maldesto and explaining the situation to him - he will be able to help! Apa
  8. Lifetime - no monthly costs what-so-ever!! (:
  9. Hey, I gave you the trial a couple days ago, which expired yesterday. It looks like you managed to get some good use out of it so unfortunately I cannot offer you another trial! Cheers Apa
  10. Ofcourse, done - enjoy! (:
  11. Sure thing, done! Yeah, this is a mirror issue (see the main thread for details) - I would highly suggest switching over to Stealth Injection permanently! Apa
  12. Ah, apologies - it looks like you've already had a trial which is why the request failed; here's the time stamp of your previous trial, with just over 5 hours of usage on record: 2017-09-16 16:47:57 UTC Unfortunately I cannot give out multiple trials as i'm sure you can understand, sorry about that! Apa
  13. Trouble is, if I made a separate counter for HP exp then people would think the other counter did not include it, and if it did not include hp then people would still have to do maths to add them up. I would have liked to add a counter for each skill but there's not much space to do that; I could perhaps add it to the progress bars though. Apa
  14. I use eclipse, but they're all just as good as each other really. The key is to learn how to use it properly, and stick with it from there. It's worth considering whether or not it's easy to get your projects out of the IDE as well
  15. Isn't hp exp combat exp? I mean there's nothing stopping me separating it, but the point is that it shows the total exp you've gained, not specifically the exp you've gained in one skill! Started! (:
×
×
  • Create New...