Either way, I can't seem to get it to work. The script is definitely running, but they just don't ever sell. What's wrong? (Side question, how many seconds is a day in both Morrowind and Skyrim?)
Edit:
Also, to explain a little more about how it's supposed to work. Every hour (It's set to 1 second for testing) There's a 1 in 10 chance of an item selling. Once it sets itemsold to 1, it'll pick a random number, which corresponds to one of the possible sold items. If it doesn't sell anything, itemsold will remain at 1, and it'll loop back through until it sells something. I chose to do it this way (beyond it being the easiest way) because it will simulate buyers being less likely to find what they're looking for, if you don't have as wide of a variety of items in stock. Again, this still doesn't work though, so if anyone can help me out, I'd really appreciate it. I literally have no clue why it doesn't work... although I haven't scripted in quite awhile. (Not that I was ever good to begin with. lol)
Begin aaa_shopshort ironshortshort ironlongshort steelmaceshort itemsoldshort perhourshort skillshort randompriceshort randomitemset skill to Player -> GetMercantileset randomprice to Random, 50set randomitem to Random, 4set perhour to ( perhour + GetSecondsPassed )if ( perhour => 1 ) if ( Random, 11 == 1 ) set itemsold to 1 set perhour to 0 EndifEndif if ( itemsold == 1 ) if ( randomitem == 1 ) if ( aaa_shopchest->GetItemCount "iron shortsword" => 1 ) aaa_shopchest->RemoveItem, "iron shortsword", 1 aaa_shopchest->AddItem, "Gold_001", randomprice + skill set itemsold to 0 messagebox "shortsword sold" Endif Endif if ( randomitem == 2 ) if ( aaa_shopchest->GetItemCount "iron longsword" => 1 ) aaa_shopchest->RemoveItem, "iron longsword", 1 aaa_shopchest->AddItem, "Gold_001", 50 + randomprice + skill set itemsold to 0 messagebox "longsword sold" Endif Endif if ( randomitem == 3 ) if ( aaa_shopchest->GetItemCount "steel mace" => 1 ) aaa_shopchest->RemoveItem, "steel mace", 1 aaa_shopchest->AddItem, "Gold_001", 75 + randomprice + skill set itemsold to 0 messagebox "mace sold" Endif EndifEndifEnd