ZECTBynmo / woofus

a turntable.fm bot
http://www.mikevegeto.com/projects/woofus.html
5 stars 1 forks source link

troops #2

Open ItsJakeo opened 12 years ago

ItsJakeo commented 12 years ago

Well now i am trying the bot army and everything goes fine except it doesnt release the trooper bot. It returns the message in the log so I dont know. can you help?

var ROOMID = 'xxxxxxxxxxxxxxx'; var USERID = 'xxxxxxxxxxxxxxx'; // BOT ARMY INFO var num_army_bots = 1; // Update this when adding more bots var botArmyIDs = 'xxxxxxxxxx'; var botArmyAuths = 'xxxxxxxx'; var control_army= true; var currently_sending_trooper = false; var trooper_sent = 0; // Log in woofus' army var botArmy = new Array(); for (botIndex=0;botIndex<num_army_bots;botIndex=botIndex+1) { botArmy[botIndex] = new Bot(botArmyAuths[botIndex], botArmyIDs[botIndex], ROOMID); } bot.on('speak', function(data) { if( data.userid == USERID ) { return; } else { for( botIndex=0; botIndex<num_army_bots; botIndex=botIndex+1 ) { if( data.userid == botArmyIDs[botIndex] ) { return; } } }

    // Get the data
    var name = data.name;
    var text = data.text;

// Hide troops if (data.text.match('hide troops')) { console.log('\nGetting rid of the troops\n\n', data); for( botIndex=0; botIndex<num_army_bots; botIndex=botIndex+1 ) { botArmy[botIndex].roomDeregister(); } control_army = false; handled_command = true; } // Bring back troops if (data.text.match('bring troops')) { console.log('\nBringing the troops back\n\n', data); for( botIndex=0; botIndex<num_army_bots; botIndex=botIndex+1 ) { botArmy[botIndex].roomRegister(current_room); } control_army = true; handled_command = true;

}
ZECTBynmo commented 12 years ago

What do you mean by it doesn't release the trooper bot? What message is being returned? What log?

Please be more specific.

ItsJakeo commented 12 years ago

as in it does not initiate the trooper bot, so it doesnt enter room. I dont get an error or anything but the trooper bot will not initiate? the log just says the response thats set and thats all.

ZECTBynmo commented 12 years ago

Are you familiar with node-inspector? I would suggest using that or some other server side debugger to see exactly what's happening. It's hard to troubleshoot what's happening without that.

What exactly are you doing? Are you using woofus's script exactly as it is? Did you create turntable.fm accounts for all the bots you want to start, and put their auth info in?