PonyExpress Posted March 22, 2020 Report Posted March 22, 2020 Hey. I wanted to know if there is a way to find out if the User's inventory has been changed? Without a second inventory check. Maybe there is a way to get an inventory hash or item count? Suppose the following situation: User uses command !CHECK The bot receives the user's inventory and gives information. User uses command !SELL The bot receives the user's inventory and and sends the trade offer. I would like to get rid of the second inventory check and use the first (I save it). But there may be another situation: User uses command !CHECK The bot receives the user's inventory and gives information. User receives or sells items / Inventory has been changed User uses command !SELL ? Any ideas? I think I can save the result with a time stamp. But I think that even here rare errors are possible. // !check: community.getUserInventoryContents( ... (err, inv) => { hisInv = [inv, Date.now()]; // !sell: if (hisInv and hisInv[1] < Date.now() - $minute) { //sendtradeoffer } else { community.getUserInventoryContents( ... (err, inv) => { //sendtradeoffer Quote
Dr. McKay Posted March 23, 2020 Report Posted March 23, 2020 No, there isn't a way to get an "inventory hash" or anything similar. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.