Jump to content


Photo
Question

Trade offers

node.js node-steam-tradeoffer-manager

Best Answer nikita2150 , 09 May 2018 - 07:25 AM

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.

Go to the full post


  • Please log in to reply
11 replies to this topic

#1 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 10:08 AM

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..



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,721 posts

Posted 08 May 2018 - 10:55 AM

We'd need to see code to tell you anything useful.



#3 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 11:34 AM

	    }

Edited by nikita2150, 10 May 2018 - 04:02 AM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,721 posts

Posted 08 May 2018 - 01:20 PM

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.



#5 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 01:57 PM

/*

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 by nikita2150, 10 May 2018 - 04:02 AM.


#6 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 02:02 PM

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



#7 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,721 posts

Posted 08 May 2018 - 03:00 PM

If you're only adding items to their side of the trade, of course you wouldn't be offering any of your items.



#8 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 03:11 PM

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 by nikita2150, 10 May 2018 - 04:03 AM.


#9 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,721 posts

Posted 08 May 2018 - 03:11 PM

Sounds like it's not finding a matching item in their inventory.



#10 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 03:15 PM

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/jffw8l

You could see what I'm talking about


Edited by nikita2150, 08 May 2018 - 03:16 PM.


#11 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 May 2018 - 03:35 PM

Here: http://prntscr.com/jfg63b

You 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 by nikita2150, 08 May 2018 - 03:48 PM.


#12 nikita2150

nikita2150

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 09 May 2018 - 07:25 AM   Best Answer

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 by nikita2150, 09 May 2018 - 04:36 PM.






Also tagged with one or more of these keywords: Question, node.js, node-steam-tradeoffer-manager

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users