This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.

Difference between revisions of "User:Candlemaster/Item Sorter"

Jump to navigation Jump to search
imported>Candlemaster
imported>Candlemaster
Line 14: Line 14:
long InvPos
long InvPos
long Quantity
long Quantity
short Button
short CheckOnce
ref pInvObj
ref pInvObj
ref pCont
ref pCont
Line 19: Line 21:


Begin OnActivate
Begin OnActivate
if ( HVHGTOBSE.HasObse == 1 )
MessageBox "What would you like to do?" "Sort Potions" "Open Container" "Nevermind"
set pCont to PlayerRef
set CheckOnce to 0
set InvPos to 0
End
Label
 
set pInvObj to (pCont.GetInventoryObject InvPos)
Begin GameMode
if pInvObj
set Button to GetButtonPressed
if ( pInvObj.GetObjectType == 25 ) ;if the item is an ingredient
if ( Button == -1 )
if ( pInvObj.IsQuestItem == 0 ) ;don't do anything to a quest item
Return
set Quantity to pCont.GetItemCount pInvObj
elseif ( Button == 0 ) ;Sort Potions
pCont.RemoveItemNS pInvObj Quantity
if ( HVHGTOBSE.HasObse == 1 )
AddItemNS pInvObj Quantity
if ( CheckOnce == 0 ) ;Only go through the player's inventory once
set pCont to PlayerRef
set InvPos to 0
Label
set pInvObj to (pCont.GetInventoryObject InvPos)
if pInvObj
if ( pInvObj.GetObjectType == 25 ) ;If the item is an ingredient
if ( pInvObj.IsQuestItem == 0 ) ;Don't do anything to a quest item
set Quantity to pCont.GetItemCount pInvObj
pCont.RemoveItemNS pInvObj Quantity
AddItemNS pInvObj Quantity
endif
endif
set InvPos to (InvPos + 1)
Goto
endif
endif
endif
set CheckOnce to 1
set InvPos to (InvPos + 1)
Goto
endif
endif
elseif ( Button == 1 ) ;Open Container
Activate
elseif ( Button == 2 ) ;Nevermind
return
endif
endif
End</pre>
End</pre>
Anonymous user

Navigation menu