saha26211
- 173
- 21
/var/bot3/bot/steambot.js:12
var td = Math.round(new Date().getTime()/1000.0)-items.response.current_time;
^
TypeError: Cannot read property 'current_time' of undefined
at Object.<anonymous> (/var/bot3/bot/steambot.js:12:65)
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)
at startup (node.js:129:16)
at node.js:814:3
Выдаёт после того как заполняю items.php
"if(fs.existsSync('items.txt')) {
var items = fs.readFileSync('items.txt');
items = JSON.parse(items);
var td = Math.round(new Date().getTime()/1000.0)-items.response.current_time;
if(td > 86400) {
request('
'', function(error, response, body) {
fs.writeFileSync('items.txt', body);
items = JSON.parse(body);
if(items.response.success == 0) throw "Cant load items price";
});
}
} else {
request('
'', function(error, response, body) {
fs.writeFileSync('items.txt', body);
items = JSON.parse(body);
if(items.response.success == 0) throw "Cant load items price";
});
}
function getItemPrice(itemname) {
if(typeof items['response']['items'][itemname] == 'undefined') return 0;
return parseFloat(items['response']['items'][itemname]['value']);
}"
Как только очищаю всё, бот запускается, но после отправки трейда не находит ему цену (после отправки кашется)
var td = Math.round(new Date().getTime()/1000.0)-items.response.current_time;
^
TypeError: Cannot read property 'current_time' of undefined
at Object.<anonymous> (/var/bot3/bot/steambot.js:12:65)
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)
at startup (node.js:129:16)
at node.js:814:3
Выдаёт после того как заполняю items.php
"if(fs.existsSync('items.txt')) {
var items = fs.readFileSync('items.txt');
items = JSON.parse(items);
var td = Math.round(new Date().getTime()/1000.0)-items.response.current_time;
if(td > 86400) {
request('
У вас нет разрешения на просмотр ссылки, пожалуйста Войдите или Зарегистрируйтесь
fs.writeFileSync('items.txt', body);
items = JSON.parse(body);
if(items.response.success == 0) throw "Cant load items price";
});
}
} else {
request('
У вас нет разрешения на просмотр ссылки, пожалуйста Войдите или Зарегистрируйтесь
fs.writeFileSync('items.txt', body);
items = JSON.parse(body);
if(items.response.success == 0) throw "Cant load items price";
});
}
function getItemPrice(itemname) {
if(typeof items['response']['items'][itemname] == 'undefined') return 0;
return parseFloat(items['response']['items'][itemname]['value']);
}"
Как только очищаю всё, бот запускается, но после отправки трейда не находит ему цену (после отправки кашется)