ybs 3 Share Posted September 2, 2020 Hi, I'm new to scripting and wrote the below after looking at some posts about potting. I need help on how to make the number "67" change every time I gain a level (at the next level, I would want to pot at 68 instead). Is there an easier way to write this? The script below is basically saying that every time my level goes below 67 (after potting), then re-pot. if (getSkills().getBoostedLevels(Skill.ATTACK) <= 67) { if(getInventory().get(item -> item!=null && item.getName().contains("Combat")).interact("Drink")); } Any help is appreciated! Link to comment Share on other sites More sharing options...
RetroBot 35 Share Posted September 2, 2020 Instead of using 67 you could use getSkills().getRealLevel(Skill.ATTACK) + number for something like that. For example your attack is currently 65 and you wanted to boost it if its <= 67 so you would do getSkills().getRealLevel(Skill.ATTACK) + 2. Then when it levels up it to 66 it will boost it if <= 68 and so on. Link to comment Share on other sites More sharing options...
ybs 3 Author Share Posted September 3, 2020 1 hour ago, RetroBot said: Instead of using 67 you could use getSkills().getRealLevel(Skill.ATTACK) + number for something like that. For example your attack is currently 65 and you wanted to boost it if its <= 67 so you would do getSkills().getRealLevel(Skill.ATTACK) + 2. Then when it levels up it to 66 it will boost it if <= 68 and so on. Thank you, I'm going to try it this way, I think I was over complicating it. Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted September 3, 2020 You could do what Retro said, or if you wanted to increment in a percentage then you could do that too. (pots scale so may be more efficient that way). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.