[ORION] Combat leveling

If you make a Client-side script you can publish it here for other players to use
Post Reply
antitribus
Passer by
Posts: 1
Joined: Thu Feb 20, 2020 8:45 pm

[ORION] Combat leveling

Post by antitribus »

Code: Select all

/**
 * @shard: UO Excelsior
 * @author: Raphael de Mello Barros
 * @contact: antitribus@gmail.com
 * @description: Macro to level up combat skills
*/

// Add the types from monsters
var monstersTypes = {
    1 : "0x008F",
    2 : "0x002A",
    3 : "0x008E"
};

var config = {
    monsterScanDistance : 2000,
    attackDelay : 3000
}

function run(){
    init();

    while(!Player.Dead())
    {
        searchMonster();
    }
}

function searchMonster()
{
    Orion.Print("[i] Search monster");
    var monsterSerials;
    var monsterSerial;

    for(var i in monstersTypes)
    {
        monsterSerials = Orion.FindType(monstersTypes[i],-1,'ground','', config['monsterScanDistance']);
        
        Orion.Print("[i] Monsters serials " + monsterSerials);

        if(monsterSerials)
        {
            monsterSerial = monsterSerials[Math.floor(Math.random() * monsterSerials.length)];
            
            if(monsterSerial)
            {
                Orion.Print("[i] Current monster serial " + monsterSerial);

                var monster = Orion.FindObject(monsterSerial);
    
                if(monster)
                {
                    Orion.Print("[i] Monster position x:" + monster.X() + " | y:" + monster.Y() + " | z:" + monster.Z());
                    Orion.WalkTo(monster.X(),monster.Y(),monster.Z(),0);
                    attack(monsterSerial);
                }
            }
            
        }
        
        Orion.Wait(config['attackDelay']);
    }
    
}

function attack(monster)
{ 
    Orion.Print("[i] Attack monster");
    if(Player.WarMode()) Player.WarMode(true);
    Orion.Attack(monster);  
}

function init()
{   
    Orion.Print("Initialization...");
}
Post Reply