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
filter
Items.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
itemid
Int32
ItemID to search.
color
Int32
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
dyes
Item
Dyes as Item object.
dyeingTub
Item
Dyeing Tub as Item object.
color
Int32
Color to choose.
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
container
Int32
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.
Return
Int32

Items
.
ContextExist
(
serial
,
name
)
Items
.
ContextExist
(
serial
,
name
)
Check if Context Menu entry exists for an Item.
Parameters
serial
Int32
Item
Serial or Item to check.
name
String
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
item
Item
Item object to drop.
container
Item
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
item
Int32
Item
Item object to drop.
amount
Int32
Amount to move. (default: 0, the whole stack)
Return
Void

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
itemid
Int32
ItemID filter.
color
Int32
Color filter. (-1: any, 0: natural )
container
Int32
Serial of the container to search. (-1: any Item)
recursive
Int32
Boolean
Search subcontainers. True: all subcontainers False: only main 1,2,n: Maximum subcontainer depth
considerIgnoreList
Boolean
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
serial
Int32
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
itemID
Int32
ItemID to use.
hue
Int32
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
serial
Int32
Item
Serial or Item to read.
index
Int32
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
serial
Int32
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
serial
Int32
Item
Serial or Item to read.
name
String
Name of the Propery.
Return
Single

Items
.
Hide
(
serial
)
Items
.
Hide
(
serial
)
Hied an Item, affects only the player.
Parameters
serial
Int32
Item
Serial or Item to hide.
Return
Void

Items
.
Lift
(
item
,
amount
)
Items
.
Lift
(
item
,
amount
)
Lift an Item and hold it in-hand. ( see: Items.DropFromHand )
Parameters
item
Item
Item object to Lift.
amount
Int32
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
item
Int32
Item
Serial or Item to display text on.
hue
Int32
Color of the message.
message
String
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
source
Int32
Item
Serial or Item of the Item to move.
destination
Int32
Mobile
Item
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.
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
source
Int32
Item
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.
Return
Void

Items
.
Select
(
items
,
selector
)
Items
.
Select
(
items
,
selector
)
Parameters
items
List[Item]
selector
String
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
serial
Int32
Serial of the Item.
color
Int32
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
item
Int32
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
itemSerial
Int32
Item
Serial or Item to use.
targetSerial
Int32
EnhancedEntity
Optional: Serial of the Item or Mobile target.
wait
Boolean
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
itemid
Int32
ItemID to be used.
color
Int32
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
bag
Int32
Item
Container as Item object. Container as Item serial.
delay
Int32
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
itemserial
Int32
Item
Serial or Item read.
delay
Int32
Maximum waiting time, in milliseconds.
Return
Void