Beispiel #1
0
        public static void Main(string[] args)
        {
            string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Console.WriteLine("Prelude@# (" + version + ") command line version, welcome user!");
            Console.WriteLine("if you want to stop chatting, enter: 'exit'");
            //initialize interface
            PreLudeInterface pi = new PreLudeInterface();

            //configure prelude
            //define path to mind file
            pi.loadedMind = "mind.mdu";
            //decide whether you want true randomness
            pi.quantumRandomness = false;
            pi.isSpeaking        = true;
            pi.setProactiveMode(true);
            pi.avoidLearnByRepeating = true;

            pi.initializedAssociater = Mind.MatchingAlgorithm.Dice;

            //start your engine ...
            pi.initializeEngine();
            //here we go:
            while (!ind.StartsWith("exit"))
            {
                Console.Write("You say: ");
                ind = Console.ReadLine();
                logger.Trace("You say: " + ind);
                string answer = pi.chatWithPrelude(ind);
                Console.WriteLine("Prelude says: " + answer);
                logger.Trace("Prelude says: " + answer);
            }
            pi.stopPreludeEngine();
        }
Beispiel #2
0
        /// <summary>
        /// TODO: wenn eingabe in animationsliste, play animation - wenn nicht, random
        /// TODO: save last agent in registry
        /// TODO: if found melissa, start melissa, else merlin
        /// </summary>
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            StartPosition = FormStartPosition.CenterScreen;

            InitializeComponent();

            pi                 = new PreLudeInterface();
            pi.loadedMind      = loadedMind;
            pi.isContributable = false;
            pi.isSpeaking      = false;
            pi.proactiveMode   = true;
            //pi.reportBoredom += new PreLudeInterface.AutoSpeakHandler(iamBored);
            pi.initializeEngine();
            menuSettingsContribute.Checked = false;
            axAgent1.Hide();
            lastAgent = LoadLastAgent();
            inputBox.Focus();
            inputBox.Clear();
            if (lastAgent != "")
            {
                LoadAgent(lastAgent);
            }
            idleControl.Start();
            agentSpeakingChecker.Start();
        }
Beispiel #3
0
 void MenuFileOpenClick(object sender, System.EventArgs e)
 {
     openFileDialog1.Filter = strFilter;
     openFileDialog1.ShowDialog();
     if (openFileDialog1.FileName != "")
     {
         pi         = new PreLudeInterface();
         loadedMind = openFileDialog1.FileName;
         pi.initializeEngine();
     }
 }
Beispiel #4
0
        public static void Main(string[] args)
        {
            Console.WriteLine("going to test PLE");
            //initialize interface
            PreLudeInterface pi = new PreLudeInterface();

            //define path to mind file
            pi.loadedMind = "mind.mdu";
            //start your engine ...
            pi.initializeEngine();
            //here we go:
            Console.WriteLine("You say: " + "hello Prelude");
            Console.WriteLine("Prelude says: " + pi.chatWithPrelude("hello Prelude"));
            pi.stopPreludeEngine();
        }
        public static void Main(string[] args)
        {
            Console.WriteLine("# worldz first prelude im server rulez!!\n");
            timer          = new System.Timers.Timer();
            timer.Elapsed += new System.Timers.ElapsedEventHandler(updateContacts);
            MainClass mc = new MainClass();

            //initialize interface
            pi = new PreLudeInterface();
            pi.proactiveMode = false;
            //define path to mind file
            pi.loadedMind = "mind.mdu";
            //start your engine ...
            pi.initializeEngine();

            mc.startPreludeMSNServer();
            Console.ReadLine();
        }
Beispiel #6
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //initialize interface
            pi = new PreLudeInterface();
            pi.proactiveMode = false;
            //define path to mind file
            pi.loadedMind = "mind.mdu";
            //start your engine ...
            pi.initializeEngine();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
        public static void Main(string[] args)
        {
            Console.WriteLine("Prelude@# (0.5.0) command line version, welcome user!");
            Console.WriteLine("if you want to stop chatting, enter: 'exit'");
            //initialize interface
            PreLudeInterface pi = new PreLudeInterface();

            //define path to mind file
            pi.loadedMind = "mind.mdu";
            //start your engine ...
            pi.initializeEngine();
            //here we go:
            while (!ind.StartsWith("exit"))
            {
                Console.Write("You say: ");
                ind = Console.ReadLine();
                Console.WriteLine("Prelude says: " + pi.chatWithPrelude(ind));
            }
            pi.stopPreludeEngine();
        }
        public Form1()
        {
            InitializeComponent();

            // Note: These use the Skype using reference
            skype.UserStatus    += new _ISkypeEvents_UserStatusEventHandler(Skype_UserStatus);
            skype.CallStatus    += new _ISkypeEvents_CallStatusEventHandler(Skype_CallStatus);
            skype.MessageStatus += new _ISkypeEvents_MessageStatusEventHandler(Skype_MessageStatus);

            // Note: These use the Skype class reference due to ambiguous reference issues
            cSkype = new SkypeClass();
            cSkype._ISkypeEvents_Event_AttachmentStatus += new _ISkypeEvents_AttachmentStatusEventHandler(OurAttachmentStatus);
            cSkype._ISkypeEvents_Event_ConnectionStatus += new _ISkypeEvents_ConnectionStatusEventHandler(OurConnectionStatus);

            // Used to catch our form closing so we can save checkbox information
            FormClosing       += ByeBye;
            pi                 = new PreLudeInterface();
            pi.loadedMind      = loadedMind;
            pi.isContributable = false;
            pi.isSpeaking      = false;
            pi.proactiveMode   = true;
            pi.initializeEngine();
        }
Beispiel #9
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Alternatively start program with parameters: ");
            Console.WriteLine("preludeIrc.exe server port #channelname");
            Console.WriteLine("");
            Thread.CurrentThread.Name = "Main";

            irc.SendDelay            = 500;
            irc.ActiveChannelSyncing = true;
            irc.OnChannelMessage    += new IrcEventHandler(OnChannelMessage);
            irc.OnQueryMessage      += new IrcEventHandler(OnQueryMessage);
            irc.OnBan += new BanEventHandler(OnBanMessage);

            irc.OnError      += new ErrorEventHandler(OnError);
            irc.OnRawMessage += new IrcEventHandler(OnRawMessage);
            if (proactiveMode)
            {
                timer          = new System.Timers.Timer();
                timer.Elapsed += new System.Timers.ElapsedEventHandler(autoAnswering);
            }
            sl = new SortedList();
            string[] serverlist;
            serverlist = new string[] { "irc.dal.net" };
            int    port    = 6667;
            string channel = "#cybejaya";
            string nick    = "preludini";
            string real    = "PLEIRC";

            if (args.Length > 2)
            {
                serverlist[0] = args[0];
                port          = Convert.ToInt32(args[1]);
                channel       = args[2];
            }
            else
            {
                Console.WriteLine("Missing parameters on program start. Start this program with params 'server' 'port' '#channelname'");
            }
            Console.WriteLine("**********************************************************");
            Console.WriteLine("These are my settings: ");
            Console.WriteLine("Trying to connect to " + serverlist[0] + " on port " +
                              port + " - joining channel: " + channel);
            Console.WriteLine("My nickname is: " + nick + " and my real name is: " + real);
            Console.WriteLine("**********************************************************");
            try {
                // here we try to connect to the server and exceptions get handled
                irc.Connect(serverlist, port);
            } catch (ConnectionException e) {
                // something went wrong, the reason will be shown
                System.Console.WriteLine("couldn't connect! Reason: " + e.Message);
                Exit();
            }

            try {
                // here we logon and register our nickname and so on
                irc.Login(nick, real);
                // join the channel
                irc.RfcJoin(channel);

                // here we send just 3 different types of messages, 3 times for
                // testing the delay and flood protection (messagebuffer work)
                irc.SendMessage(SendType.Message, channel, "hi @ all");
                //irc.SendMessage(SendType.Action, channel, "thinks this is cool "+i.ToString());
                //irc.SendMessage(SendType.Notice, channel, "SmartIrc4net rocks "+i.ToString());

                //initialize interface
                pi = new PreLudeInterface();
                //define path to mind file
                pi.loadedMind = "mind.mdu";
                //start your engine ...
                pi.initializeEngine();

                // spawn a new thread to read the stdin of the console, this we use
                // for reading IRC commands from the keyboard while the IRC connection
                // stays in its own thread
                new Thread(new ThreadStart(ReadCommands)).Start();

                // here we tell the IRC API to go into a receive mode, all events
                // will be triggered by _this_ thread (main thread in this case)
                // Listen() blocks by default, you can also use ListenOnce() if you
                // need that does one IRC operation and then returns, so you need then
                // an own loop
                irc.Listen();

                // when Listen() returns our IRC session is over, to be sure we call
                // disconnect manually
                irc.Disconnect();
            } catch (ConnectionException) {
                // this exception is handled becaused Disconnect() can throw a not
                // connected exception
                Exit();
            } catch (Exception e) {
                // this should not happen by just in case we handle it nicely
                System.Console.WriteLine("Error occurred! Message: " + e.Message);
                System.Console.WriteLine("Exception: " + e.StackTrace);
                Exit();
            }
        }