Jump to content

NMZ Flicker


lare96

Recommended Posts

Will flick "Rapid Heal", drink overloads when necessary and will drink 1-2 absorption sips after every overload sip. Make sure that you start the bot when you're inside the arena, you've guzzled your rock cakes and fully set up your character to be ready for combat (1HP, standing in corner, ready to flick). Sorry about the poor/messy quality but I whipped it up in 15 or so minutes, but I've been using it all day and it works perfectly. Enjoy!

 
 
(Shitty XP because this is while I was debugging the script.)
 
xFVKrHP.png
import com.google.common.base.Stopwatch;
import org.osbot.rs07.api.ui.PrayerButton;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.time.LocalTime;
import java.util.concurrent.TimeUnit;

/**
 * @author lare96 <http://github.org/lare96>
 */
@ScriptManifest(logo = "", name = "NmzFlicker", author = "lare96", version = 1.0, info = "Will flick HP and pot overloads/absorbs.") public final class NmzFlicker
    extends Script {

    private final Stopwatch watch = Stopwatch.createStarted();
    private String status = "Idle...";
    private int sipAbsortption = 0;

    @Override
    public void onStart() {
        experienceTracker.start(Skill.ATTACK);
        experienceTracker.start(Skill.DEFENCE);
        experienceTracker.start(Skill.STRENGTH);
    }

    @Override
    public int onLoop() throws InterruptedException {
        if (!combat.isAutoRetaliateOn() && !prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Turning on auto-retaliate...";
            combat.toggleAutoRetaliate(true);
            return random(1000, 1500);
        }

        if (skills.getDynamic(Skill.HITPOINTS) == 51 && !prayer
            .isActivated(PrayerButton.RAPID_HEAL) && sipAbsortption == 0) {
            status = "Drinking Overload potion...";
            for (int i = 1; i < 5; i++) {
                if (inventory.contains("Overload (" + i + ")")) {
                    inventory.interact("Drink", "Overload (" + i + ")");
                    break;
                }
            }
            sipAbsortption = random(1, 2);
            return random(1000, 1500);
        }

        if (sipAbsortption > 0 && !prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Drinking Absorption potion...";
            for (int i = 1; i < 5; i++) {
                if (inventory.contains("Absorption (" + i + ")")) {
                    inventory.interact("Drink", "Absorption (" + i + ")");
                    break;
                }
            }
            sipAbsortption--;
            return random(1000, 1500);
        }

        if (prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Flicking \"Rapid Heal\" off...";
            prayer.set(PrayerButton.RAPID_HEAL, false);
        } else {
            status = "Flicking \"Rapid Heal\" on...";
            prayer.set(PrayerButton.RAPID_HEAL, true);
            return random(50, 100);
        }
        return random(3000, 15_000);
    }

    @Override
    public void onPaint(Graphics2D g) {
        g.setColor(Color.WHITE);
        g.setFont(new Font("Myriad Pro", Font.BOLD, 16));
        g.drawString("NmzFlicker [By Lare96]", 7, 225);
        g.setFont(new Font("Myriad Pro", Font.PLAIN, 14));
        g.drawString("Time Running: " + LocalTime.ofSecondOfDay(watch.elapsed(TimeUnit.SECONDS)).toString(), 7, 245);
        g.drawString("Status: " + status, 7, 260);
        g.drawString("Attack XP: " + experienceTracker.getGainedXP(Skill.ATTACK) + " (" + experienceTracker
            .getGainedXPPerHour(Skill.ATTACK) + ")", 7, 275);
        g.drawString("Strength XP: " + experienceTracker.getGainedXP(Skill.STRENGTH) + " (" + experienceTracker
            .getGainedXPPerHour(Skill.STRENGTH) + ")", 7, 290);
        g.drawString("Defence XP: " + experienceTracker.getGainedXP(Skill.DEFENCE) + " (" + experienceTracker
            .getGainedXPPerHour(Skill.DEFENCE) + ")", 7, 305);
    }
}
Edited by lare96
  • Like 3
Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
  • 4 weeks later...
  • 11 months later...
  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...

I suggest you change the code from

 

if (skills.getDynamic(Skill.HITPOINTS) == 51 && !prayer
            .isActivated(PrayerButton.RAPID_HEAL) && sipAbsortption == 0)

to

if (skills.getDynamic(Skill.HITPOINTS) >= 51 && !prayer
            .isActivated(PrayerButton.RAPID_HEAL) && sipAbsortption == 0)

This ensures that if (for whatever, unforeseeable reason), you somehow get to 2+hp, the script will still drink overloads and absorbs

EDIT: I leveled up in hitpoints, and it brought me to 2 hp, but the script kept running because of the change I made

Edited by bthebrave
Update
Link to comment
Share on other sites

  • 1 month later...
On 2017-05-24 at 6:05 AM, bthebrave said:

I suggest you change the code from

 


if (skills.getDynamic(Skill.HITPOINTS) == 51 && !prayer
            .isActivated(PrayerButton.RAPID_HEAL) && sipAbsortption == 0)

to


if (skills.getDynamic(Skill.HITPOINTS) >= 51 && !prayer
            .isActivated(PrayerButton.RAPID_HEAL) && sipAbsortption == 0)

This ensures that if (for whatever, unforeseeable reason), you somehow get to 2+hp, the script will still drink overloads and absorbs

EDIT: I leveled up in hitpoints, and it brought me to 2 hp, but the script kept running because of the change I made

Hmm wouldn't it be smarter to keep it at == 51, and instead throw in an else loop for >51, to eat on the dwarven rock cake, until 51. 

Link to comment
Share on other sites

  • 2 years later...
On 12/7/2015 at 10:53 PM, lare96 said:

Will flick "Rapid Heal", drink overloads when necessary and will drink 1-2 absorption sips after every overload sip. Make sure that you start the bot when you're inside the arena, you've guzzled your rock cakes and fully set up your character to be ready for combat (1HP, standing in corner, ready to flick). Sorry about the poor/messy quality but I whipped it up in 15 or so minutes, but I've been using it all day and it works perfectly. Enjoy!

 
 
(Shitty XP because this is while I was debugging the script.)
 
xFVKrHP.png

import com.google.common.base.Stopwatch;
import org.osbot.rs07.api.ui.PrayerButton;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.time.LocalTime;
import java.util.concurrent.TimeUnit;

/**
 * @author lare96 <http://github.org/lare96>
 */
@ScriptManifest(logo = "", name = "NmzFlicker", author = "lare96", version = 1.0, info = "Will flick HP and pot overloads/absorbs.") public final class NmzFlicker
    extends Script {

    private final Stopwatch watch = Stopwatch.createStarted();
    private String status = "Idle...";
    private int sipAbsortption = 0;

    @Override
    public void onStart() {
        experienceTracker.start(Skill.ATTACK);
        experienceTracker.start(Skill.DEFENCE);
        experienceTracker.start(Skill.STRENGTH);
    }

    @Override
    public int onLoop() throws InterruptedException {
        if (!combat.isAutoRetaliateOn() && !prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Turning on auto-retaliate...";
            combat.toggleAutoRetaliate(true);
            return random(1000, 1500);
        }

        if (skills.getDynamic(Skill.HITPOINTS) == 51 && !prayer
            .isActivated(PrayerButton.RAPID_HEAL) && sipAbsortption == 0) {
            status = "Drinking Overload potion...";
            for (int i = 1; i < 5; i++) {
                if (inventory.contains("Overload (" + i + ")")) {
                    inventory.interact("Drink", "Overload (" + i + ")");
                    break;
                }
            }
            sipAbsortption = random(1, 2);
            return random(1000, 1500);
        }

        if (sipAbsortption > 0 && !prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Drinking Absorption potion...";
            for (int i = 1; i < 5; i++) {
                if (inventory.contains("Absorption (" + i + ")")) {
                    inventory.interact("Drink", "Absorption (" + i + ")");
                    break;
                }
            }
            sipAbsortption--;
            return random(1000, 1500);
        }

        if (prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Flicking \"Rapid Heal\" off...";
            prayer.set(PrayerButton.RAPID_HEAL, false);
        } else {
            status = "Flicking \"Rapid Heal\" on...";
            prayer.set(PrayerButton.RAPID_HEAL, true);
            return random(50, 100);
        }
        return random(3000, 15_000);
    }

    @Override
    public void onPaint(Graphics2D g) {
        g.setColor(Color.WHITE);
        g.setFont(new Font("Myriad Pro", Font.BOLD, 16));
        g.drawString("NmzFlicker [By Lare96]", 7, 225);
        g.setFont(new Font("Myriad Pro", Font.PLAIN, 14));
        g.drawString("Time Running: " + LocalTime.ofSecondOfDay(watch.elapsed(TimeUnit.SECONDS)).toString(), 7, 245);
        g.drawString("Status: " + status, 7, 260);
        g.drawString("Attack XP: " + experienceTracker.getGainedXP(Skill.ATTACK) + " (" + experienceTracker
            .getGainedXPPerHour(Skill.ATTACK) + ")", 7, 275);
        g.drawString("Strength XP: " + experienceTracker.getGainedXP(Skill.STRENGTH) + " (" + experienceTracker
            .getGainedXPPerHour(Skill.STRENGTH) + ")", 7, 290);
        g.drawString("Defence XP: " + experienceTracker.getGainedXP(Skill.DEFENCE) + " (" + experienceTracker
            .getGainedXPPerHour(Skill.DEFENCE) + ")", 7, 305);
    }
}

Hi thank you for the code I yet have not used this on my account

 

  if (prayer.isActivated(PrayerButton.RAPID_HEAL)) {
            status = "Flicking \"Rapid Heal\" off...";
            prayer.set(PrayerButton.RAPID_HEAL, false);
        } else {
            status = "Flicking \"Rapid Heal\" on...";
            prayer.set(PrayerButton.RAPID_HEAL, true);
            return random(50, 100);
        }

 

I am mainly confused only on this part because first you check to see if prayer is on "and if it is on" then you shut it off

That part is clear but when you do shut it off again?

does it loop back through the entire program to fulfil the other conditions?

or does the return random(50,100) loop back around the same if statement one more time?

 

 

On 7/7/2017 at 2:03 PM, slazter said:

Hmm wouldn't it be smarter to keep it at == 51, and instead throw in an else loop for >51, to eat on the dwarven rock cake, until 51. 

That is a good point actually but I do not think this bot will mess up lol

 

but that is definitely a good point incase that happens

or you can do if >51 

and down the line

==1, incase it goes over 1 into the 2 zone.

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...