Hellfire29 Posted August 9, 2009 Share Posted August 9, 2009 I'm running the script below to try and make an inventory sorter and every time I activate it, I hear a rumbling noise, Oblivion's memory usage goes up enormously (30mb a second) and the game freezes or it displays "Using if command". The message boxes in the script below were put in by me to troubleshoot the problem, but they are probably making the ominous rumbling noise. The goto 3 command is also a troubleshooting command, but all it does is freeze Oblivion instead of the script not working at all. I'm pretty sure it is to do with the if commands or the set commands, but I can't for the life of me pinpoint the problem or fix it. If anyone has any suggestions on how to fix it, please respond and thanks in advance!short InvPos ref pInvObj ref pCont ref pType ref pCount ref pForm ... begin OnActivate set pCont to player set InvPos to pCont.GetNumItems Label 1 if invpos < 0 Messagebox "Using if command" goto 2 elseif InvPos >= 0 label 3 set InvPos to (InvPos - 1) set pInvObj to (pCont.GetInventoryObject InvPos) set pCount to (pCont.GetItemCount pInvObj) set pForm to pInvObj.GetObjectType If pForm == 33 set pType to pInvObj.GetWeaponType if pType == 0 HLBlade1HRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType ==1 HLBlade2HRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType ==2 HLBlunt1HRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType ==3 HLBlunt2HRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType ==4 HLBowRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType ==5 HLStaffRef.additem pInvObj pCount player.removeitem pInvObj pCount endif elseif pForm == 38 set pType to pInvObj.GetSoulLevel if pType >= 1 && <= 5 HLSoulFRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType ==0 HLSoulERef.additem pInvObj pCount player.removeitem pInvObj pCount endif elseif pForm == 22 set pType to pInvObj.GetEquipmentSlot if pType == 5 HLShoeRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType == 2 HLShirtRef.additem pInvObj pCount player.removeitem pInvObj pCount elseif pType == 3 HLPantRef.additem pInvObj pCount player.removeitem pInvObj pCount endif else goto 1 Messagebox "Using Elseif Command 1" endif Messagebox "Using Elseif Command 4" endif Messagebox "Using Elseif Command 2" endif Messagebox "Using Elseif Command 3" Else Messagebox "Using Else Command" goto 3 goto 1 endif Label 2 MessageBox "Items Sorted" end Link to comment Share on other sites More sharing options...
Recommended Posts