Jammer Posted January 19, 2018 Share Posted January 19, 2018 (edited) Wrote some potion data. The potion class is missing some methods but I'm sure you can add them yourself. It should be possible to add other boosting items like brews and such. constructive criticism is welcome. Potion class: package data; import wrappers.IncreaseValue; import wrappers.PotionInfo; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.MethodProvider; public class Potions { public enum Potion{ ATTACK_POTION( new PotionInfo() .add(Skill.ATTACK , new IncreaseValue(3,10))), SUPER_ATTACK( new PotionInfo() .add(Skill.ATTACK, new IncreaseValue(5,15))), STRENGTH_POTION(new PotionInfo() .add(Skill.STRENGTH, new IncreaseValue(3,10))), SUPER_STRENGTH(new PotionInfo() .add(Skill.STRENGTH, new IncreaseValue(5,15))), COMBAT_POTION(new PotionInfo() .add(Skill.STRENGTH, new IncreaseValue(3,10)) .add(Skill.ATTACK , new IncreaseValue(3,10))), SUPER_COMBAT_POTION(new PotionInfo() .add(Skill.ATTACK, new IncreaseValue(5,15)) .add(Skill.ATTACK, new IncreaseValue(5,15)) .add(Skill.DEFENCE , new IncreaseValue(5,15))), DEFENCE_POTION(new PotionInfo() .add(Skill.DEFENCE , new IncreaseValue(3,10))), SUPER_DEFENCE(new PotionInfo() .add(Skill.DEFENCE , new IncreaseValue(5,15))), RANGING_POTION(new PotionInfo() .add(Skill.RANGED , new IncreaseValue(3,10))), SUPER_RANGING(new PotionInfo() .add(Skill.RANGED, new IncreaseValue(5,15))), MAGIC_POTION(new PotionInfo() .add(Skill.MAGIC, new IncreaseValue(3,10))), SUPER_MAGIC(new PotionInfo() .add(Skill.MAGIC, new IncreaseValue(5,15))), PRAYER_POTION(new PotionInfo() .add(Skill.PRAYER, new IncreaseValue(7,25))); PotionInfo potionInfo; Potion( PotionInfo potionInfo) { this.potionInfo = potionInfo; } public PotionInfo getPotionInfo() { return potionInfo; } public String getPotionName() { String lower = super.toString().toLowerCase().replace("_", " "); return Character.toUpperCase(lower.charAt(0)) + lower.substring(1); } } IncreaseValue class: package wrappers; public class IncreaseValue { int baseIncrease; int percentageIncrease; public IncreaseValue(int baseIncrease, int percentageIncrease) { this.baseIncrease = baseIncrease; this.percentageIncrease = percentageIncrease; } public int getBaseIncrease() { return baseIncrease; } public int getPercentageIncrease() { return percentageIncrease; } } PotionInfo class: package wrappers; import java.util.HashMap; import java.util.Map; import wrappers.IncreaseValue; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.MethodProvider; public class PotionInfo { Map<Skill, IncreaseValue> boostMap = new HashMap(); public PotionInfo add(Skill skill, IncreaseValue levelIncrease) { boostMap.put(skill, levelIncrease); return this; } } Edited January 19, 2018 by Jammer 1 Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted January 19, 2018 Share Posted January 19, 2018 (edited) Thanks for sharing and contributing to the Community Maybe it could also come in handy to place the in-game name as a String, in case of banking? Edited January 19, 2018 by Eagle Scripts Quote Link to comment Share on other sites More sharing options...
Jammer Posted January 19, 2018 Author Share Posted January 19, 2018 16 minutes ago, Eagle Scripts said: Thanks for sharing and contributing to the Community Maybe it could also come in handy to place the in-game name as a String, in case of banking? In the enum? Is there an advantage of doing that instead of the getPotionName method? Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted January 19, 2018 Share Posted January 19, 2018 26 minutes ago, Jammer said: In the enum? Is there an advantage of doing that instead of the getPotionName method? My apologies, I looked at it a bit too swiftly. I was referring to something like the #getPotionName indeed. Well done Quote Link to comment Share on other sites More sharing options...