Jump to content

>C< Prayer potion drinker


CasDeBlanco

Recommended Posts

>C< Prayer potion drinker

4EG1pKu.png

 

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:

Old sources:

 

Edited by Castro_
Added an option for Super restores
  • Like 2
Link to comment
Share on other sites

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));
}
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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();
}

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...