Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JackWalters

Pages: [1]
1
Orion UO Scripts / Re: Sampire Helper
« on: July 03, 2023, 11:47:23 PM »
Heh there actually should have been a cast function in there. You are the first person to point out it's missing/broken. I'll add it in if I ever do an update. Right now there seems to be no interest, so no reason too. Your fix should work fine, may need to add a slight delay after Orion.Cast since my cast function adds the delays based on fcr, etc.
Thank you for your answer. You are right, must be delay because script activate Whirwind attack very fast. And also tried to activate this attack with busido abilities but it no possible.  So modification in progress. If you can give me some advices i will be appreciate. Thank you in advance.

2
Orion UO Scripts / Re: Sampire Helper
« on: July 03, 2023, 12:56:47 AM »
So script is working. But was wrong command cast. Instead
Code: Javascript
  1.  [color=red]if(Player.Hits("%") < 30)
  2.             cast('Evasion'); // Use evasion for ciritical health
  3.         else if(Player.Hits("%") < 70)
  4.             cast('Confidence'); // Use confidenc for a boost
  5.         else
  6.             cast('Counter Attack'); // Counter attack[/color]
Must be: 
Code: Javascript
  1. [color=green]function checkStance(){
  2.     if(Orion.SkillValue('Bushido') < 500) return;
  3.     if(!Orion.BuffExists('Confidence') && !Orion.BuffExists('Evasion') && !Orion.BuffExists('Counter Attack') && Player.Mana() > 15){
  4.         if(Player.Hits("%") < 30)
  5.            Orion.Cast('401'); // Use evasion for ciritical health
  6.         else if(Player.Hits("%") < 70)
  7.              Orion.Cast('402'); // Use confidenc for a boost
  8.         else
  9.             Orion.Cast('404'); // Counter attack[/color]

So full script:
Spoiler: show


const color = {
  label: '0x008E',
  value: '0x0037',
  black: '0x0000',
  green:  { light: '0x0046', norm: '0x0044', dark: '0x00A7' },
  blue:   { light: '0x0064', norm: '0x0062', dark: '0x00C5' },
  red:    { light: '0x0028', norm: '0x0026', dark: '0x0089' },
  occ:    { light: '0x002D', norm: '0x002B', dark: '0x008E' },
  purple: { light: '0x001E', norm: '0x0017', dark: '0x007A' },
  yellow: { light: '0x0037', norm: '0x0035', dark: '0x0098' },
  white:  { light: '0x7FA',  norm: '0x7EE',  dark: '0x7E2' }
};

function Autostart(){
    Orion.ClearJournal();
    Orion.ClientViewRange(24);

    while(Orion.Connected()){
        //Open paperdoll and save config every 5 minutes (to keep mobTypes updated)
        if(!Orion.TimerExists('antiIdle') || Orion.Timer('antiIdle') > 300000){
            Orion.SetTimer('antiIdle');
            Orion.OpenPaperdoll(Player.Serial());
            Orion.SaveConfig();
        }

        //Don't take any actions while dead
        if(Player.Dead()){
            while(Player.Dead())
                Orion.Wait(500);
            Orion.Wait(3000);
            //Equip gear set when alive
            Orion.Dress('sampire');
        }
       
        //Scan all local mobs, and add to mobTypes if not found
        var mobList = Orion.GetFindList('mobTypes').Items().map(function(mob){ return mob.Graphic() });
        loadMobs().filter(function(mob){
            return mobList.indexOf(mob.Graphic()) === -1;
        }).forEach(function(mob){
            if(mob.Name())
                Orion.AddFindList('mobTypes', mob.Graphic(), 'any', mob.Name() +'|false|false');
           
        });

        Orion.Wait(500);
    }
}

function loadMobs(dist){
    var noto = Player.Notoriety() === 6 ? 'innocent|criminal|enemy|murderer' : 'innocent|gray|criminal|enemy|murderer';
    dist = dist ? dist : Orion.OAOptionGet('MaxTargetDistance');
    var mobs = Orion.FindTypeEx(any, any, ground, 'mobile|live|ignoreself|ignorefriends', dist, noto);
    return mobs || false;
}

function honor(mob){
    if(Orion.HaveTarget())
        Orion.CancelTarget();
    Orion.CancelWaitTarget();
    Orion.AddHighlightCharacter(mob.Serial(), color.green.norm, false);
    if(mob.Distance() < 8 && mob.Hits("%") === 100){
        Orion.InvokeVirtue('Honor');
        if(Orion.WaitForTarget())
            Orion.TargetObject(mob.Serial());
        Orion.Wait(100);
        if(Orion.HaveTarget())
            Orion.CancelTarget();
    }
}

function attack(){
    var mobs = loadMobs() // Load mobs to array
        .filter(function(m){ return m.InLOS() }) // Filter out of sight mobs
        .filter(function(m){ return !m.IsHuman() }) // Filter Humans
        .sort(function(a, b){ // Sort targets by distance, then health
            if(a.Distance() !== b.Distance())
                return a.Distance() - b.Distance();
            return a.Hits() - b.Hits();
        });
    var mob = mobs.shift(); // Select focused mob, or select weakest, closest mob from array
    if(!mob) return; // No mobs, leave function
    var primary = Orion.AbilityStatus('Primary');
    var secondary = Orion.AbilityStatus('Secondary');
    honor(mob); // Honor target

    var tags = loadTags(mob.Graphic())[0];
    if(tags)
        equipSlayer(tags.slayer);
    var combatStart = Orion.Now(); // Set combat timer
    Orion.Attack(mob.Serial()); // Attack mobile
    Orion.SetTimer('loadLocals');
    var inRange = 1;
    var mobType = mob.Graphic();
    var mastery = loadMastery();

    while(mob.Exists() && Player.WarMode()){ // While the mob is alive and player is in warmode
        inRange = loadMobs(1).length; // Load mobs in combat range to array
        var combatTime = Orion.Now() - combatStart; // determine length of combat so far
        var chivalry = Orion.SkillValue('Chivalry') > 500;
        if(mob.Distance() > 1 && combatTime > 3000) // If mob is out of range
            Orion.WalkTo(mob.X(), mob.Y(), mob.Z(), 1, 255, 1); // Get in range

        checkStance();

        if(inRange === 1 && !Orion.SpellStatus('onslaught') &&
            mastery.match(/Swordsmanship/gi) &&
            Player.Mana() > 20 &&
            Orion.ObjAtLayer('LeftHand').Graphic() != 0x26BD &&
            (!Orion.TimerExists('onslaught') || Orion.Timer('onslaught') > 6000)){
                Orion.SetTimer('onslaught');
                Orion.Cast('729'); // Use Onslaught!
        } else if(inRange === 2 && !Orion.SpellStatus('Momentum Strike')){
            Orion.Cast('406'); // If 2 mobs are in range
        } else if(inRange > 2 && !primary && !secondary && !Orion.BuffExists('Momentum Strike')){
            if(!Orion.UseAbility('secondary')) // If 3 or more are in range
               Orion.Cast('406');
        } else if(!Orion.AbilityStatus('Primary') &&
                  !Orion.SpellStatus('Onslaught') &&
                  Player.Mana() > 30){
                        Orion.UseAbility('Primary');
                        Orion.Wait(750);
        }
        Orion.Attack(mob.Serial());
        Orion.Wait(50);
    }

    addKillCount(mobType); // Increase mobs kill count
    Orion.RemoveTimer('onslaught'); // Reset the onslaught timer
}

function loadMastery(){
    var book = Orion.FindTypeEx(0x225A, 0x0000, backpack)[0];
    return book.Properties().match(/(.*)\sMastery/gi)[0];
}

function checkStance(){
    if(Orion.SkillValue('Bushido') < 500) return;
    if(!Orion.BuffExists('Confidence') && !Orion.BuffExists('Evasion') && !Orion.BuffExists('Counter Attack') && Player.Mana() > 15){
        if(Player.Hits("%") < 30)
           Orion.Cast('401'); // Use evasion for ciritical health
        else if(Player.Hits("%") < 70)
             Orion.Cast('402'); // Use confidenc for a boost
        else
            Orion.Cast('404'); // Counter attack
    }
}

function addKillCount(type){
    var list = Orion.GetFindList('mobTypes');
    var items = list.Items();
    var object = items.filter(function(item){
        return item.Graphic() == type;
    }).forEach(function(item){
        var count = item.Count();
        count++;
        item.SetCount(count);
    });
    Orion.UpdateFindList(list);
}

function equipSlayer(graphic){
    var tags = loadTags(graphic);
    if(!tags.slayer) return;
    var weapon = Orion.FindTypeEx('0x0F4B', any, backpack).filter(function(weap){
        return Orion.Contains(weap.Properties(), tags.slayer +" Slayer");
    })[0];
    if(!weapon) return;
    Orion.SetTimer('weaponSwap');
    Orion.Print(color.purple.norm, tags.slayer +" slayer equipped");
    Orion.Wait('moveitemdelay');
    Orion.Equip(weapon.Serial());
}

function loadTags(graphic){
    var tags = Orion.GetFindList('mobTypes').Items()
        .filter(function(type){
            return type.Graphic() == graphic;
        }).map(function(tag){
            var comments = tag.Comment().split('|');
            return {
                name    : comments[0] ? comments[0].toString() : "missing",
                slayer  : comments[1] ? comments[1].toString() : false,
                ignore  : comments[2] ? Boolean(comments[1]) : false
            }
    });
    return tags || false;
}


How said script maker. Autolog must be activated all time. Attack script must be binded to any button.



3
New member introductions / Re: Hello Everyone!
« on: June 23, 2023, 11:58:46 PM »
Thank you for the update!

Welcome to SUO! Thanks for your introduction - restricted status lifted - feel free to enjoy all the benefits of the site!
Thank you all!

4
New member introductions / Re: Hello Everyone!
« on: June 23, 2023, 12:48:00 AM »
A Very Warm Welcome!

Our only requirement to be part of this site is for new members to write a good and thoughtful introduction.

Before we will unrestrict you - you need to tell us a lot more!
Please greatly expand your introduction and tell us about yourself and your UO life.

Look at the stickied examples if you need insight.
I think you will find the effort required to write a couple paragraphs will pay off with this community!

(Use a translator program if you feel you can not write in English.)
Updated :D :D

5
New member introductions / Hello Everyone!
« on: June 22, 2023, 03:24:44 AM »
Hello my name is Jack. In game is Tasmanian Devil. Nice to meet you all!! In Ultima Online i play around 10 years on the different  servers from freeshard to OSI. At the current time i play on Europa server.  First met with Ultima Online started from freeshard AOS. After big delay i found that was added a lot of new things. On OSI i found updated crafting system so now I try to recognise all features of this system. Also i try to adjuct my sampire. So thank everybody for help and suggestions about scripting and macroing.

Pages: [1]