Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Drink potion at different level as you gain levels


    ybs

    Recommended Posts

    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

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.