User Tools

Site Tools


item_func

This is an old revision of the document!


Scripting - Items data and function

Here can find some information about Enhanced Scripting function and data about Mobiles!

Find

Find item by Serial
Syntax Items.FindBySerial(int)
Description:
Find item and get item object by specific serial
Returns Item
In Object: Items
Parameters: Int serialnumber
Exception: If item not found function return null!

Find item by ItemID
Syntax Items.FindByID(int, int, int [, int=0])
Description:
Find item serial by specific item ID, color and Container (optional container depth). 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.
Returns Item
In Object: Items
Parameters: Int itemid, int color, int serialcontainer
Exception: If item not found function return null!

Move

Move item
Syntax Items.Move(int or item source, item or mobile or int dest, int amount, [int X, int Y] optional)
Description:
Move specific item with amount to specific destination allow also move item on mobile, if set amount 0 move all item stack, if ask to move amount major stack move all stack. Also can specify coords for move item in x y on container grid. All parameters can be int (for serial), or object item and mobile.
Returns none
In Object: Items
Parameters: Item source, Item destination, Int amount or Item source, Mobile destination, Int amount or Item source, Item destination, Int amount, Int XGridPosition, Int YGridPosition

Move item on Ground
Syntax Items.MoveOnGround(item, int, int, int, int)
Description:
Move specific item with amount to specific destination on ground by coords (X, Y, Z).
Returns none
In Object: Items
Parameters: Item source, Int amount, Int XPosition, Int YPosition, Int ZPosition

Drop

Drop Item on ground
Syntax Items.DropItemGroundSelf(item, int)
Description:
Drop on character feet specific item with amount, if set amount 0 move all item stack, if ask to drop amount major stack drop all stack
Returns none
In Object: Items
Parameters: Item source, Int amount

Use

Use item
Syntax Items.UseItem(item or int [,item or int target])
Description:
Use (double click) specific item, can insert item object or serial. The target is optional, but if specified the used item will be applied to the specified target.
Returns none
In Object: Items
Parameters: Item itemToUse or Int serialItemToUse, optionally Item or Int for a target

Single Click
Syntax Items.SingleClick(item or int)
Description:
Perform a single click specific item, can insert item object ot serial
Returns none
In Object: Items
Parameters: Item itemtoclick or Int serialitemtoclick
Use item By ItemID
Syntax Items.UseItemByID(int, int)
Description:
Use (double click) specific item owned by player by ItemID and Color (-1 all color).
Returns none
In Object: Items
Parameters: int itemid, int color
Use item on Mobile
Syntax Items.UseItemOnMobile(int or item, int or mobile)
Description:
Use and autotarget whit 0xBF.2C packet a item on specific mobile (whit out iterruption or target lost).
Returns none
In Object: Items
Parameters: int itemserial or item itemtouse, int mobielserial or mobile mobiletarget
Use item on Mobile or Item
Syntax Items.UseItemOn(int or item, int or mobile or item)
Description:
Use and autotarget with 0xBF.2C packet an item on specific mobile or item (whithout interruption or target lost). Appears to only work on OSI servers
Returns none
In Object: Items
Parameters: int itemSerial or item itemToUse, int serial (item or mobile) or mobile or item object

Properties

Item WaitforProps
Syntax Items.WaitForProps(item or int, int)
Description:
Retrive Propriety of specific item.
Returns none
In Object: Items
Parameters: Item itemtocheck, int serialitemtocheck, Int delay of props wait (ms)
Get Item Proprerties
Syntax Items.GetPropValue(int or item, string)
Description:
Looks up the property by name on left side of ':' parses the numeric value on the right side of the : into a float number and returns the number
Returns float
In Object: Items
Parameters: Int serialtoinspect or Item itemtoinspect, Int PropIndex
Get Item Proprerties
Syntax Items.GetPropValueString(int serial, string propname)
Description:
Looks up the property with the name provided on the left side of a : and returns the string on the right side or the :. Note: partial property name matchs work e.g. “loc” will match to “location”, but “ocation” will not match “location”
Returns string
In Object: Items
Parameters: Int serialtoinspect or Item itemtoinspect, string PropName

Get Item Proprerties String
Syntax Items.GetPropStringByIndex(int or item, int)
Description:
Get string name of prop by index, if no prop in selected index return empty
Returns string
In Object: Items
Parameters: Int serialtoinspect or Item itemtoinspect, Int PropIndex

Get Item Proprerties String List
Syntax Items.GetPropStringList(int or item)
Description:
Get string list of all props name on specific item, if item no props list is empty.
Returns List(string)
In Object: Items
Parameters: Int serialtoinspect or Item itemtoinspect

WaitForContent

Item container WaitforContents
Syntax Items.WaitForContents(item or int, int)
Description:
Force a item to open and automatic wait response for item inside
Returns none
In Object: Items
Parameters: Item itemtouse, int serialitemtouse, Int delay of content wait (ms)

Message

Item Message
Syntax Items.Message(item or int, int, string)
Description:
Display a message over specific item whit color.
Returns void
In Object: Items
Parameters: Int ItemSerial or Item SelectedItem, Int MessageColor, String Message

Filter Type

Enable Filter
Syntax Items.Filter.Enabled
Description:
Enable or not filter in ApplyFilter function.
Returns bool
In Object: Items
Parameters:

Serials Filter
Syntax Items.Filter.Serials
Description:
Set a list of serial to filter in ApplyFilter function.
Returns list(int)
In Object: Items
Parameters:
Graphics Filter
Syntax Items.Filter.Graphics
Description:
Set a list of Graphics to filter in ApplyFilter function.
Returns list(int)
In Object: Items
Parameters:

Color Filter
Syntax Items.Filter.Hues
Description:
Set a list of color to filter in ApplyFilter function.
Returns list(int)
In Object: Items
Parameters:
Name Filter
Syntax Items.Filter.Name
Description:
Set a name to filter in ApplyFilter function, blank no filter by name
Returns string
In Object: Items
Parameters:
Range Min Filter
Syntax Items.Filter.RangeMin
Description:
Set a value of minimum range in ApplyFilter function
Returns int
In Object: Items
Parameters:
Range Max Filter
Syntax Items.Filter.RangeMax
Description:
Set a value of maximum range in ApplyFilter function
Returns int
In Object: Items
Parameters:
Movable Filter
Syntax Items.Filter.Movable
Description:
Set search parameter movable for ApplyFilter function
Returns bool
In Object: Items
Parameters:
Layers Filter
Syntax Items.Filter.Layers
Description:
Set search list by layer for ApplyFilter function
Returns list
In Object: Items
Parameters:
Ground Filter
Syntax Items.Filter.OnGround
Description:
Set search parameter if item is on ground for ApplyFilter function. (1=Only OnGround, 0=Skipp OnGround, -1= Both
Returns Int
In Object: Items
Parameters:
Corpse Filter
Syntax Items.Filter.IsCorpse
Description:
Set search parameter if item is a corpse for ApplyFilter function. (1=Only Corpse, 0=Skipp Corpse, -1= Both
Returns Int
In Object: Items
Parameters:
Container Filter
Syntax Items.Filter.IsContainer
Description:
Set search parameter if item is a container for ApplyFilter function. (1=Only container, 0=Skipp Container, -1= Both).
Returns Int
In Object: Items
Parameters:
Ignore list Filter
Syntax Items.Filter.CheckIgnoreObject
Description:
Set search parameter True or false for remove IgnoreObject from result.
Returns bool
In Object: Items
Parameters:

Apply Filter

Seach an item with a filter
Syntax Items.ApplyFilter(filter)
Description:
Search an item by filter
Returns list(item)
In Object: Items
Parameters: filter

Apply a selector on item list
Syntax Items.Select((List)Item, string)
Description:
Apply a selector on mobile list.
Returns Item
In Object: Items
Parameters: (List)Item, string
Possible selector:

  • Random
  • Nearest
  • Farthest
  • Less
  • Most
  • Weakest
  • Strongest

Count

Count Type in Backpack
Syntax Items.BackpackCount(int, int)
Description:
Return amount of specific item (By ItemID) and color in backpack and subcontainer, Color -1 is WildCard for all color.
Returns Int
In Object: Items
Parameters: int itemID, int color

Count Type in Container
Syntax Items.ContainerCount(int or item, int, int, bool)
Description:
Return amount of specific item (By ItemID) and color in specific container, Color -1 is WildCard for all color.
Returns Int
In Object: Items
Parameters: Int containerserial or Item container, Int itemid, Int color, bool recurse

Hide

Hide item
Syntax Items.Hide(int or item)
Description:
Hide an item.
Returns none
In Object: Items
Parameters: itemId or Item

Context

Context Exist
Syntax Items.ContextExist(int or item, string)
Description:
Check on specific item if context menu by string exist. Return context id if exist, -1 if not present.
Returns int
In Object: Items
Parameters: Int itemserial or item itemtocheck, string contextstring

Device Specific

GetImage
Syntax Items.GetImage(itemID, int hue)
Description:
Return the internal bitmap associated with an itemid
Returns System.Drawing.Bitmap
In Object: Items
Parameters: int itemID, int hue

item_func.1658672251.txt.gz · Last modified: 2022/09/03 22:41 (external edit)

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.