Author Topic: In DIRE need of help (C#, Same project as the last)  (Read 4304 times)

0 Members and 1 Guest are viewing this topic.

Offline abc

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
In DIRE need of help (C#, Same project as the last)
« on: December 10, 2007, 10:04:34 pm »
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?  :'(

Code: [Select]
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.
« Last Edit: December 10, 2007, 11:17:43 pm by Dale »

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: In DIRE need of help (C#, Same project as the last)
« Reply #1 on: December 13, 2007, 12:00:03 am »
Why is your bot called FyreBot?
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Blaze

  • x86
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
Re: In DIRE need of help (C#, Same project as the last)
« Reply #2 on: December 13, 2007, 10:06:15 am »
Why is your bot called FyreBot?

Because Firebot was already taken!  :P

Also, he idolizes you.
And like a fool I believed myself, and thought I was somebody else...

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: In DIRE need of help (C#, Same project as the last)
« Reply #3 on: December 13, 2007, 12:37:30 pm »
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 have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: In DIRE need of help (C#, Same project as the last)
« Reply #4 on: December 13, 2007, 03:05:07 pm »
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.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: In DIRE need of help (C#, Same project as the last)
« Reply #5 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..."

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: In DIRE need of help (C#, Same project as the last)
« Reply #6 on: December 13, 2007, 04:13:40 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!"
 "..."

Offline abc

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Re: In DIRE need of help (C#, Same project as the last)
« Reply #7 on: December 13, 2007, 09:27:01 pm »
Why is your bot called FyreBot?

I idolize you.







....No, In a serious note though, I just liked the looks of it I guess? :)

Offline Hell-Lord

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: In DIRE need of help (C#, Same project as the last)
« Reply #8 on: December 14, 2007, 02:22:28 am »
My bots called MyndBot  ;D

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: In DIRE need of help (C#, Same project as the last)
« Reply #9 on: December 14, 2007, 02:24:33 am »
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!

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!