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 - unisharp

Pages: 1 [2] 3 4 ... 14
16
12-21-20 Changes:
  • If bag of sending exists in backpack, enable good looting
  • If weight is equal to or over limit, send gold to bank

Commits:
https://github.com/unisharpUO/StealthUO-Scripts/commit/8222629a4fabbd68fbccf6a5ff77e07a805c7714
https://github.com/unisharpUO/StealthUO-Scripts/commit/9cb81e70c2f2e25cceb28cab1fe8aef4839f80b3

17
Code: [Select]
_bagSending = 0
if Weight() <= MaxWeight():  # if we're at max weight or over
    # find bags
    if FindTypesArrayEx([0x0E76], [0xFFFF], [Backpack()], True):
        _bags = GetFindedList()
        for _bag in _bags:
            # make sure they are bags of sending
            if 'sending' in GetTooltip(_bag).split('|')[0]:
                AddToSystemJournal("Found bag of sending...")
                _bagSending = _bag
    else:
        AddToSystemJournal("No bags found...")
        exit()  # no bags at all found

    # if we made it this far, we have our bag of sending, now look for gold

    if FindTypeEx(0x0EED, 0xFFFF, Backpack(), True):
        _gold = GetFoundList()
        UseObject(_bagSending)
        Wait(1500)
        WaitTargetObject(_gold[0])
    else:
        AddToSystemJournal("Can't find gold...")

18
I'll make a snippet example for gold/sending in another thread when it's ready.

19
Code: [Select]
_lootList1 = NewFind([0x108A, 0x1F09, 0x4212, 0x1086, 0x1F06, 0x4211], [0xFFFF], [_corpse], True)
Merry Christmas


NewFind(Array of types, Array of colors, Array of containers, Search Subcontainers?)


0xFFFF specifies anything/everything.

20
There are not that many object types for jewelry...

We can see here...
https://github.com/unisharpUO/XScript/blob/cd06adcb83a5626f5f9c51b1c9f2bca805628639/XScript/Distro/Items/Jewels/BaseJewel.cs

Code: [Select]
[QueryType(typeof (BaseNecklace), typeof (BaseRing), typeof (BaseEarring), typeof (BaseBracelet))]
    public class BaseJewel : Item, IJewel

BaseJewel has nested types BaseNecklace, BaseRing, BaseEarring, and BaseBracelet.  All we need is BaseRing and BaseBracelet, so let's look at those....

https://github.com/unisharpUO/XScript/blob/cd06adcb83a5626f5f9c51b1c9f2bca805628639/XScript/Distro/Items/Jewels/Rings.cs

Code: [Select]
[QueryType(typeof (HumanRing), typeof (GargishRing))]
    public class BaseRing : BaseJewel

BaseRing has nested types HumanRing and Gargish Ring....

Code: [Select]
    [QuerySearch(new ushort[] {0x108A, 0x1F09})]
    public class HumanRing : BaseRing

HumanRing has types 0x108A, 0x1F09

Code: [Select]
    [QuerySearch(0x4212)]
    public class GargishRing : BaseRing

GargishRing has types 0x4212

Rings = [0x108A, 0x1F09, 0x4212]
done

let's do bracelets now
https://github.com/unisharpUO/XScript/blob/cd06adcb83a5626f5f9c51b1c9f2bca805628639/XScript/Distro/Items/Jewels/Bracelet.cs

Code: [Select]
[QueryType(typeof (HumanBracelet), typeof (GargishBrace))]
    public class BaseBracelet : BaseJewel

Same thing... HumanBracelet and GargishBrace

Code: [Select]
    [QuerySearch(new ushort[] {0x1086, 0x1F06})]
    public class HumanBracelet : BaseBracelet

Code: [Select]
    [QuerySearch(0x4211)]
    public class GargishBrace : BaseBracelet

Braclets = [0x1086, 0x1F06, 0x4211]

now combine them

Jewlery = [0x108A, 0x1F09, 0x4212, 0x1086, 0x1F06, 0x4211]

Now you have a set of jewelry types to search for.

It's just going to be harder with armor/weapons because there are more types.

There are now links in this thread that will help you:
  • Find the required ClilocIDs needed for parsing parameters
  • Find object types to parse

21
Yes, you can do this with a bit of work.  The problem is there is no pre-existing definition of armor types, weapon types, jewelry types, etc.  You have to collect them and store them in an array.

What you'd need to do is collect every object type identifier and store them in an array, then you can use that in the find function:

Code: [Select]
ArmorTypes = [0x1415, 0x1416, 0x13db, 0x13e2]

_lootList = NewFind(ArmorTypes, [0xFFFF], [_corpse], True)

0x1415, 0x1416 = Plate Chest facing either direction
0x13db, 0x13e2 = Studded Chest facing either direction

etc...

To make things easier you can grab item types from either the ServUO Github repository or my XScript repo:
https://github.com/unisharpUO/XScript/blob/cd06adcb83a5626f5f9c51b1c9f2bca805628639/XScript/Distro/Items/Armor/BaseChest.cs
for example...

22
Let's break down the loot method

Code: [Select]
    UseObject(_corpse)
    Wait(1500)
Opens the corpse and waits (for the corpse to open, and using object timers)

Code: [Select]
_lootList = NewFind([0xFFFF], [0xFFFF], [_corpse], True)Find every item on the corpse

Code: [Select]
    for _loot in _lootList:
        _tooltipRec = GetTooltipRec(_loot)
Loop through every item and get its tooltip records

Code: [Select]
        if GetParam(_tooltipRec, 1112857) >= 20 and not\
                ClilocIDExists(_tooltipRec, 1152714) and not\
                ClilocIDExists(_tooltipRec, 1049643):
Each ClilocID represents a property on the item.  Use the links in post 1 to determine what ClilocIDs you want to filter.  This one in particular is filtering for 20 or greater splintering, not antique, not cursed

You can use 2 methods here: GetParam to get the property value of the ClilocID, if the property has a value.  If the property has no value, such as Cursed or Brittle, then you can use ClilocIDExists.

Code: [Select]
            AddToSystemJournal(f'Looting Item: {_loot}')
            MoveItem(_loot, 1, LootBag, 0, 0, 0)
            InsureItem(_loot)
Log the item in the system journal for notification, move the item to your loot bag and insure it.

With this information, you should be able to create your own loot filters.

Code: [Select]
    UseObject(_corpse)
    Wait(1500)
    _lootList = NewFind([0xFFFF], [0xFFFF], [_corpse], True)
    for _loot in _lootList:
        _tooltipRec = GetTooltipRec(_loot)
        if GetParam(_tooltipRec, 1060486) >= 10:
            AddToSystemJournal(f'Looting Item: {_loot}')
            MoveItem(_loot, 1, LootBag, 0, 0, 0)
            InsureItem(_loot)
This will loot anything with 10 SSI or greater, for example.

23
is possible to add section for loot jewelery with ssi or other atributes?

It's 100% possible with the short documentation posted above and a little bit of python knowledge.  What are you having trouble with?

24
Welcome  ;D

25
Stealth Client / Re: Wait to loot a "turned" corpse
« on: November 10, 2020, 06:21:50 AM »
Tidus's idea is perfect, I do a little something different

How I handle this:

First off this doesn't work if you're completely unattended (AFK farming).  I'm assuming you're playing a character and a bot is playing with you, both in-party.

- In your loot method, after you're done looting a corpse, ignore it.
- Set a party command "reset loot" so that it wipes your ignore list

When you type "reset loot" in party, it'll wipe the ignore list and begin looting corpses again.

26
Stealth scripts / [py] weapons, jewelry, armor libraries
« 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)

27
Great addition nice work!
 :D

28
Stealth scripts / [py] Suit Calc
« on: October 13, 2020, 10:20:35 AM »
Simple script that adds up all the important properties on your suit



https://raw.githubusercontent.com/unisharpUO/StealthUO-Scripts/master/SuitCalc.py

29
commit pushed 10/13 - updated monster search

30
Stealth scripts / Re: [py] EggFarmer
« on: October 07, 2020, 09:18:15 AM »
Nice! Good job and thanks :)

Pages: 1 [2] 3 4 ... 14