[Script] OrionUO - AutoClaim

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

Post by Uforek »

Collecting corpses for cash just got a whole lot easier with this script!

Code: Select all

function claimAll() {
    const entities = Orion.FindTypeEx(
        "0x2006",
        "any",
        "ground",
        "inlos|ignoreself",
        "8"
    ).sort(function (a, b) {
        return a.Distance() - b.Distance();
    });
    Orion.CancelTarget();
    if (entities.length > 0) {
        entities.forEach(function (entity) {
            if (!Orion.HaveTarget()) {
                Orion.Say("[claim");
            }
            if (Orion.WaitForTarget("1000")) {
                Orion.TargetObject(entity.Serial());
            }
            Orion.Wait("250");
        });
    }
    Orion.CancelTarget();
}
Update: Updated search parameter to only include corpse graphic. Added auto-renewal of [claim if target hook becomes invalidated.
Last edited by Uforek on Fri May 12, 2023 1:05 pm, edited 3 times in total.
User avatar
Nalo
Apprentice Scribe
Posts: 13
Joined: Thu May 07, 2020 10:07 pm

Re: [Script] OrionUO - AutoClaim

Post by Nalo »

You could use use 0x2006 in FindType() to create a list of corpses

Then you just use TargetObject(entities)
Post Reply