Polymorphism Posted March 17, 2017 Share Posted March 17, 2017 (edited) In my script I sell a variety of items to a store, sometimes its 5 exactly, but if not then the script will sell until store stock is 5. It does fine usually until it hits a random bump in the road. It seems that sometimes (usually when having to sell x4 items) it'll hang after selling 2-3 and just sit there. I don't think there is anything crazy about the code, but if anyone has suggestions, please lmk. I need this help http://i.imgur.com/w4hHj9c.png Edit: Image link since embed didn't work. Edited March 17, 2017 by Polymorphism Image embedding isn't working??? Quote Link to comment Share on other sites More sharing options...
Tom Posted March 17, 2017 Share Posted March 17, 2017 Any errors in the log? If it stops selling items, this snippet isn't going to give enough information to dissect the issue. I can't see anything wrong with the logic at first glance. Quote Link to comment Share on other sites More sharing options...
Polymorphism Posted March 17, 2017 Author Share Posted March 17, 2017 1 hour ago, Tom said: Any errors in the log? If it stops selling items, this snippet isn't going to give enough information to dissect the issue. I can't see anything wrong with the logic at first glance. Thats the thing, no errors, no visible issues in the code. It just stops in the middle of the selling process. Which should be on the api side since store.sell("item", 4) is whats hanging. Quote Link to comment Share on other sites More sharing options...
Tom Posted March 17, 2017 Share Posted March 17, 2017 22 minutes ago, Polymorphism said: Thats the thing, no errors, no visible issues in the code. It just stops in the middle of the selling process. Which should be on the api side since store.sell("item", 4) is whats hanging. You need to do some debugging to see at which point it is actually hanging. Print out some lines Quote Link to comment Share on other sites More sharing options...
Polymorphism Posted March 17, 2017 Author Share Posted March 17, 2017 26 minutes ago, Tom said: You need to do some debugging to see at which point it is actually hanging. Print out some lines Im thinking its the api itself. Got stuck buying item3 with 1 left to sell http://i.imgur.com/eIXQ9mC.png [INFO][Bot #1][03/17 12:33:22 PM]: Selling 5x item1 [INFO][Bot #1][03/17 12:33:23 PM]: Done sleeping.. [INFO][Bot #1][03/17 12:33:23 PM]: Out of contains [INFO][Bot #1][03/17 12:33:23 PM]: Selling 3x item2 [INFO][Bot #1][03/17 12:33:26 PM]: Done sleeping.. [INFO][Bot #1][03/17 12:33:26 PM]: Out of contains [INFO][Bot #1][03/17 12:33:26 PM]: Selling 3x item3 Quote Link to comment Share on other sites More sharing options...
Polymorphism Posted March 17, 2017 Author Share Posted March 17, 2017 Yeah ima say its the api and probably submit bug report. I changed up the code to sell 5 if amount is 5, or loop x times and sell 1. This way works just fine without hanging whatsoever. http://i.imgur.com/Rr6iHKQ.png Quote Link to comment Share on other sites More sharing options...
Juggles Posted March 17, 2017 Share Posted March 17, 2017 (edited) Use logs to see what is returning true To see if it is going to the part Edited March 17, 2017 by Juggles Quote Link to comment Share on other sites More sharing options...
XmQ Posted March 17, 2017 Share Posted March 17, 2017 Perhaps the condition is nulling. Quote Link to comment Share on other sites More sharing options...
Polymorphism Posted March 17, 2017 Author Share Posted March 17, 2017 5 minutes ago, XmQ said: Perhaps the condition is nulling. Which condition?? I see no reason for any conditions to be null as I am careful to not create NPEs in my code. If there is a NPE, then it must be suppresed somehow and its on the bot side of things Quote Link to comment Share on other sites More sharing options...
d0zza Posted March 20, 2017 Share Posted March 20, 2017 I was also trying to use Store.sell() about a month ago for a script and gave up because I was having problems with it too Quote Link to comment Share on other sites More sharing options...
Juggles Posted March 20, 2017 Share Posted March 20, 2017 18 minutes ago, d0zza said: I was also trying to use Store.sell() about a month ago for a script and gave up because I was having problems with it too You can use inventory.interact instead Quote Link to comment Share on other sites More sharing options...
Polymorphism Posted March 20, 2017 Author Share Posted March 20, 2017 1 hour ago, Juggles said: You can use inventory.interact instead I tried that and it never once tried interacting with the inventory to sell Quote Link to comment Share on other sites More sharing options...