ScriptUO

Scripting Resources & Utilities => Stealth Client => Stealth scripts => Topic started by: unisharp on October 22, 2020, 05:43:23 AM

Title: [py] weapons, jewelry, armor libraries
Post by: unisharp on October 22, 2020, 05:43:23 AM
https://github.com/unisharpUO/StealthUO-Scripts/blob/master/lib/armor.py
https://github.com/unisharpUO/StealthUO-Scripts/blob/master/lib/jewelry.py
https://github.com/unisharpUO/StealthUO-Scripts/blob/master/lib/weapon.py

WHAT IS IT:
These objects make parsing item properties extremely quick and easy.  I haven't made anything to determine what an item is yet (ie, cast to weapon if item is of type weapon)

HOW TO USE:
Say you had a box of armor that you wanted to go through and find all pieces with 10 LMC 25 LRC...

We make a script using the armor library, target the container holding our armor, cast each item to type armor and we can then compare object properties

# target container with armor
_target = RequestTarget()
UseObject(_target)
Wait(250)

# find all types of items of all colors in container
if FindTypesArrayEx([0xFFFF], [0xFFFF], [_target], True):
    _foundList = GetFindedList()
    for _found in _foundList:
        # for each item found, create new armor object with the found item
        _armor = Armor(_found)
       
        # if LMC is 10 and LRC is 25, move to backpack
        if _armor.LMC == 10 and _armor.LRC == 25:
            MoveItem(_armor.ID, 1, Backpack(), 0, 0, 0)
Title: Re: [py] weapons, jewelry, armor libraries
Post by: daymorn on October 26, 2020, 12:41:04 PM
This is going to come in handy. Thanks for all the work.