nikita2150 Posted May 8, 2018 Report Posted May 8, 2018 Hey, I've created a bot and when I write to him !sell [item], he displays me how much i need to pay and creates a offer - with the item and his payment.The problem is it sometimes sends me the payment and I shouldn't give him anything. I've checked it with itemsToGive ItemsToRecieve and it didn't work.Then I saw the isGlitched() method but everytime the bot sends a trade, it shows that it's glitched although sometimes it isn't.. Quote
Dr. McKay Posted May 8, 2018 Report Posted May 8, 2018 We'd need to see code to tell you anything useful. Quote
nikita2150 Posted May 8, 2018 Author Report Posted May 8, 2018 (edited) } Edited May 10, 2018 by nikita2150 Quote
Dr. McKay Posted May 8, 2018 Report Posted May 8, 2018 Need to see more than that. Specifically how you're adding items to it. Also, !offer.state == 11 won't do what you think it does. It translates into (!offer.state) == 11 or false == 11. Quote
nikita2150 Posted May 8, 2018 Author Report Posted May 8, 2018 (edited) /* theirItem - > value from the !sell [theirItem] inventory - > manager.getUserInventoryContents(steamID, 440, 2, true, function(err, inventory) everything is fine though, it just sometimes creates offers without taking anything but when it works, it works good.also, I've checked the RecieveItems and ItemsToGive values when im not taking anything in the offer and everything was correct, the item should've been there but it's not. Edited May 10, 2018 by nikita2150 Quote
nikita2150 Posted May 8, 2018 Author Report Posted May 8, 2018 Need to see more than that. Specifically how you're adding items to it. Also, !offer.state == 11 won't do what you think it does. It translates into (!offer.state) == 11 or false == 11.Also i've fixed the !offer.state bug Quote
Dr. McKay Posted May 8, 2018 Report Posted May 8, 2018 If you're only adding items to their side of the trade, of course you wouldn't be offering any of your items. Quote
nikita2150 Posted May 8, 2018 Author Report Posted May 8, 2018 (edited) Im telling that I'm offering items from my side but the problem is it's not adding items in their side ItemsToRecieve and I've already said, it sometimes puts the items, sometimes not.I though you wanted only 1 adding but here you go: /* keysLeft, scrapLeft .. is how much of the specific metal I should add.. Edited May 10, 2018 by nikita2150 Quote
Dr. McKay Posted May 8, 2018 Report Posted May 8, 2018 Sounds like it's not finding a matching item in their inventory. Quote
nikita2150 Posted May 8, 2018 Author Report Posted May 8, 2018 (edited) First of all, I've checked it does.Secondly, I've already written that the value of offer.itemsToReceive when it adds the item and when it does not is the same, that means it should add the item, it found it but it didn't....For an example, in this image : https://prnt.sc/jffw8lYou could see what I'm talking about Edited May 8, 2018 by nikita2150 Quote
nikita2150 Posted May 8, 2018 Author Report Posted May 8, 2018 (edited) Here: http://prntscr.com/jfg63bYou could see, the cmd shows that there's 1 item to give and 1 to recieve but in the actual order there's only my item.In addition, you could see it found the matching item by the console.log of 'He got this item!'. Edited May 8, 2018 by nikita2150 Quote
nikita2150 Posted May 9, 2018 Author Report Posted May 9, 2018 (edited) So.. I've just created a function that checks the values of the toGive toRecieve with the inventories , compared the values from the price list and if im giving too much it cancels it.. Edit:Actually the problem was with the timings. The scipt wasn't fast enough to seatch through the whole inventory to get the item its needed, by this time the script already sent the offer. Edited May 9, 2018 by nikita2150 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.