Jump to content
McKay Development

Eradicate

Member
  • Posts

    25
  • Joined

  • Last visited

Posts posted by Eradicate

  1. Oh, you meant in the node module. Open a GitHub issue and someone will get to it at some point, presumably.

    Aren't you the creator of the module?

     

    tbh I need it pretty soon and I don't want to have another request using POST when I've done all the previous coding use the module.

  2. It should already work with an API key.

    TypeError: opskins.TransferToTradeSite is not a function
     
    var transferItems = function(itemIds){
    	opskins.TransferToTradeSite(itemIds.toString(), (err, items) => {
    		if(err){
    			console.log(err);
    			return;
    		}
    
    		//items new output of transfered items to trade site
    		console.log(items);
    	});
    }
    

    It doesn't seem to be implemented, nor work. (and I am authenticated with an API key)

     

    https://docs.opskins.com/public/en.html#IInventory_TransferToTradeSite_v1

  3. It is useless with classid... as I have an array with the skin names :P, but thanks for reply.

    I had the script to get the image of a skin name, it was requesting the steam market with the skin name given and it were getting the skin image.

    But I do not have the code and I do not have any idea how to make it right now :'(

    Well, it'd be intresting to see how that would work but I do know an API that supports images by name; 

     

    have a look at this API and then the v1/items, you can loop over the objects check if the market_hash_name's match, if so return the image (icon_url). I don't think they allow infinite requests so you would have to cache/store the json somewhere.

     

    http://csgo.steamlytics.xyz/api

  4. I was wondering how many requests can I make with bots etc. to deposit items? I don't think it is infinite is it?

    I was wondering as I wanted to make a bot that automatically sells his items on opskins, and I'm wondering if I should have a listener that listens over the bots his inventory or should just immediately list the incoming items on opskins (for example the bot receives an offer with a few items, these few items get sent trough to opskins their bots and automatically sold).

     

    Thanks.

  5. I'm having multiple bots which I store in a public array named `publicManager`.

    I have set my manager options as the following for each bot;
     

          const manager = new TradeOfferManager({
            steam: client,
            community: community,
            language: 'en',
            "cancelTime": 60 * 3 * 1000 
          });
    
          manager.id = data.id;
          manager.identity_secret = data.identity_secret;
    

    When the bot his client receives the webSession call I push the object into the publicManager array, now whenever I try send a trade with it I will get the bot by finding his BotId.

    Now I'm having issues trying to confirm the offer, everything goes well until it gets to the confirmation part;
     

    offer.send((err, status) => {
            if (err) {
              console.log(err);
            } else {                  
              selectedManager.acceptConfirmationForObject(selectedManager.identity_secret, offer.id, function(err){
                if(err){
                  console.log(err);
                  return;
                }
    
                console.log('Succesfully confirmed the offer.');
              });
            }
          });
    

    for some odd reason it throws the error OfferLimitExceeded (e15), altough there are no trades open, did I misuse acceptConfirmationForObject? Cause' I'm a bit lost at this point.

    Thanks in advance.

     

  6. Hi, I'm trying to get the assetid after the sentOfferChanged notices an accepted error, the code that I'm currently using logs the old assetid (at least thats what I think) instead of the new one. What seems to be the issue?

    Should offer.itemsToReceive be changed to something else, as this basically says ToReceive as in still have to get as in these assetids will not be updated?

    Code:
     

     manager.on('sentOfferChanged', function(offer) {  
            var state = offer.state;
    
            //check for deposit or witrhdrawl, if withdrawl refund to their inventory.
            if(state === 3){
              console.log('[SteamBot] A sent offer was accepted.');   
    
              var items = offer.itemsToReceive,
                  user = offer.partner.getSteamID64(),
                  socket = server.getSocket(user);
    
              items.forEach(function(item){
                database.query('INSERT INTO `inventories` SET `assetid` = ' + database.pool.escape(item.assetid) + ', `market_hash_name` = ' + database.pool.escape(item.market_hash_name) + ', `user` = ' + database.pool.escape(user) + ', `image` = ' + database.pool.escape(item.icon_url) + ', `status` = 1, `bot` = ' + database.pool.escape(data.id), function(error, call) {
                  if(error){
                    return;
                  }
                });
              });
    
              server.showAlert(socket, 'success', 'Transaction was successfully completed.');
            }
          });
    

    Thanks in advance.

  7. Whenever you get an offer you need to confirm it, or the bot does.

     

    You can do this by setting up a interval that confirms the confirmations every X seconds, but this method is deprecated I believe, you should now be using;
     

               community.acceptConfirmationForObject(data.identity_secret, offer.id, function(err){
                  if(err){
                    console.log(err);
                    return;
                  }
    
                  console.log('Succesfully confirmed the offer.');
                })
    
    
    

    Replace with your bots identity secret and the offerid of the sent out offer.

    Edit: might of misread it.

  8. I don't understand what you're trying to do here. Why manually make the request instead of using getUserInventoryContents? What do you mean by "not having to cache anything"?

    People going on my site should have got their inventory loaded, therefore I want to get the contents from his inventory, send it to the client, and load his inventory on there.

     

    I believe getUserInventoryContents requires a manager to be used, and I'm using multiple bots, it would seem to me like a bad sport just to use a random bots his manager to load someones inventory.

  9. Heyo,

    I've been looking to load someones inventory, I'd like to get the contents and send them over to the server, would the following way be a good way to load someones inventory? Would I be needing to cache their inventories?

    var request = require('request');
    
    request('https://steamcommunity.com/inventory/x/578080/2', function(error, response, body) {
    	if(error){
    		console.log(error);
    		return;
    	}
    
    	var inventory = JSON.parse(body);
    
    	inventory.descriptions.forEach(function(data){
    		console.log(data.market_name);
    	});
    });

    Also, would I not just be able to load someones inventory using manager.getUserInventoryContents to load their inventories without having to cache anything?

  10. Edit: sorry for posting in the wrong section!

     

    Alright, so I've switched bot and switched VPS and it will login to the bot just fine,

    then it will spam 'Checking confirmations' in the console of the server,

     

    whenever I then try to get an update from `newOffers` it will not receive any whenever I sent a tradeoffer.

    Am I missing something or, what happened?

    Code (basically from the tutorial provided):
     

    const SteamUser = require('steam-user');
    const SteamTotp = require('steam-totp');
    const SteamCommunity = require('steamcommunity');
    const TradeOfferManager = require('steam-tradeoffer-manager');
    
    const client = new SteamUser();
    const community = new SteamCommunity();
    const manager = new TradeOfferManager({
    	steam: client,
    	community: community,
    	language: 'en',
      "cancelTime": 90000
    });
    
    community.on('debug', console.log);
    
    const logOnOptions = {
    	accountName: 'x',
    	password: 'x',
    	twoFactorCode: SteamTotp.generateAuthCode('x+x/x+I=')
    };
    
    client.logOn(logOnOptions);					
    
    client.on('loggedOn', () => {
    	console.log('Logged into Steam');
    
    	client.setPersona(SteamUser.Steam.EPersonaState.Online);
    });
    
    client.on('webSession', (sessionid, cookies) => {
     	manager.setCookies(cookies);
    
    	community.setCookies(cookies);
    	community.startConfirmationChecker(15000, 'x=');	
    });
    
    manager.on('newOffer', offer => {
      if (offer.partner.getSteamID64() === 'x') {
        offer.accept((err, status) => {
          if (err) {
            console.log(err);
          } else {
            console.log(`Accepted offer. Status: ${status}.`);
          }
        });
      } else {
        offer.decline(err => {
          if (err) {
            console.log(err);
          } else {
            console.log('Canceled offer from scammer.');
          }
        });
      }
    });
    
  11. I'm using the following code but the 'newOffer' event is never being called and according to the docs this only works if polling is enabled, which should be.

     

    What am I doing wrong?

     

    var steamuser = require('steam-user');
    var steamtotp = require('steam-totp');
    var trademanager = require('steam-tradeoffer-manager');
    var SteamCommunity = require('steamcommunity');
    
    var data = [
    	{
    		username:'',
    		password:'',
    		shasec:'/XqviM=',
    		shacon:'++3t4fpJI='
    	},
    	{
    		username:'',
    		password:'',
    		shasec:'=',
    		shacon:'+P+kKyvfYk='
    	}
    ]; 
    
    var client = [];
    var manager = [];
    var community = [];
    
    var initializeClients = function(data) {
    	for (var index in data) {
    		initializeClient(index);
    	};
    };
     
    var initializeClient = function(index) {
      	var account = data[index];
      	
       	community[index] = new SteamCommunity();
    	client[index] = new steamuser();
    	manager[index] = new trademanager({
    		"steam": client[index],
    		"community": community[index],
    		"language": "en"
    	});
    
    	console.log('[Account] [', account.username,'] is logging on');
    	client[index].logOn({
    		'accountName': account.username,
    		'password': account.password,
    		'twoFactorCode': steamtotp.generateAuthCode(account.shasec)
    	});
    
    	client[index].on('loggedOn', function() {
    		console.log('[Account] Success!');
    	});
    
    	client[index].on('webSession', (sessionid, cookies) => {
    		manager[index].setCookies(cookies, function(err){
    			console.log('API Key retrieved');
    		});
    
    		community[index].setCookies(cookies);
    		community[index].startConfirmationChecker(15000, account.shacon);	
    
    		console.log('webSession ID: ' + sessionid);
    	});
    
    	client[index].on('newOffer', function(offer, oldState) {
    		console.log('[Account] [', account.username,'] has a newly received offer!');
    	});
    };
    
    
    initializeClients(data);
    
    Edit: I removed the second setCookies as it was not needed, also added an error check on setCookies but it does not throw any errors.
    
    
  12. It's all in the docs. offerList gets emitted whenever the offer list is retrieved, no matter what queried for it. Including polling.

    Okay. I can then check for an incoming offer, check if the bot is sending out items, if he is, cancel the offer after X seconds; if not, cancel it in a shorter amount.

     

    That'd work?

     

    Edit: would this not just work on 'newOffer' - do the same thing as above.

    Edit: is newOffer emitted for incoming offers?

    Edit: problem with using offerList is, I'm barely ever using the getOffers function, I need a function that calls when a offer is sent out, check if the recieving items are 0, if so make the trade cancel after a timeout.

  13. There is no mechanism in steam-tradeoffer-manager to automatically cancel incoming offers, because there's no real technical need to do that since there's no limit on incoming offers like there is for sent offers. You'd need to implement it yourself, ideally using the offerList event to watch for a list of offers and declining those that are too old for you.

    Well, this events updates every time a new offer was added? I could also call a timeout after sending the offer, checking if it still exists if so, cancel it; or would this not be viable?

×
×
  • Create New...