Author Topic: [py] weapons, jewelry, armor libraries  (Read 6469 times)

0 Members and 1 Guest are viewing this topic.

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 199
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +143
  • Referrals: 0
    • View Profile
[py] weapons, jewelry, armor libraries
« on: October 22, 2020, 05:43:23 AM »
0
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)

Offline daymorn

  • Jr. Member
  • **
  • Posts: 21
  • Activity:
    0%
  • Reputation Power: 1
  • daymorn has no influence.
  • Respect: +20
  • Referrals: 0
    • View Profile
Re: [py] weapons, jewelry, armor libraries
« Reply #1 on: October 26, 2020, 12:41:04 PM »
+2
This is going to come in handy. Thanks for all the work.

Tags: