Package org.dreambot.api.wrappers.items
Class Item
- java.lang.Object
 - 
- org.dreambot.api.wrappers.items.Item
 
 
- 
- All Implemented Interfaces:
 Identifiable
public class Item extends java.lang.Object implements Identifiable
 
- 
- 
Constructor Summary
Constructors Constructor Description Item(int id, int amount)Item(int id, int amount, int slot)Item(int id, int amount, int slot, ContainerType containerType) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.String[]getActions()intgetAmount()org.dreambot.internal.cache.wrappers.def.ItemDefinitiongetComposite()ContainerTypegetContainerType()AbstractMouseDestinationgetDestination()Gets theRectangleDestinationfor the Item.intgetDiscardableID()intgetDiscardableValue()intgetEquippedModelFemale1()intgetEquippedModelFemale2()intgetEquippedModelFemale3()intgetEquippedModelFemaleDialogue1()intgetEquippedModelFemaleDialogue2()intgetEquippedModelFemaleTranslationY()intgetEquippedModelMale1()intgetEquippedModelMale2()intgetEquippedModelMale3()intgetEquippedModelMaleDialog1()intgetEquippedModelMaleDialog2()intgetEquippedModelMaleDialogue1()intgetEquippedModelMaleDialogue2()intgetEquippedModelMaleTranslationY()java.lang.String[]getGroundActions()intgetHighAlchValue()intgetId()Gets ID number of the given object.java.awt.image.BufferedImagegetImage()java.awt.image.BufferedImagegetImageWithAmount()intgetInventoryModelID()intgetLightIntensity()intgetLightMagnitude()intgetLivePrice()This will get the average selling price on the GE, if availableintgetLowAlchValue()short[]getModelRecolorOriginal()short[]getModelRecolorTarget()intgetModelScaleX()intgetModelScaleY()intgetModelScaleZ()java.lang.StringgetName()Gets the name of the given object.intgetNotedItemId()intgetNotedItemID()Deprecated.seegetNotedItemId()java.util.Map<java.lang.Integer,java.lang.Object>getParams()intgetPlaceholderID()intgetPlaceholderValue()short[]getReTextureToFind()short[]getReTextureToReplace()intgetRotationLength()intgetRotationX()intgetRotationY()intgetRotationZ()intgetShiftClickIndex()intgetSlot()For Inventory items only!int[]getStackVariantID()int[]getStackVariantSize()int[]getSubActionIndex(java.lang.String... actions)Gets the first parent index for a sub action foundintgetTeam()intgetTranslateX()intgetTranslateY()intgetUnnotedItemId()intgetUnnotedItemID()Deprecated.intgetValue()Base item value determined by Jagex, high/low alch is based on this value.booleanhasAction(java.lang.String... actions)booleanhasDefinition()inthashCode()booleanhasSubAction(java.lang.String... actions)booleaninteract()seeinteract(String)with action of nullbooleaninteract(java.lang.String action)Interacts with this item in its respective container using the action given.booleanisMembersOnly()booleanisNotable()booleanisNoted()booleanisPlaceholder()booleanisStackable()booleanisTradable()booleanisValid()Checks to make sure the item has valid id, stack size, and namevoidsetAmount(int amount)voidsetComposite(org.dreambot.internal.cache.wrappers.def.ItemDefinition composite)voidsetDestination(RectangleDestination destination)Manually sets the destination for this item.java.lang.StringtoString()booleanuseOn(int id)Uses this item on another item
Note: this item MUST be an inventory item for this method to workbooleanuseOn(java.lang.String name)Uses this item on another item
Note: this item MUST be an inventory item for this method to workbooleanuseOn(Filter<Item> filter)Uses this item on another item
Note: this item MUST be an inventory item for this method to workbooleanuseOn(Entity entity)Uses this item on an entity
Note: this item MUST be an inventory item for this method to workbooleanuseOn(Item item)Uses this item on another item
Note: both items MUST be inventory items for this method to work- 
Methods inherited from interface org.dreambot.api.wrappers.interactive.Identifiable
getID 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
Item
public Item(int id, int amount, int slot, ContainerType containerType) 
- 
Item
public Item(int id, int amount, int slot) 
- 
Item
public Item(int id, int amount) 
 - 
 
- 
Method Detail
- 
getDestination
public AbstractMouseDestination getDestination()
Gets theRectangleDestinationfor the Item. If there is noContainerTypeon the item, it will return the currently set destination. Otherwise, if the respective container is open, it will recalculate and return the current destination for the item's slot. If the respective container is closed, it will return the last set destination. If no set destination and it cannot calculate a destination, this will return null; 
- 
setDestination
public void setDestination(RectangleDestination destination)
Manually sets the destination for this item. This will be overridden on the next getDestination call if the respective container is available. 
- 
getId
public int getId()
Description copied from interface:IdentifiableGets ID number of the given object.- Specified by:
 getIdin interfaceIdentifiable- Returns:
 - the ID number as integer.
 
 
- 
getAmount
public int getAmount()
 
- 
setAmount
public void setAmount(int amount)
 
- 
getLivePrice
public int getLivePrice()
This will get the average selling price on the GE, if available- Returns:
 - The current average price sold on the GE if found, otherwise 0
 
 
- 
getSlot
public int getSlot()
For Inventory items only!- Returns:
 - Slot for inventory item.
 
 
- 
isMembersOnly
public boolean isMembersOnly()
 
- 
isStackable
public boolean isStackable()
 
- 
getUnnotedItemId
public int getUnnotedItemId()
 
- 
getUnnotedItemID
@Deprecated public int getUnnotedItemID()
Deprecated. 
- 
getNotedItemId
public int getNotedItemId()
 
- 
getNotedItemID
@Deprecated public int getNotedItemID()
Deprecated.seegetNotedItemId() 
- 
isNoted
public boolean isNoted()
 
- 
isNotable
public boolean isNotable()
 
- 
isPlaceholder
public boolean isPlaceholder()
 
- 
getPlaceholderValue
public int getPlaceholderValue()
 
- 
getPlaceholderID
public int getPlaceholderID()
 
- 
getDiscardableValue
public int getDiscardableValue()
 
- 
getDiscardableID
public int getDiscardableID()
 
- 
getComposite
public org.dreambot.internal.cache.wrappers.def.ItemDefinition getComposite()
 
- 
setComposite
public void setComposite(org.dreambot.internal.cache.wrappers.def.ItemDefinition composite)
 
- 
getName
public java.lang.String getName()
Description copied from interface:IdentifiableGets the name of the given object.- Specified by:
 getNamein interfaceIdentifiable- Returns:
 - the name as a string.
 
 
- 
isValid
public boolean isValid()
Checks to make sure the item has valid id, stack size, and name- Returns:
 - True if information is valid, else false
 
 
- 
useOn
public boolean useOn(Entity entity)
Uses this item on an entity
Note: this item MUST be an inventory item for this method to work- Parameters:
 entity- The entity you want to use this item on- Returns:
 - True if successful
 
 
- 
useOn
public boolean useOn(Item item)
Uses this item on another item
Note: both items MUST be inventory items for this method to work- Parameters:
 item- The Item you want to use this item on- Returns:
 - True if successful
 
 
- 
useOn
public boolean useOn(java.lang.String name)
Uses this item on another item
Note: this item MUST be an inventory item for this method to work- Parameters:
 name- The Item name you want to use this item on- Returns:
 - True if successful
 
 
- 
useOn
public boolean useOn(int id)
Uses this item on another item
Note: this item MUST be an inventory item for this method to work- Parameters:
 id- The Item id you want to use this item on- Returns:
 - True if successful
 
 
- 
useOn
public boolean useOn(Filter<Item> filter)
Uses this item on another item
Note: this item MUST be an inventory item for this method to work- Parameters:
 filter- The Item filter you want to use this item on- Returns:
 - True if successful
 
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
interact
public boolean interact()
seeinteract(String)with action of null 
- 
interact
public boolean interact(java.lang.String action)
Interacts with this item in its respective container using the action given. If no container exists, it will check for the item to be in the inventory and then equipment, otherwise it will log an Error. Null actions on Bank/Trade/Deposit Box will use basic actions for 1 amount, eg: Bank would beBank.withdraw(int)Otherwise it will use the respectively needed methods. Note: Action-X does currently not work with Item#interact. Please use respective container classes for that due to the requirement of extra input. If no container exists, it will first check Inventory, then check Equipment for the item.- Parameters:
 action- The action to interact with- Returns:
 - True if successful
 
 
- 
hasAction
public boolean hasAction(java.lang.String... actions)
 
- 
getSubActionIndex
public int[] getSubActionIndex(java.lang.String... actions)
Gets the first parent index for a sub action found- Parameters:
 actions- list of actions to check for- Returns:
 - int[] representing the row path to the action. 1,1 means parent index to hover is 1, clickable action is 1, returns null if not found
 
 
- 
hasSubAction
public boolean hasSubAction(java.lang.String... actions)
 
- 
getTeam
public int getTeam()
 
- 
getValue
public int getValue()
Base item value determined by Jagex, high/low alch is based on this value.- Returns:
 - Base item value, 0 if definition is not found
 
 
- 
getShiftClickIndex
public int getShiftClickIndex()
 
- 
isTradable
public boolean isTradable()
 
- 
getActions
public java.lang.String[] getActions()
 
- 
getLowAlchValue
public int getLowAlchValue()
 
- 
getHighAlchValue
public int getHighAlchValue()
 
- 
getEquippedModelMaleDialog2
public int getEquippedModelMaleDialog2()
 
- 
getReTextureToReplace
public short[] getReTextureToReplace()
 
- 
getEquippedModelMaleDialog1
public int getEquippedModelMaleDialog1()
 
- 
getReTextureToFind
public short[] getReTextureToFind()
 
- 
getParams
public java.util.Map<java.lang.Integer,java.lang.Object> getParams()
 
- 
getEquippedModelFemale1
public int getEquippedModelFemale1()
 
- 
getEquippedModelFemale2
public int getEquippedModelFemale2()
 
- 
getEquippedModelFemale3
public int getEquippedModelFemale3()
 
- 
getEquippedModelFemaleDialogue1
public int getEquippedModelFemaleDialogue1()
 
- 
getEquippedModelFemaleDialogue2
public int getEquippedModelFemaleDialogue2()
 
- 
getEquippedModelFemaleTranslationY
public int getEquippedModelFemaleTranslationY()
 
- 
getEquippedModelMale1
public int getEquippedModelMale1()
 
- 
getEquippedModelMale2
public int getEquippedModelMale2()
 
- 
getEquippedModelMale3
public int getEquippedModelMale3()
 
- 
getEquippedModelMaleDialogue1
public int getEquippedModelMaleDialogue1()
 
- 
getEquippedModelMaleDialogue2
public int getEquippedModelMaleDialogue2()
 
- 
getEquippedModelMaleTranslationY
public int getEquippedModelMaleTranslationY()
 
- 
getGroundActions
public java.lang.String[] getGroundActions()
 
- 
getInventoryModelID
public int getInventoryModelID()
 
- 
getLightIntensity
public int getLightIntensity()
 
- 
getLightMagnitude
public int getLightMagnitude()
 
- 
getModelRecolorOriginal
public short[] getModelRecolorOriginal()
 
- 
getModelRecolorTarget
public short[] getModelRecolorTarget()
 
- 
getModelScaleX
public int getModelScaleX()
 
- 
getModelScaleY
public int getModelScaleY()
 
- 
getModelScaleZ
public int getModelScaleZ()
 
- 
getRotationLength
public int getRotationLength()
 
- 
getRotationX
public int getRotationX()
 
- 
getRotationY
public int getRotationY()
 
- 
getRotationZ
public int getRotationZ()
 
- 
getStackVariantID
public int[] getStackVariantID()
 
- 
getStackVariantSize
public int[] getStackVariantSize()
 
- 
getTranslateX
public int getTranslateX()
 
- 
getTranslateY
public int getTranslateY()
 
- 
getImage
public java.awt.image.BufferedImage getImage()
 
- 
getImageWithAmount
public java.awt.image.BufferedImage getImageWithAmount()
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
hasDefinition
public boolean hasDefinition()
 
- 
getContainerType
public ContainerType getContainerType()
 
 - 
 
 -