Open p0sixninja opened 11 years ago
When you want to change the current room, use bot.roomRegister(roomId);
.
To know what rooms are available, use bot.listRooms(callback);
.
Finally, your code probably doesn't work, because you wrote console
with two c
.
Next time, you should at least include the error message you get. Else nobody can help.
Thanks for your help alain, the cconsole.log(""); is actually a colorize command for node.js..!
Thanks :)
I guess my question would be, how would the bot know what rooms to join?, i see the callback function there, but in the automation side of this, what could i use to have the bot pick a random one?
This should work, I just reformatted it so you can see it better... is that how you wanted it nested?
the console has two c's because he's using the colorize script, and that's how they recommend wrapping the console function.
if you are setting alarmmessage to true like this -> var alarmmessage = true; then you should just make your if statement like this -> if(alarmmessage) and also if(ccb) can be done the same way.
Also if the second if statement is working, and you have a problem with your colorize function, it may barf on that... try a more simple log statement like cconsole.log("#pink[This message will display]");
if (ccb == "enabled")
{
cconsole.log("#green[Console Color Setting Is Enabled] " + '#red[*(Beta)*]' +
"#green[ Can Cause Unwanted Results]");
if (alarmmessage == "true")
{
cconsole.log("#pink[This message will display ]" + alarmmessage + " #pink[more times]");
}
else
{
//else stuff
}
}
else
{
console.log("Console Color Setting Is Disabled");
}
Iv been reviewing, as google has been my best friend along with the node.js handbook lately ;).. But this one, i cannot grasp...
on('roomChanged', function (data) { })
But how do i actually make the bot change rooms, and look through the active room directory...
Also...... Could you tell me why i can't call a IF statement inside of another IF statement? or any other way i could do this?
THANK YOU SO MUCH AGAIN Alain!