my final is do tomorrow, and for some reason my variables aren't following through, or setting to what they're suppose to, when I try to set the line, to a new line it doesn't change, what's going on? :'(
using System;
using System.Collections.Generic;
using System.Text;
using Fluent.Toc;
using System.IO;
using System.Threading;
namespace FyreBot
{
class TriviaManager : ConnectionManager
{
Program prg = new Program();
public StreamReader Reader = new StreamReader("trivia.txt");
//public StreamWriter HighScores = new StreamWriter("highscores.txt");
private string message = null;
private string from = null;
private TocClient toc;
public TocClient Toc
{
get { return toc; }
set { toc = value; }
}
public string Msg
{
get { return message; }
set { message = value; }
}
public string From
{
get { return from; }
set { from = value; }
}
public string question = null;
public string real_answer = null;
public string user_answer = null;
public string line = null;
public static char[] Delimeter = { '*' };
public TriviaManager()
{
Console.WriteLine(Msg);
}
public void Start()
{
user_answer = Msg.ToLower();
line = Reader.ReadLine();
string[] Parsed = line.Split(Delimeter); // Parsed[0] = Question .... Parsed[1] = Answer
question = Parsed[0]; // Question = Parsed[0] (The question)
real_answer = Parsed[1];
Console.WriteLine("Trivia Manager: Started!");
Console.WriteLine(question);
}
public void Validate()
{
user_answer = Msg.ToLower();
line = Reader.ReadLine(); // Question*Answer
string[] Parsed = line.Split(Delimeter); // Parsed[0] = Question .... Parsed[1] = Answer
question = Parsed[0]; // Question = Parsed[0] (The question)
real_answer = Parsed[1];
if (user_answer == Parsed[1])
{
Console.WriteLine("Correct answer!");
goto test;
}
else if (user_answer != Parsed[1])
{
Console.WriteLine("Incorrect answer!");
}
test:
line = Reader.ReadLine();
Parsed = line.Split(Delimeter);
question = Parsed[0];
Console.WriteLine(question);
/*
int i =0;
string[] buffer = File.ReadAllLines("trivia.txt");
char[] del = { '*' };
string[] Parsed = buffer[i].Split(del);
for (i = 0; Questions.ReadLine() != null; i++)
{
}
do
{
Console.WriteLine(Parsed[i]);
}
while (true);
*/
}
public void Stop()
{
Console.WriteLine("Trivia Manager: Trivia now deactivated!");
// stop trivia
}
}
}
EDIT: Nevermind.
Why is your bot called FyreBot?
Quote from: MyndFyre on December 13, 2007, 12:00:03 AM
Why is your bot called FyreBot?
Because Firebot was already taken! :P
Also, he idolizes you.
Quote from: Blaze on December 13, 2007, 10:06:15 AM
Quote from: MyndFyre on December 13, 2007, 12:00:03 AM
Why is your bot called FyreBot?
Because Firebot was already taken! :P
Also, he idolizes you.
Imagine this in the melody of "America, Fuck Yeah":
"MyndFyre, fuck yeah"
Quote from: MyndFyre on December 13, 2007, 12:37:30 PM
Quote from: Blaze on December 13, 2007, 10:06:15 AM
Quote from: MyndFyre on December 13, 2007, 12:00:03 AM
Why is your bot called FyreBot?
Because Firebot was already taken! :P
Also, he idolizes you.
Imagine this in the melody of "America, Fuck Yeah":
"MyndFyre, fuck yeah"
I'm not sure how you pronounce "MyndFyre", but it sure doesn't have 4 syllables (like "America") when I do it, so it sounds completely wrong.
Here's the song: http://youtube.com/watch?v=RFkFvTwcoj0
It would sound a bit weird, but it would easily work.
I think my favorite part is
"Democrats!"
"Fuck yeah!"
"Republicans!"
"...... yeah..."
Quote from: Sidoh on December 13, 2007, 03:15:28 PM
Here's the song: http://youtube.com/watch?v=RFkFvTwcoj0
It would sound a bit weird, but it would easily work.
I think my favorite part is
"Democrats!"
"Fuck yeah!"
"Republicans!"
"...... yeah..."
I like the longer version of that part:
"Democrats!"
"Fuck yeah!"
"Republicans!"
"...... yeah!?..."
"Sportsmanship!"
"..."
"Books!"
"..."
Quote from: MyndFyre on December 13, 2007, 12:00:03 AM
Why is your bot called FyreBot?
I idolize you.
....No, In a serious note though, I just liked the looks of it I guess? :)
My bots called MyndBot ;D
Quote from: rabbit on December 13, 2007, 04:13:40 PM
Quote from: Sidoh on December 13, 2007, 03:15:28 PM
Here's the song: http://youtube.com/watch?v=RFkFvTwcoj0
It would sound a bit weird, but it would easily work.
I think my favorite part is
"Democrats!"
"Fuck yeah!"
"Republicans!"
"...... yeah..."
I like the longer version of that part:
"Democrats!"
"Fuck yeah!"
"Republicans!"
"...... yeah!?..."
"Sportsmanship!"
"..."
"Books!"
"..."
Bed bath and beyond!