February 15, 20187 yr >C< Prayer potion drinker Basic script that drinks prayer potions when prayer points have reached desired prayer point to re-pot at. Script will prioritise lower doses first. (E.g: Will drink a potion with 1 dose before a potion with 3 doses). If inventory contains no doses of prayer potion it will stop. Also supports an option to drink Super restores instead! Download: http://www.mediafire.com/file/gdcmv404p9k1drc/Castro - Prayer potion drinker v0.3.jar Source: https://pastebin.com/VT4V6iDx Older versions: Old downloads: Spoiler V0.1 - http://www.mediafire.com/file/ircxhm9w3l5un9m/Castro - Prayer potion drinker.jar V0.2 - http://www.mediafire.com/file/200227edssz4084/Castro - Prayer potion drinker v0.2.jar Old sources: Spoiler V0.1 - https://pastebin.com/PMGV9RzD V0.2 - https://pastebin.com/6vZA19gk Edited February 15, 20187 yr by Castro_ Added an option for Super restores
February 15, 20187 yr Author 1 minute ago, Severide said: Did you just make this within like 5minutes? haha Was bored and saw someone wanted one so I thought I'd do it
February 15, 20187 yr Just now, Castro_ said: Was bored and saw someone wanted one so I thought I'd do it Jesus, quick off the mark, good job man!
February 15, 20187 yr Author 1 minute ago, Severide said: Jesus, quick off the mark, good job man! Thank you
February 15, 20187 yr nice, personally i use randomised prayer drinking values like below but nice release: if (getSkills().getDynamic(PRAYER) < prayerValue) { pray();//pray } public void pray() { Filter<Item> prayPotionFilter = item -> item.getName().contains("Prayer"); Item prayPotion = getInventory().getItem(prayPotionFilter); int a = getSkills().getDynamic(PRAYER); if (prayPotion.interact("Drink")) { //attack new ConditionalSleep(3000, 300) { //sleep for 3 seconds or until the condition is true @Override public boolean condition() throws InterruptedException { return getSkills().getDynamic(PRAYER) > a; } }.sleep(); } prayerValue = random((int)(getSkills().getStatic(PRAYER) *0.2), (int)(getSkills().getStatic(PRAYER) *0.7)); }
February 15, 20187 yr Author Just now, scriptersteve said: nice, personally i use randomised prayer drinking values like below but nice release: if (getSkills().getDynamic(PRAYER) < prayerValue) { pray();//pray } public void pray() { Filter<Item> prayPotionFilter = item -> item.getName().contains("Prayer"); Item prayPotion = getInventory().getItem(prayPotionFilter); int a = getSkills().getDynamic(PRAYER); if (prayPotion.interact("Drink")) { //attack new ConditionalSleep(3000, 300) { //sleep for 3 seconds or until the condition is true @Override public boolean condition() throws InterruptedException { return getSkills().getDynamic(PRAYER) > a; } }.sleep(); } prayerValue = random((int)(getSkills().getStatic(PRAYER) *0.2), (int)(getSkills().getStatic(PRAYER) *0.7)); } Thank you! and I was thinking about adding randomisation, I may do in the future :P
February 15, 20187 yr 6 minutes ago, Castro_ said: Thank you! and I was thinking about adding randomisation, I may do in the future :P Nw, there are a few different ways to add randomisation, i quite liked the above as it means it's different for each account running the script rather than hard coding say 10 to 30
February 15, 20187 yr Also allows for occasional double drinking especially with higher prayer levels which I think is really nice
February 15, 20187 yr Your logic for selecting which pot to drink could be simplified: Optional<Item> prayerPotion = Arrays.stream(getInventory().getItems()) .filter(item -> item != null && item.getName().startsWith("Prayer potion")) .min(Comparator.comparing(Item::getName)); if (prayerPotion.isPresent()) { Item pot = prayerPotion.get(); }
February 15, 20187 yr 17 minutes ago, jonny1179 said: Your logic for selecting which pot to drink could be simplified: Optional<Item> prayerPotion = Arrays.stream(getInventory().getItems()) .filter(item -> item != null && item.getName().startsWith("Prayer potion")) .min(Comparator.comparing(Item::getName)); if (prayerPotion.isPresent()) { Item pot = prayerPotion.get(); } Does that get the first item starting with Prayer potion? ty
February 15, 20187 yr 8 minutes ago, H0rn said: Does that get the first item starting with Prayer potion? ty This gets the prayer potion with the lowest dose first, cause it's ordered by name. Prayer pot(1) comes before Prayer pot(2)
February 15, 20187 yr 5 minutes ago, nosepicker said: This gets the prayer potion with the lowest dose first, cause it's ordered by name. Prayer pot(1) comes before Prayer pot(2) Awesome, this can come in useful for other things. ty mate
Create an account or sign in to comment