crownoflife
07-06-2004, 09:01 PM
I'm new to this forum, and am a Web Designer. I know Java, PHP, MySQL, and have dabbled with Flash/Actionscript. I want to have a web-based chat on my company's website for our customers, and while that seems easy enough a request (I found several out there), it also needs to incorporate trivia questions, like what the IRC bots do in the trivia channels. Could someone help point me in the right direction as to how I might go about this? I realize it will vary according to chat client as to the exact implementation, but I'm not looking for the full source code - just a bit of guidance, and maybe there are some tutorials out there but I haven't found any yet. Here are my current thoughts:
I'm guessing I would use the setInterval() function to have the bot display a question every X seconds. After a total of Y seconds have elapsed OR a correct answer has been typed, it would display the next question. The bot would function like another user, because it would be sending messages, but they would be auto-generated & displayed every X seconds. Every time a message is posted by another user, it would parse the message and compare that string to the question's answer, and probably say something as simple as "Correct!" or "Wrong, please try again." I'm not sure how I would have access to the individual messages though - would have to look at the code for the chat client first I guess, which I don't have yet. Furthermore, this bot would always be logged in I'm thinking, assuming trivia is always on, but then when does it start? Maybe I should have the trivia on only during certain times of the day? Still not sure how many different questions I would need and all that. These latter issues though aren't as important just yet.
Thanks in advance for any help you can give me!
----
Rachel
I'm guessing I would use the setInterval() function to have the bot display a question every X seconds. After a total of Y seconds have elapsed OR a correct answer has been typed, it would display the next question. The bot would function like another user, because it would be sending messages, but they would be auto-generated & displayed every X seconds. Every time a message is posted by another user, it would parse the message and compare that string to the question's answer, and probably say something as simple as "Correct!" or "Wrong, please try again." I'm not sure how I would have access to the individual messages though - would have to look at the code for the chat client first I guess, which I don't have yet. Furthermore, this bot would always be logged in I'm thinking, assuming trivia is always on, but then when does it start? Maybe I should have the trivia on only during certain times of the day? Still not sure how many different questions I would need and all that. These latter issues though aren't as important just yet.
Thanks in advance for any help you can give me!
----
Rachel