Items
The Items class provides a wide range of functions to search and interact with Items.
TODO: Items Constructors
Methods
Items.ApplyFilter(filter)
Items.ApplyFilter(filter)
Filter the global list of Items according to the options specified by the filter ( see: Items.Filter ).
Parameters
filterItems.FilterA filter object.
Return
List[Item]the list of Items respectinf the filter criteria.
Items.BackpackCount(itemid, color)
Items.BackpackCount(itemid, color)
Count items in Player Backpack.
Parameters
itemidInt32ItemID to search.
colorInt32Color to search. (default -1: any color)
Items.ChangeDyeingTubColor(dyes, dyeingTub, color)
Items.ChangeDyeingTubColor(dyes, dyeingTub, color)
Use the Dyes on a Dyeing Tub and select the color via color picker, using dedicated packets.
Need to specify the dyes, the dye tube and the color to use.
Parameters
dyesItemDyes as Item object.
dyeingTubItemDyeing Tub as Item object.
colorInt32Color to choose.
Items.Close(serial)
Close opened container window.
On OSI, to close opened corpse window, you need to close the corpse's root container
Currently corpse's root container can be found by using item filter.
Parameters
serialInt32
ItemSerial or Item to hide.
Items.ContainerCount(container, itemid, color, recursive)
Items.ContainerCount(container, itemid, color, recursive)
Count items inside a container, summing also the amount in stacks.
Parameters
containerInt32
ItemSerial or Item to search into.
itemidInt32ItemID of the item to search.
colorInt32Color to match. (default: -1, any color)
recursiveBooleanSearch also in already open subcontainers.
Items.ContextExist(serial, name)
Items.ContextExist(serial, name)
Check if Context Menu entry exists for an Item.
Parameters
serialInt32
ItemSerial or Item to check.
nameStringName of the Context Manu entry
Items.DropFromHand(item, container)
Items.DropFromHand(item, container)
Drop into a bag an Item currently held in-hand. ( see: Items.Lift )
Parameters
itemItemItem object to drop.
containerItemTarget container.
Items.DropItemGroundSelf(item, amount)
Items.DropItemGroundSelf(item, amount)
Drop an Item on the ground, at the current Player position.
NOTE: On some server is not allowed to drop Items on tiles occupied by Mobiles and the Player.
This function seldom works because the servers dont allow drop where your standing
Parameters
itemInt32
ItemItem object to drop.
amountInt32Amount to move. (default: 0, the whole stack)
Items.FindAllByID(itemids, color, container, range, considerIgnoreList)
Items.FindAllByID(itemids, color, container, range, considerIgnoreList)
Find a List of Items matching specific list of ItemID, Color and Container.
Optionally can search in all subcontaners or to a maximum depth in subcontainers.
Can use -1 on color for no chose color, can use -1 on container for search in all item in memory.
The depth defaults to only the top but can search for # of sub containers.
Parameters
itemidsInt32
PythonList
List[Int32]
colorInt32Color filter. (-1: any, 0: natural )
containerInt32Serial of the container to search. (-1: any Item)
rangeInt32
considerIgnoreListBooleanTrue: Ignore Items are excluded - False: any Item.
Return
PythonList
List[Item]The Item matching the criteria.
Items.FindByID(itemid, color, container, recursive, considerIgnoreList)
Items.FindByID(itemid, color, container, recursive, considerIgnoreList)
Find a single Item matching specific ItemID, Color and Container.
Optionally can search in all subcontaners or to a maximum depth in subcontainers.
Can use -1 on color for no chose color, can use -1 on container for search in all item in memory. The depth defaults to only the top but can search for # of sub containers.
Parameters
itemidInt32
List[Int32]ItemID filter.
colorInt32Color filter. (-1: any, 0: natural )
containerInt32Serial of the container to search. (-1: any Item)
recursiveBoolean
Int32Search subcontainers.
True: all subcontainers
False: only main
1,2,n: Maximum subcontainer depth
considerIgnoreListBooleanTrue: Ignore Items are excluded - False: any Item.
Return
ItemThe Item matching the criteria.
Items.FindByName(itemName, color, container, range, considerIgnoreList)
Items.FindByName(itemName, color, container, range, considerIgnoreList)
Find a single Item matching specific Name, Color and Container.
Optionally can search in all subcontaners or to a maximum depth in subcontainers.
Can use -1 on color for no chose color, can use -1 on container for search in all item in memory. The depth defaults to only the top but can search for # of sub containers.
Parameters
itemNameStringItem Name filter.
colorInt32Color filter. (-1: any, 0: natural )
containerInt32Serial of the container to search. (-1: any Item)
rangeInt32Search subcontainers.
1,2,n: Maximum subcontainer depth
considerIgnoreListBooleanTrue: Ignore Items are excluded - False: any Item.
Return
ItemThe Item matching the criteria.
Items.FindBySerial(serial)
Items.FindBySerial(serial)
Search for a specific Item by using it Serial
Parameters
serialInt32Serial of the Item.
Return
ItemItem object if found, or null if not found.
Items.GetImage(itemID, hue)
Items.GetImage(itemID, hue)
Get the Image on an Item by specifing the ItemID. Optinally is possible to apply a color.
Parameters
itemIDInt32ItemID to use.
hueInt32Optional: Color to apply. (Default 0, natural)
Items.GetPropStringByIndex(serial, index)
Items.GetPropStringByIndex(serial, index)
Get a Property line, by index. if not found returns and empty string.
Parameters
serialInt32
ItemSerial or Item to read.
indexInt32Number of the Property line.
Return
StringA property line as a string.
Items.GetPropStringList(serial)
Items.GetPropStringList(serial)
Get string list of all Properties of an item, if item no props list is empty.
Parameters
serialInt32
ItemSerial or Item to read.
Return
List[String]List of strings.
Items.GetPropValue(serial, name)
Items.GetPropValue(serial, name)
Read the value of a Property.
Parameters
serialInt32
ItemSerial or Item to read.
nameStringName of the Propery.
Items.GetPropValueString(serial, name)
Items.GetPropValueString(serial, name)
Get a Property line, by name. if not found returns and empty string.
Parameters
serialInt32Serial or Item to read.
nameStringNumber of the Property line.
Return
StringA property value as a string.
Items.GetProperties(itemserial, delay)
Items.GetProperties(itemserial, delay)
Request to get immediatly the Properties of an Item, and wait for a specified amount of time.
This only returns properties and does not attempt to update the object.
Used in this way, properties for object not yet seen can be retrieved
Parameters
itemserialInt32Serial or Item read.
delayInt32Maximum waiting time, in milliseconds.
Items.GetWeaponAbility(itemId)
Items.GetWeaponAbility(itemId)
NOTE: This is from an internal razor table and can be changed based on your server!
Returns a pair of string values (Primary Ability, Secondary Ability)
for the supplied item ID.
"Invalid", "Invalid" for items not in the internal table
Return
ValueTuple[String, String]
Items.Hide(serial)
Hied an Item, affects only the player.
Parameters
serialInt32
ItemSerial or Item to hide.
Items.IgnoreTypes(itemIdList)
Items.IgnoreTypes(itemIdList)
Used to ignore specific types. Be careful as you wont see things you ignore,
and could result in a mobile being able to kill you without you seeing it
Parameters
itemIdListPythonList
Items.Lift(item, amount)
Lift an Item and hold it in-hand. ( see: Items.DropFromHand )
Parameters
itemItemItem object to Lift.
amountInt32Amount to lift. (0: the whole stack)
Items.Message(item, hue, message)
Items.Message(item, hue, message)
Display an in-game message on top of an Item, visibile only for the Player.
Parameters
itemInt32
ItemSerial or Item to display text on.
hueInt32Color of the message.
messageStringMessage as
Items.Move(source, destination, amount, x, y)
Items.Move(source, destination, amount, x, y)
Move an Item to a destination, which can be an Item or a Mobile.
Parameters
sourceInt32
ItemSerial or Item of the Item to move.
destinationInt32
Item
MobileSerial, Mobile or Item as destination.
amountInt32Amount to move (-1: the whole stack)
xInt32Optional: X coordinate inside the container.
yInt32Optional: Y coordinate inside the container.
Items.MoveOnGround(source, amount, x, y, z)
Items.MoveOnGround(source, amount, x, y, z)
Move an Item on the ground to a specific location.
Parameters
sourceInt32
ItemSerial or Item to move.
amountInt32Amount of Items to move (0: the whole stack )
xInt32X world coordinates.
yInt32Y world coordinates.
zInt32Z world coordinates.
Items.OpenAt(serial, x, y)
Items.OpenAt(serial, x, y)
Parameters
serialInt32
Item
xInt32
yInt32
Items.OpenContainerAt(bag, x, y)
Items.OpenContainerAt(bag, x, y)
Open a container at a specific location on the screen
Parameters
bagItemContainer as Item object.
xInt32x location to open at
yInt32y location to open at
Items.Select(items, selector)
Items.Select(items, selector)
Parameters
itemsList[Item]
selectorString
Items.SetColor(serial, color)
Items.SetColor(serial, color)
Change/override the Color of an Item, the change affects only Player client. The change is not persistent.
If the color is -1 or unspecified, the color of the item is restored.
Parameters
serialInt32Serial of the Item.
colorInt32Color as number. (default: -1, reset original color)
Items.SingleClick(item)
Send a single click network event to the server.
Parameters
itemInt32
ItemSerial or Item to click
Items.UseItem(itemSerial, targetSerial, wait)
Items.UseItem(itemSerial, targetSerial, wait)
Use an Item, optionally is possible to specify a Item or Mobile target.
NOTE: The optional target may not work on some free shards. Use Target.Execute instead.
Parameters
itemSerialInt32
ItemSerial or Item to use.
targetSerialInt32
UOEntityOptional: Serial of the Item or Mobile target.
waitBooleanOptional: Wait for confirmation by the server. (default: True)
Items.UseItemByID(itemid, color)
Items.UseItemByID(itemid, color)
Use any item of a specific type, matching Item.ItemID. Optionally also of a specific color, matching Item.Hue.
Parameters
itemidInt32ItemID to be used.
colorInt32Color to be used. (default: -1, any)
Items.WaitForContents(bag, delay)
Items.WaitForContents(bag, delay)
Open a container an wait for the Items to load, for a maximum amount of time.
Parameters
bagInt32
ItemContainer as Item object.
Container as Item serial.
delayInt32max time to wait for contents
Maximum wait, in milliseconds.
Items.WaitForProps(itemserial, delay)
Items.WaitForProps(itemserial, delay)
If not updated, request to the Properties of an Item, and wait for a maximum amount of time.
Parameters
itemserialInt32
ItemSerial or Item read.
delayInt32Maximum waiting time, in milliseconds.