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.Filter
A 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
itemidInt32
ItemID to search.
colorInt32
Color to search. (default -1: any color)
Return
Int32
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
dyesItem
Dyes as Item object.
dyeingTubItem
Dyeing Tub as Item object.
colorInt32
Color to choose.
Return
Void
Items.Close(serial)
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 Item
Serial or Item to hide.
Return
Void
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 Item
Serial or Item to search into.
itemidInt32
ItemID of the item to search.
colorInt32
Color to match. (default: -1, any color)
recursiveBoolean
Search also in already open subcontainers.
Return
Int32
Items.ContextExist(serial, name)
Items.ContextExist(serial, name)
Check if Context Menu entry exists for an Item.
Parameters
serialInt32 Item
Serial or Item to check.
nameString
Name of the Context Manu entry
Return
Int32
Items.DropFromHand(item, container)
Items.DropFromHand(item, container)
Drop into a bag an Item currently held in-hand. ( see: Items.Lift )
Parameters
itemItem
Item object to drop.
containerItem
Target container.
Return
Void
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.
Parameters
itemInt32 Item
Item object to drop.
amountInt32
Amount to move. (default: 0, the whole stack)
Return
Void
Items.FindAllByID(itemid, color, container, range, considerIgnoreList)
Items.FindAllByID(itemid, color, container, range, considerIgnoreList)
Parameters
itemidInt32 PythonList colorInt32 containerInt32 rangeInt32 considerIgnoreListBoolean
Return
PythonList
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.
colorInt32
Color filter. (-1: any, 0: natural )
containerInt32
Serial of the container to search. (-1: any Item)
recursiveBoolean Int32
Search subcontainers. True: all subcontainers False: only main 1,2,n: Maximum subcontainer depth
considerIgnoreListBoolean
True: Ignore Items are excluded - False: any Item.
Return
Item
The 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
itemNameString
Item Name filter.
colorInt32
Color filter. (-1: any, 0: natural )
containerInt32
Serial of the container to search. (-1: any Item)
rangeInt32
Search subcontainers. 1,2,n: Maximum subcontainer depth
considerIgnoreListBoolean
True: Ignore Items are excluded - False: any Item.
Return
Item
The Item matching the criteria.
Items.FindBySerial(serial)
Items.FindBySerial(serial)
Search for a specific Item by using it Serial
Parameters
serialInt32
Serial of the Item.
Return
Item
Item 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
itemIDInt32
ItemID to use.
hueInt32
Optional: Color to apply. (Default 0, natural)
Return
Bitmap
Items.GetPropStringByIndex(serial, index)
Items.GetPropStringByIndex(serial, index)
Get a Property line, by index. if not found returns and empty string.
Parameters
serialInt32 Item
Serial or Item to read.
indexInt32
Number of the Property line.
Return
String
A 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 Item
Serial 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 Item
Serial or Item to read.
nameString
Name of the Propery.
Return
Single
Items.GetPropValueString(serial, name)
Items.GetPropValueString(serial, name)
Get a Property line, by name. if not found returns and empty string.
Parameters
serialInt32
Serial or Item to read.
nameString
Number of the Property line.
Return
String
A property value as a string.
Items.Hide(serial)
Items.Hide(serial)
Hied an Item, affects only the player.
Parameters
serialInt32 Item
Serial or Item to hide.
Return
Void
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
Return
Void
Items.Lift(item, amount)
Items.Lift(item, amount)
Lift an Item and hold it in-hand. ( see: Items.DropFromHand )
Parameters
itemItem
Item object to Lift.
amountInt32
Amount to lift. (0: the whole stack)
Return
Void
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 Item
Serial or Item to display text on.
hueInt32
Color of the message.
messageString
Message as
Return
Void
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 Item
Serial or Item of the Item to move.
destinationInt32 Mobile Item
Serial, Mobile or Item as destination.
amountInt32
Amount to move (-1: the whole stack)
xInt32
Optional: X coordinate inside the container.
yInt32
Optional: Y coordinate inside the container.
Return
Void
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 Item
Serial or Item to move.
amountInt32
Amount of Items to move (0: the whole stack )
xInt32
X world coordinates.
yInt32
Y world coordinates.
zInt32
Z world coordinates.
Return
Void
Items.OpenAt(serial, x, y)
Items.OpenAt(serial, x, y)
Parameters
serialInt32 Item xInt32 yInt32
Return
Void
Items.OpenContainerAt(bag, x, y)
Items.OpenContainerAt(bag, x, y)
Open a container at a specific location on the screen
Parameters
bagItem
Container as Item object.
xInt32
x location to open at
yInt32
y location to open at
Return
Void
Items.Select(items, selector)
Items.Select(items, selector)
Parameters
itemsList[Item] selectorString
Return
Item
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
serialInt32
Serial of the Item.
colorInt32
Color as number. (default: -1, reset original color)
Return
Void
Items.SingleClick(item)
Items.SingleClick(item)
Send a single click network event to the server.
Parameters
itemInt32 Item
Serial or Item to click
Return
Void
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 Item
Serial or Item to use.
targetSerialInt32 EnhancedEntity
Optional: Serial of the Item or Mobile target.
waitBoolean
Optional: Wait for confirmation by the server. (default: True)
Return
Void
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
itemidInt32
ItemID to be used.
colorInt32
Color to be used. (default: -1, any)
Return
Boolean
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 Item
Container as Item object. Container as Item serial.
delayInt32
Maximum wait, in milliseconds. max time to wait for contents
Return
Void
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 Item
Serial or Item read.
delayInt32
Maximum waiting time, in milliseconds.
Return
Void