Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

troops #2

Open
ItsJakeo opened this issue Apr 27, 2012 · 3 comments
Open

troops #2

ItsJakeo opened this issue Apr 27, 2012 · 3 comments

Comments

@ItsJakeo
Copy link

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
Copy link
Owner

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

Please be more specific.

@ItsJakeo
Copy link
Author

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
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants