Scriptname ETR_CellStorageScript extends ObjectReference FormList Property ETR_ItemsNew Auto FormList Property ETR_ItemsFound Auto FormList Property ETR_ItemsStored Auto FormList Property ETR_PersistentStorageList Auto event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) Debug.Notification("OnItemRemoved") bool bStored = ETR_ItemsStored.HasForm(akBaseItem) if GetItemCount(akBaseItem) > 0 if ! bStored ETR_ItemsFound.RemoveAddedForm(akBaseItem) ETR_ItemsNew.RemoveAddedForm(akBaseItem) ETR_ItemsStored.AddForm(akBaseItem) Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsStored.") endif return endif if Eddoursul_Functions.GetItemCountInList(ETR_PersistentStorageList, akBaseItem) Debug.Notification("ETR_PersistentStorageList") ; do nothing if ! bStored ETR_ItemsFound.RemoveAddedForm(akBaseItem) ETR_ItemsNew.RemoveAddedForm(akBaseItem) ETR_ItemsStored.AddForm(akBaseItem) Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsStored.") endif else ETR_ItemsNew.RemoveAddedForm(akBaseItem) ETR_ItemsStored.RemoveAddedForm(akBaseItem) ETR_ItemsFound.AddForm(akBaseItem) Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsFound.") endif endevent event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if ETR_ItemsStored.HasForm(akBaseItem) return endif ETR_ItemsFound.RemoveAddedForm(akBaseItem) ETR_ItemsNew.RemoveAddedForm(akBaseItem) ETR_ItemsStored.AddForm(akBaseItem) ;UI.Invoke("HUD Menu", "_root.AHZWidgetContainer.AHZWidget.RefreshWidgets") Debug.Notification("Added " + akBaseItem.GetName() + " to cell storage and ETR_ItemsStored.") endevent