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

Crawler Type Bot? I see bots that can access the directory of rooms and randomly join one or another. #148

Open
p0sixninja opened this issue Jan 20, 2013 · 4 comments

Comments

@p0sixninja
Copy link

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?

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 {
    console.log("Console Color Setting Is Disabled");




    }

THANK YOU SO MUCH AGAIN Alain!

@alaingilbert
Copy link
Owner

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.

@p0sixninja
Copy link
Author

Thanks for your help alain, the cconsole.log(""); is actually a colorize command for node.js..!

Thanks :)

@p0sixninja
Copy link
Author

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?

@technobly
Copy link
Contributor

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");
}

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

3 participants