Scriptname aaTKMerchantOverwatchScript extends QuestFormList property aaTKSLMerchants autoFormList property aaTKMKMerchants autoFormList property aaTKWHMerchants autoFormList property aaTKRFMerchants autoFormList property aaTKWRMerchants autoFormList property aaTKSLBase autoFormList property aaTKMKBase autoFormlist property aaTKWHBase autoFormList property aaTKRFBase autoFormList property aaTKWRBase autoFormList property aaTKSLImports autoFormList property aaTKMKImports autoFormlist property aaTKWHImports autoFormList property aaTKRFImports autoFormList property aaTKWRImports autoEvent OnUpdate()CheckContainers(aaTKSLMerchants, aaTKSLBase, aaTKSLImports)CheckContainers(aaTKMKMerchants, aaTKMKBase, aaTKMKImports)CheckContainers(aaTKWHMerchants, aaTKWHBase, aaTKWHImports)CheckContainers(aaTKRFMerchants, aaTKRFBase, aaTKRFImports)CheckContainers(aaTKWRMerchants, aaTKWRBase, aaTKWRImports)Debug.Notification("Updating merchant item prices")RegisterForSingleUpdate(10)EndEventFunction MerchStartCheck() RegisterForSingleUpdate(1) EndFunctionFunction CheckContainers(FormList MerchContainer, FormList Base, FormList Imports) int i = 0 int x = 0 While i < MerchContainer.getSize() ObjectReference Target = MerchContainer.getAt(i) as ObjectReference If Target != none && Target.IsEnabled() While x < Base.GetSize() ObjectReference ItemTarget = Base.getAt(x) as ObjectReference ObjectReference ImportTarget = Imports.getAt(x) as ObjectReference If Target.GetItemCount(ItemTarget) != 0 Int ItemCount = Target.GetItemCount(ItemTarget) Target.RemoveItem(ItemTarget, ItemCount) Target.AddItem(ImportTarget, ItemCount) EndIf x += 1 EndWhile EndIf i += 1 EndWhile EndFunctionThe Event triggers properly, but the container contents are always the same after it does (the items I'm asking to be replaced are not being replaced), so I'm wondering if I missed anything as to how to adjust the contents of merchant containers properly.
