Req: Custom Object (Inventory Moving script)

adakos

Active Member
Hi there, i've been looking through a bunch of scripts, and I was wondering if anyone would be able to write or help me write a custom object function,
Well, there are two, really, I think i've got the first one.


ScanItem(ItemName, PackScan)

Code:
objectdef myowntype
{
  member:uint TotalInventoryItem(string Name)
  {
     variable int i = 1
     variable uint Count = 0
     for (${i}<=${Me.Inventory} ; i:Inc)
     {
       if (${Me.Inventory[${i}].Name.Equal[${Name.Escape}]})
       {
         Count:Inc[${Me.Inventory[${i}].Quantity}]
       }
     }
     return ${Count}
  }
}
And to Call it:
Code:
variable myowntype MyOwnObject
if ${MyOwnObject.TotalInventoryItem["Crude Barbed Arrow"]} >= 1
		{
		
		 echo Pulling With :  ${MyOwnObject.TotalInventoryItem["Crude Barbed Arrow"]}
		}
However, I've only got it to scan the entire inventory, which is a start, at least.

However, maybe someone could help me with a move object code from pack1 to pack2 ?

Say, using the script above, if there are less then 50 arrows in pack "Quiver", move 50 arrows from pack "Inventory" to pack "Quiver"


MoveItem(ItemName,PackFrom,PackTo, Quantity)
Code:
???
Any help would be greatly appreciated
 
Top Bottom