Jump to content
McKay Development

Recommended Posts

Posted

Hello,

 

I have been working on a trade bot. I set it up so that it will accept any trade from me(admin) or a donation(not giving items). So far it accepts all donations but is having issues accepting trades from me. I have made sure my SteamID in my config is SteamID64. According to the console output, it says the trade should have been accepted although it hasn't. Here's the console output and heres my code. Feel free to add me on steam if you think you can help. 

 

http://steamcommunity.com/id/swagattack835/

 

 

10:02:32 PM - info: New offer #2137947588 from [u:1:108568888]

10:02:32 PM - info: User [u:1:108568888] offered a valid trade.  Trying to accept offer.
10:02:34 PM - info: Offer accepted
// Accept any trade offer from the bot administrator, or where we're getting free stuff.
    if (offer.partner.getSteamID64() === Config.admin || offer.itemsToGive.length === 0) {
        logger.info("User "+ offer.partner.getSteam3RenderedID() +" offered a valid trade.  Trying to accept offer.");
        offer.accept(function (err) {
        if (err) {
            logger.error("Unable to accept offer "+ offer.id +": " + err.message);
        } else {
            logger.info("Offer accepted");
            }
    });

Thanks,

 

African

Posted (edited)

Change it to

    if (offer.partner.getSteamID64() === Config.admin || offer.itemsToGive.length === 0) {
        logger.info("User "+ offer.partner.getSteam3RenderedID() +" offered a valid trade.  Trying to accept offer.");
        offer.accept(function (err, status) {
        if (err) {
            logger.error("Unable to accept offer "+ offer.id +": " + err.message);
        } else {
            logger.info("Offer Status:", status);
            }
    });

Check what status outputs.

 

Also remember that if its not a "donation offer" you have to confirm the trade after accepting it

Edited by SunriseM
Posted

Change it to

 

if (offer.partner.getSteamID64() === Config.admin || offer.itemsToGive.length === 0) {
        logger.info("User "+ offer.partner.getSteam3RenderedID() +" offered a valid trade.  Trying to accept offer.");
        offer.accept(function (err, status) {
        if (err) {
            logger.error("Unable to accept offer "+ offer.id +": " + err.message);
        } else {
            logger.info("Offer Status:", status);
            }
    });
Check what status outputs.

 

Also remember that if its not a "donation offer" you have to confirm the trade after accepting it

How can I confirm it, I started the confirmation checker when the client gets a web session. I am at school right now so I will post the code of how I thought it was confirmed when I get home.

Posted (edited)

How can I confirm it, I started the confirmation checker when the client gets a web session. I am at school right now so I will post the code of how I thought it was confirmed when I get home.

If you started the confirmation correctly, offer should be accepted. Also is recommended that you use acceptConfirmationObject instead of starConfirmationChecker. You can read more about it in the steam-community wiki

Edited by SunriseM
Posted

If you started the confirmation correctly, offer should be accepted. Also is recommended that you use acceptConfirmationObject instead of starConfirmationChecker. You can read more about it in the steam-tradeoffer-manager wiki

I found a acceptConfimationForObject method here rather than here. I'll try it out and let you know if it works

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...