LINUX.ORG.RU

Сообщения incognito82

 

Ошибка подключения при запуске скрипта Node

Здравствуйте. Опять я со своими глупыми вопросами, Вы уж извиняйте :)

Проблема в том, что при вводе:

node tradesell.js

Начинается такая пачка ошибок подключения. Что это и откуда эти адреса?

root@83:~/bot# node tradesell.js
socket timed out
socket closed
connecting to 146.66.152.15:27019
socket timed out
socket closed
connecting to 72.165.61.176:27017
socket timed out
socket closed
connecting to 146.66.152.15:27017
socket timed out
socket closed
connecting to 72.165.61.185:27017
socket timed out
socket closed
connecting to 72.165.61.176:27017
socket timed out
socket closed
connecting to 146.66.152.14:27018
socket timed out
socket closed
connecting to 146.66.152.12:27018
socket timed out
socket closed
connecting to 72.165.61.188:27018
socket timed out
socket closed
connecting to 146.66.152.12:27017
socket timed out
socket closed
connecting to 209.197.29.196:27017
socket timed out
socket closed
connecting to 72.165.61.185:27018
socket timed out
socket closed
connecting to 146.66.152.14:27018
socket timed out
socket closed
connecting to 146.66.152.14:27018
socket timed out
socket closed
connecting to 146.66.152.15:27018
socket timed out
socket closed
connecting to 146.66.152.15:27018
socket timed out
socket closed
connecting to 209.197.29.196:27017
socket timed out
socket closed
connecting to 72.165.61.187:27017
socket timed out
socket closed
connecting to 146.66.152.13:27019
socket timed out
socket closed
connecting to 146.66.152.15:27017
socket timed out
socket closed
connecting to 146.66.152.14:27018
socket timed out
socket closed
connecting to 146.66.152.15:27018
socket timed out
socket closed
connecting to 146.66.152.12:27017
socket timed out
socket closed
connecting to 146.66.152.13:27019
socket timed out
socket closed
connecting to 72.165.61.185:27017
socket timed out
socket closed
connecting to 146.66.152.14:27017
socket timed out
socket closed
connecting to 146.66.152.13:27017
socket timed out
socket closed
connecting to 72.165.61.188:27017
socket timed out
socket closed
connecting to 146.66.152.13:27018
socket timed out
socket closed
connecting to 146.66.152.14:27017
socket timed out
socket closed
connecting to 146.66.152.14:27019
socket timed out
socket closed
connecting to 209.197.29.196:27017
socket timed out
socket closed
connecting to 72.165.61.188:27018
socket timed out
socket closed
connecting to 146.66.152.14:27019
socket timed out
socket closed
connecting to 72.165.61.187:27018
socket timed out
socket closed
connecting to 209.197.29.197:27017
socket timed out
socket closed
connecting to 72.165.61.185:27018
socket timed out
socket closed
connecting to 146.66.152.15:27018
socket timed out
socket closed
connecting to 72.165.61.176:27017
socket timed out
socket closed
connecting to 146.66.152.13:27018
socket timed out
socket closed
connecting to 146.66.152.15:27018
socket timed out
socket closed
connecting to 146.66.152.14:27019
socket timed out
socket closed
connecting to 209.197.29.196:27017
socket timed out
socket closed
connecting to 146.66.152.13:27019
socket timed out
socket closed
connecting to 146.66.152.15:27018
socket timed out
socket closed
connecting to 72.165.61.187:27017
socket timed out
socket closed
connecting to 146.66.152.13:27018
socket timed out
socket closed
connecting to 209.197.29.196:27017
socket timed out
socket closed
connecting to 146.66.152.15:27017
socket timed out
socket closed
connecting to 146.66.152.15:27019
socket timed out
socket closed
connecting to 146.66.152.15:27019
socket timed out
socket closed
connecting to 146.66.152.13:27018
socket timed out
socket closed
connecting to 146.66.152.13:27017
socket timed out
socket closed
connecting to 72.165.61.175:27018
socket timed out
socket closed
connecting to 72.165.61.175:27018
socket timed out
socket closed
connecting to 72.165.61.185:27017
socket timed out
socket closed
connecting to 146.66.152.15:27019
socket timed out
socket closed
connecting to 146.66.152.13:27019
socket timed out
socket closed
connecting to 146.66.152.12:27018

 , ,

incognito82
()

Не запускается .js скрипт через node

Здравствуйте. Подскажите, пожалуйста. При запуске .js скрипта выдает такую ошибку.

Node установлен, исходник покажу ниже.

Ошибка:

root@83:~/bot# node tradebot.js
module.js:338
    throw err;
          ^
Error: Cannot find module './'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/root/bot/tradebot.js:15:18)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
root@83:~/bot# 

Исходник:

var logOnDetails = {
  accountName: '**********',
  password: '*************'
};

if (require('fs').existsSync('sentry'))
  logOnDetails.shaSentryfile = require('fs').readFileSync('sentry');

// logOnDetails.authCode = ''; // code received by email

var admin = '76561198076091319'; // put your steamid here to say 'give' to the bot and receive all non-scrap items


var Steam = require('steam');
var SteamTrade = require('./'); // change to 'steam-trade' if not running from the same directory

var steam = new Steam.SteamClient();
var steamTrade = new SteamTrade();

steam.logOn(logOnDetails);

steam.on('debug', console.log);

steam.on('loggedOn', function(result) {
  console.log('Logged in!');
  steam.setPersonaState(Steam.EPersonaState.Online);
});

steam.on('webSessionID', function(sessionID) {
  console.log('got a new session ID:', sessionID);
  steamTrade.sessionID = sessionID;
  steam.webLogOn(function(cookies) {
    console.log('got a new cookie:', cookies);
    cookies.forEach(function(cookie) {
        steamTrade.setCookie(cookie);
    });
  });
});

var inventory;
var scrap;
var weapons;
var addedScrap;
var client;

steam.on('tradeProposed', function(tradeID, otherClient) {
  console.log('tradeProposed');
  steam.respondToTrade(tradeID, true);
});

steam.on('sessionStart', function(otherClient) {
  inventory = [];
  scrap = [];
  weapons = 0;
  addedScrap = [];
  client = otherClient;
  
  console.log('trading ' + steam.users[client].playerName);
  steamTrade.open(otherClient);
  steamTrade.loadInventory(440, 2, function(inv) {
    inventory = inv;
    scrap = inv.filter(function(item) { return item.name == 'Scrap Metal';});
// console.log(scrap);
  });
});

steamTrade.on('offerChanged', function(added, item) {
// console.log(item);
  console.log('they ' + (added ? 'added ' : 'removed ') + item.name);
  console.log(item);
  if (item.tags && item.tags.some(function(tag) {
    return ~['primary', 'secondary', 'melee', 'pda2'].indexOf(tag.internal_name);
  }) && (item.descriptions === '' || !item.descriptions.some(function(desc) {
    return desc.value == '( Not Usable in Crafting )';
  }))) {
    // this is a craftable weapon
    weapons += added ? 1 : -1;
    if (addedScrap.length != Math.floor(weapons / 2)) {
      // need to change number of scrap
      if (added && scrap.length > addedScrap.length) {
        console.log('adding scrap');
        var newScrap = scrap[addedScrap.length];
        steamTrade.addItems([newScrap]);
        addedScrap.push(newScrap);
      } else if (!added && addedScrap.length > Math.floor(weapons / 2)) {
        console.log('removing scrap');
        var scrapToRemove = addedScrap.pop();
        steamTrade.removeItem(scrapToRemove);
      }
    }
  }
});

steamTrade.on('end', function(result) {console.log('trade', result);});

steamTrade.on('ready', function() {
  console.log('readying');
  steamTrade.ready(function() {
    console.log('confirming');
    steamTrade.confirm();
  });
});

steamTrade.on('chatMsg', function(msg) {
  if (msg == 'give' && client == admin) {
    var nonScrap = inventory.filter(function(item) {
      return !~scrap.indexOf(item);
    });
    steamTrade.addItems(nonScrap);
  }
});

 , ,

incognito82
()

RSS подписка на новые темы