[dismiss]
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
→First Attempt
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 CheckOnce to 0 | |||
End | |||
Begin GameMode | |||
set Button to GetButtonPressed | |||
if ( Button == -1 ) | |||
Return | |||
elseif ( Button == 0 ) ;Sort Potions | |||
if ( HVHGTOBSE.HasObse == 1 ) | |||
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 | ||
set CheckOnce to 1 | |||
endif | endif | ||
elseif ( Button == 1 ) ;Open Container | |||
Activate | |||
elseif ( Button == 2 ) ;Nevermind | |||
return | |||
endif | endif | ||
End</pre> | End</pre> |