ScriptUO

Scripting Resources & Utilities => Orion UO Client => Orion UO Scripts => Topic started by: Crisis on October 23, 2021, 09:44:30 PM

Title: Train Necromancy
Post by: Crisis on October 23, 2021, 09:44:30 PM
Code: [Select]
function trainNecromancy() {
    const castSpellDelay = 4000;
    const skillValueGoal = 1000;
    const target = Player.Serial();
    const useSkillDelay = 10250;
    var skillValue = Orion.SkillValue('Necromancy');

    while (skillValue < skillValueGoal) {
          if (skillValue < 600)
             var spell = 'Wraith Form';
        else if (skillValue < 800)
             var spell = 'Horrific Beast';
        else
            var spell = 'Lich Form';
           
        while (Player.Mana() < 10) {
            var meditating = false;
            while (!meditating) {
                Orion.ClearJournal();
                Orion.UseSkill('meditation');
                Orion.Wait(250);
                if (Orion.InJournal('You cannot focus your concentration|You stop meditating'))
                {
                    Orion.Wait(useSkillDelay);
                    }
                else
                {
                    var meditating = true;
                    }
            }
            Orion.WaitJournal('You are at peace', 0, Orion.Now() + 60000);
        }
        Orion.Cast(spell, target);
        Orion.Wait(castSpellDelay);

        skillValue = Orion.SkillValue('Necromancy');
    }
}

function circuitBreaker(skillValue) {
    if (skillValue < 30) {
        Orion.Print('[Error] trainNecromancy: Train skill to 30.0 before proceeding.');
        Orion.Terminate('trainNecromancy');
    }
}
Title: Re: Train Necromancy
Post by: Ahzmandius on November 07, 2021, 05:23:18 PM
Too funny. I literally just did one of these up last night for a toon. Dont want to hijack this(can delete if its not the right place for it) but since there are virtually no scripts here, figured a different style might be nice. A little less elegant, and just based on the stratics guide. I just started learning java when i started on the client last month.
Code: [Select]
function necroBot(){
var beastset = 0;
while(Orion.SkillValue('Necromancy') < 1200){
var skill = Orion.SkillValue('Necromancy');
if(Player.Mana() < 30){
do {
if(!Orion.BuffExists('Meditation'))
Orion.UseSkill('Meditation');
Orion.Wait(2000);
} while (Player.Mana() < Player.MaxMana() - 15);
}
if(!Player.IsHuman() && beastset == 1)
Orion.Cast('Horrific Beast');
if(Player.Hits() < Player.MaxHits() - 40)
Orion.Cast('Greater Heal', self);
if(skill < 400){
Orion.Print("Buy some skill");
Orion.PauseScript();
}
if(skill > 399 && skill < 500)
Orion.Cast('Pain Spike', self);
if(skill > 500 && skill < 700){
Orion.Cast('Horrific Beast');
bestset = 1;
}
if(skill > 699 && skill < 900)
Orion.Cast('Wither', self);
if(skill > 899 && skill < 1000)
Orion.Cast('Lich Form');
if(skill > 999 && skill < 1200)
Orion.Cast('Vampiric Embrace');
Orion.Wait(1500);
Orion.ClearJournal();
}
}
Title: Re: Train Necromancy
Post by: Crisis on November 07, 2021, 06:27:25 PM
It's all good, glad to see more contributions!
Title: Re: Train Necromancy
Post by: Ahzmandius on November 07, 2021, 07:00:46 PM
yeah, with stuff like this i just never know whats worth posting. Although i have learned primarily by example and even learned a few cool things from some useless code :)