Difference between revisions of "Walking Through Inventory Items"

imported>TheNiceOne
imported>TheNiceOne
Line 21: Line 21:


==From the Beginning to the End==
==From the Beginning to the End==
<pre>short InvPos
<pre>short invPos
short invCount
ref pInvObj
ref pInvObj
ref pCont
ref pCont
...
...
set pCont to YourDesiredContainer
set pCont to YourDesiredContainer
set InvPos to 0
set invPos to 0
Label
set invCount to pCont.GetNumItems
set pInvObj to (pCont.GetInventoryObject InvPos)
While invPos < invCount
if pInvObj
   set pInvObj to (pCont.GetInventoryObject invPos)
   set InvPos to (InvPos + 1)
   ;Do whatever you want to do
   ;Do whatever you want to do
   Goto
   set invPos to invPos + 1
endif</pre>
Loop</pre>


==Notes==
==Notes==
Anonymous user