我正在使用node.js中的CSGO Trade bot,它不是真正的“错误”,而是更多的逻辑错误。因此,我的机器人能够接受皮肤,并且正常地执行所有操作,但是每次有人存放新皮肤时我的计时器都会循环,并且一旦计时器变为“0”,它就会不断循环。我认为这是编码错误的问题,但如果你们需要更多信息,我会非常乐意添加它。
//Vars
var GameTime = 120;
var sitename = '142.4.205.65:96'; //you guys can look at the site if you want, the server has ddos protection.
var botName = '[CSGOSpoils] Bot #1 Dank Memmes';
var botAdmin = '76561198196029333';
var botAPIkey;
var globalSessionID;
更多
function CheckTimer() {
if(locked == true) return;
locked = true;
if(recheck == true) {
recheck = false;
checkoffers(1000);
}
mysqlConnection.query('SELECT `value` FROM `info` WHERE `name`=\'current_game\'', function(err, rows, fields) {
if(err) return;
mysqlConnection.query('SELECT `starttime` FROM `games` WHERE `id`=\''+rows[0].value+'\'', function(errs, rowss, fieldss) {
if(errs) return;
var timeleft;
if(rowss[0].starttime == 2147483647) timeleft = GameTime;
else {
var unixtime = Math.round(new Date().getTime()/1000.0);
timeleft = rowss[0].starttime+GameTime-unixtime;
if(timeleft < 0) timeleft = 0;
}
if(timeleft == 0) {
if(proceeded == true) return;
proceedWinners();
proceeded = true;
} else proceeded = false;
});
});
流程优胜者功能
function proceedWinners() {
var url = 'http://'+sitename+'/getwinner34634f.php';
request(url, function(error, response, body){});
}