I am trying to write a trivia game to run in a skype chat!
it will be a bot to ask random questions and tell the users in the chat if they answered correctly and keep score.....
I am getting a error at this line of code
I'm not sure why.....
here is the entire function...
this is in the constructor......
thank you for any help!
-InkedGFX
it will be a bot to ask random questions and tell the users in the chat if they answered correctly and keep score.....
I am getting a error at this line of code
if (pMessage.Body.ToString().ToLower() != AnswerT.ToString().ToLower())
I'm not sure why.....
here is the entire function...
this is in the constructor......
skype = new Skype(); skype.Attach(8, false); skype.MessageStatus += new _ISkypeEvents_MessageStatusEventHandler(skype_MessageStatus);
public void skype_MessageStatus(ChatMessage pMessage, TChatMessageStatus Status) { user = pMessage.Sender.FullName; // string Asked = AskQuestion(); string Chat_Name = pMessage.ChatName; string what_said = pMessage.Body.Substring(0); if (!lstUsers.Items.Contains(user)) { lstUsers.Items.Add(user); users.Add(user); } if (pMessage.ChatName == Chat_Name) { if (Status == TChatMessageStatus.cmsReceived | Status == TChatMessageStatus.cmsSent) { if (pMessage.Body.ToString().ToLower() != AnswerT.ToString().ToLower()) { ProcessCommand(what_said); } if (pMessage.Body.ToString().ToLower() == AnswerT.ToString().ToLower()) { if (!userScore.ContainsKey(pMessage.Sender.FullName)) { userScore.Add(pMessage.Sender.FullName, 100); pMessage.Chat.SendMessage("[" + user + "]Answered Correct!"); pMessage.Chat.SendMessage("[" + user + "] answered [" + ProcessCorrect() + "] correct questions"); pMessage.Chat.SendMessage("[" + user + "] your score: " + userScore[user]); pMessage.Chat.SendMessage(AskQuestion()); MessageBox.Show(AnswerT); return; } else { userScore[user] = userScore[user] + 100; pMessage.Chat.SendMessage("[" + user + "]Answered Correct!"); pMessage.Chat.SendMessage("[" + user + "] answered [" + ProcessCorrect() + "] correct questions"); pMessage.Chat.SendMessage("[" + user + "] your score: " + userScore[user]); pMessage.Chat.SendMessage(AskQuestion()); MessageBox.Show(AnswerT); } } } } }
thank you for any help!
-InkedGFX
Last edited: