TypeError: First argument needs to be a number, array or string.
Closed this issue · 7 comments
hello,
Try to run node accept-trade-offers.js,
get this error message:
buffer.js:188
throw new TypeError('First argument needs to be a number, ' +
^
TypeError: First argument needs to be a number, array or string.
at new Buffer (buffer.js:188:15)
at Object.fs.read (fs.js:440:14)
at Object. (/path/to/site/accept-trade-offers.js:9:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
can you added detail instruction how run this bot for offline offers? Thx.
hm, i think its not working without bot.js, but in bot,js
var steam = require('steam');
var SteamTrade = require('steam-trade');
pls more documentation
ok, i can run bot.js, now i have:
root@bourbon:path/steambot# node bot.js
2014-03-17T18:31:58.688Z - warn: No servers file found, using defaults
2014-03-17T18:31:59.730Z - error: Caught Steam error cause=logonFail, eresult=65
keep diging, i think reason is guardCode in secret.js
See here for what the errors mean: https://github.com/seishun/node-steam/blob/master/lib/generated/steam_language.js
65 means InvalidLoginAuthCode so your guardCode config must be wrong. You should try to run the bot without a guardCode (set it to null), then you'll get error code 63 (AccountLogonDenied) and Steam will send a code to the email associated with your account. Then change guardCode to what they send you and it should work. After that you can set guardCode to null again or just leave it.
Hello, thx for anwer.
+* Set all config and leave guardCode set to null
i think its correct, but not tested it. When this field equal '', SteamGuard code not sended, i run example.js from Steam module and get guard code, now testing offline offers )
If run bot.js and send offline steam offer, he run CasperJS, and first time works right, any next offer send error:
TypeError: 'null' is not an object (evaluating 'url.toLowerCase') reason this code
var offerUrl = this.evaluate(function() {
return document.querySelector('a.header_notification_tradeoffers').getAttribute('href');
});
offerUrl is null, bcs user not login, i check it on screenshot. I think cookie not send, but read from file and adding to PhantomJS correct.
Keep diging )
I think that just happens when there are no more trade offers to accept.