CasDeBlanco Posted February 15, 2018 Posted February 15, 2018 (edited) >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, 2018 by Castro_ Added an option for Super restores 2
Severide Posted February 15, 2018 Posted February 15, 2018 Did you just make this within like 5minutes? haha
CasDeBlanco Posted February 15, 2018 Author Posted February 15, 2018 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 1
Severide Posted February 15, 2018 Posted February 15, 2018 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!
CasDeBlanco Posted February 15, 2018 Author Posted February 15, 2018 1 minute ago, Severide said: Jesus, quick off the mark, good job man! Thank you
scriptersteve Posted February 15, 2018 Posted February 15, 2018 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)); }
CasDeBlanco Posted February 15, 2018 Author Posted February 15, 2018 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
scriptersteve Posted February 15, 2018 Posted February 15, 2018 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 1
scriptersteve Posted February 15, 2018 Posted February 15, 2018 Also allows for occasional double drinking especially with higher prayer levels which I think is really nice
jonny1179 Posted February 15, 2018 Posted February 15, 2018 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(); }
H0rn Posted February 15, 2018 Posted February 15, 2018 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
Butters Posted February 15, 2018 Posted February 15, 2018 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)
H0rn Posted February 15, 2018 Posted February 15, 2018 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