[Script] OrionUO - AutoBandage

Don't know how something works? Here you will find some useful links. And if you have a question, feel free to ask.
Post Reply
Uforek
Novice Scribe
Posts: 5
Joined: Fri Apr 28, 2023 5:09 pm

[Script] OrionUO - AutoBandage

Post by Uforek »

Hey there, are you a fan of this whole 'life' thing? Because I certainly am! In fact, I like it so much that I wrote this little gem just for you!

Code: Select all

//v1.2
const BANDAGE_FINISHED_MSG =
    "You finish applying the bandages|" +
    "You heal what little damage your patient had|" +
    "The bleeding wounds have healed, you are no longer bleeding|" +
    "That being is not damaged!|" +
    "You cannot heal|" +
    "You have failed to cure|" +
    "You apply the bandages";
const BANDAGE_TIMEOUT = Math.floor(
    Math.abs((11 - Player.Dex() / 20) * 20 * 1000) + 500
);
const SCRIPT_DELAY = "250";

function AutoBandage() {
    while (true) {
        if (
            (Player.Hits() < Player.MaxHits() || Player.Poisoned()) &&
            !Player.Dead() &&
            !Player.Hidden()
        ) {
            Orion.ClearJournal(BANDAGE_FINISHED_MSG);
            Orion.Say("[bandself");
            Orion.WaitJournal(
                BANDAGE_FINISHED_MSG,
                0,
                Orion.Now() + BANDAGE_TIMEOUT
            );
        }
        Orion.Wait(SCRIPT_DELAY);
    }
}
Update: Fixed unnecessary timeouts.
Update: Fixed cpu fan issue / usage.
Last edited by Uforek on Fri May 19, 2023 12:19 am, edited 5 times in total.
User avatar
Nalo
Apprentice Scribe
Posts: 13
Joined: Thu May 07, 2020 10:07 pm

Re: [Script] OrionUO - AutoBandage

Post by Nalo »

Might be better to use:
while (!Player.Dead())
Instead of while true
Post Reply