Items
The Items class provides a wide range of functions to search and interact with Items.
Table of Contents
Methods
ApplyFilter
Items.ApplyFilter(filter)Filter the global list of Items according to the options specified by the filter ( see: Items.Filter ).
filter(Items.Filter): A filter object.
List[Item]BackpackCount
Items.BackpackCount(itemid, color)Count items in Player Backpack.
itemid(Int32): ItemID to search.color(Int32): Color to search. (default -1: any color)
Int32ChangeDyeingTubColor
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.
dyes(Item): Dyes as Item object.dyeingTub(Item): Dyeing Tub as Item object.color(Int32): Color to choose.
VoidClose
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.
serial(Int32): Serial or Item to hide.
VoidContainerCount
Items.ContainerCount(container, itemid, color, recursive)Count items inside a container, summing also the amount in stacks.
container(Item): Serial or Item to search into.itemid(Int32): ItemID of the item to search.color(Int32): Color to match. (default: -1, any color)recursive(Boolean): Search also in already open subcontainers.
Int32ContextExist
Items.ContextExist(serial, name)Check if Context Menu entry exists for an Item.
serial(Int32): Serial or Item to check.name(String): Name of the Context Manu entry
Int32DropFromHand
Items.DropFromHand(item, container)Drop into a bag an Item currently held in-hand. ( see: Items.Lift )
item(Item): Item object to drop.container(Item): Target container.
VoidDropItemGroundSelf
Items.DropItemGroundSelf(item, amount, direction)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 don't allow drop where you're standing
item(Item): Item object to drop.amount(Int32): Amount to move. (default: 0, the whole stack)direction(Int32)
VoidFindAllByID
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 subcontainers 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.
itemids(PythonList)color(Int32): Color filter. (-1: any, 0: natural )container(Int32): Serial of the container to search. (-1: any Item)range(Int32)considerIgnoreList(Boolean): True: Ignore Items are excluded - False: any Item.
PythonList, List[Item]FindByID
Items.FindByID(itemid, color, container, recursive, considerIgnoreList)Find a single Item matching specific ItemID, Color and Container. Optionally can search in all subcontainers 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.
itemid(Int32): ItemID filter.color(Int32): Color filter. (-1: any, 0: natural )container(Int32): Serial of the container to search. (-1: any Item)recursive(Boolean): Search subcontainers. True: all subcontainers False: only main 1,2,n: Maximum subcontainer depthconsiderIgnoreList(Boolean): True: Ignore Items are excluded - False: any Item.
ItemFindByName
Items.FindByName(itemName, color, container, range, considerIgnoreList)Find a single Item matching specific Name, Color and Container. Optionally can search in all subcontainers 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.
itemName(String): Item Name filter.color(Int32): Color filter. (-1: any, 0: natural )container(Int32): Serial of the container to search. (-1: any Item)range(Int32): Search subcontainers. 1,2,n: Maximum subcontainer depthconsiderIgnoreList(Boolean): True: Ignore Items are excluded - False: any Item.
ItemFindBySerial
Items.FindBySerial(serial)Search for a specific Item by using it Serial
serial(Int32): Serial of the Item.
ItemGetImage
Items.GetImage(itemID, hue)Get the Image on an Item by specifing the ItemID. Optinally is possible to apply a color.
itemID(Int32): ItemID to use.hue(Int32): Optional: Color to apply. (Default 0, natural)
BitmapGetPropStringByIndex
Items.GetPropStringByIndex(serial, index)Get a Property line, by index. if not found returns and empty string.
serial(Int32): Serial or Item to read.index(Int32): Number of the Property line.
StringGetPropStringList
Items.GetPropStringList(serial)Get string list of all Properties of an item, if item no props list is empty.
serial(Int32): Serial or Item to read.
List[String]GetPropValue
Items.GetPropValue(serial, name)Read the value of a Property.
serial(Int32): Serial or Item to read.name(String): Name of the Propery.
SingleGetPropValueString
Items.GetPropValueString(serial, name)Get a Property line, by name. if not found returns and empty string.
serial(Int32): Serial or Item to read.name(String): Number of the Property line.
StringGetProperties
Items.GetProperties(itemserial, delay)Request to get immediately 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
itemserial(Int32): Serial or Item read.delay(Int32): Maximum waiting time, in milliseconds.
List[Property]GetWeaponAbility
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
itemId(Int32)
ValueTuple[String, String]Hide
Items.Hide(serial)Hied an Item, affects only the player.
serial(Int32): Serial or Item to hide.
VoidIgnoreTypes
Items.IgnoreTypes(itemIdList)Used to ignore specific types. Be careful as you won't see things you ignore, and could result in a mobile being able to kill you without you seeing it
itemIdList(PythonList)
VoidLift
Items.Lift(item, amount)Lift an Item and hold it in-hand. ( see: Items.DropFromHand )
item(Item): Item object to Lift.amount(Int32): Amount to lift. (-1: the whole stack, >0: specific amount)
VoidMessage
Items.Message(item, hue, message)Display an in-game message on top of an Item, visibile only for the Player.
item(Item): Serial or Item to display text on.hue(Int32): Color of the message.message(String): Message as
VoidMove
Items.Move(source, destination, amount, x, y)Move an Item to a destination, which can be an Item or a Mobile.
source(Int32): Serial or Item of the Item to move.destination(Int32): Serial, Mobile or Item as destination.amount(Int32): Amount to move (-1: the whole stack)x(Int32): Optional: X coordinate inside the container.y(Int32): Optional: Y coordinate inside the container.
Void, BooleanMoveAndWait
Items.MoveAndWait(source, destination, amount, timeoutMs)Move an item and wait for the server to confirm the move via ContainerContentUpdate (0x25). This is useful when moving multiple items in sequence to avoid "you must wait" errors. Watches for "wait" messages in journal to detect rate limiting and retries automatically.
source(Int32): Serial of the item to move.destination(Int32): Serial of the destination container.amount(Int32): Amount of items to move (0: the whole stack).timeoutMs(Int32): Maximum time to wait for confirmation in milliseconds.
BooleanMoveOnGround
Items.MoveOnGround(source, amount, x, y, z)Move an Item on the ground to a specific location.
source(Int32): Serial or Item to move.amount(Int32): Amount of Items to move (0: the whole stack )x(Int32): X world coordinates.y(Int32): Y world coordinates.z(Int32): Z world coordinates.
BooleanOpenAt
Items.OpenAt(serial, x, y)serial(Int32)x(Int32)y(Int32)
VoidOpenContainerAt
Items.OpenContainerAt(bag, x, y)Open a container at a specific location on the screen
bag(Item): Container as Item object.x(Int32): x location to open aty(Int32): y location to open at
VoidSelect
Items.Select(items, selector)items(List[Item])selector(String)
ItemSetColor
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.
serial(Int32): Serial of the Item.color(Int32): Color as number. (default: -1, reset original color)
VoidSingleClick
Items.SingleClick(item)Send a single click network event to the server.
item(Item): Serial or Item to click
VoidUseItem
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.
itemSerial(Int32): Serial or Item to use.targetSerial(Int32): Optional: Serial of the Item or Mobile target.wait(Boolean): Optional: Wait for confirmation by the server. (default: True)
VoidUseItemByID
Items.UseItemByID(itemid, color)Use any item of a specific type, matching Item.ItemID. Optionally also of a specific color, matching Item.Hue.
itemid(Int32): ItemID to be used.color(Int32): Color to be used. (default: -1, any)
BooleanWaitForContents
Items.WaitForContents(bag, delay)Open a container an wait for the Items to load, for a maximum amount of time.
bag(Item): Container as Item object.delay(Int32): Maximum wait, in milliseconds.
BooleanWaitForProps
Items.WaitForProps(itemserial, delay)If not updated, request to the Properties of an Item, and wait for a maximum amount of time.
itemserial(Int32): Serial or Item read.delay(Int32): Maximum waiting time, in milliseconds.
Void