Use Me.CustomInventory[] Do trade?

pr517

Active Member
Code:
function main()
{
   ; Puts 30 potions in the first slot of the trade window
   call TradeInventoryItem "Specialist's Elixir of Intellect" 0 30
}

function:bool TradeInventoryItem(string sItemName, int iSlot = 0, int iQuantity = 1)
{
   Me:CreateCustomInventoryArray[nonbankonly]
   if ${Me.CustomInventory[${sItemName}].Index}
      if ( ${Me.CustomInventory[${sItemName}].Quantity} >= ${iQuantity} ) && (( ${iSlot} > -1 ) && ( ${iSlot} < 12 ))
      {
         EQ2Execute "add_trade_item ${Math.Calc64[${Me.CustomInventory[${sItemName}].Index}-1]} ${iSlot} ${iQuantity}"
         return TRUE
      }
   return FALSE
}
 
Top Bottom