public ACCEPTMECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheLogger = MyLogger;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#acceptme", Settings.botid);

            //if (this.CommandIsDisabled == false)
            {
                this.TheAdvHelpCommandHandler.AddCommand("#acceptme - accept me into the guild");
                this.TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#2
0
        public ACCEPTMECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheLogger = MyLogger;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#acceptme", Settings.botid);

            //if (this.CommandIsDisabled == false)
            {
                this.TheAdvHelpCommandHandler.AddCommand("#acceptme - accept me into the guild");
                this.TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
 public DepositCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Storage MyStorage)
 {
     this.TheTCPWrapper = MyTCPWrapper;
     this.TheMessageParser = MyMessageParser;
     this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
     this.TheMySqlManager = MyMySqlManager;
     this.TheInventory = MyInventory;
     this.TheTradeHandler = MyTradeHandler;
     this.TheStats = MyStats;
     this.TheStorage = MyStorage;
     {
         TheAdvHelpCommandHandler.AddCommand("#deposit - deposit something(s) into my storage");
         TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
         this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
     }
 }
示例#4
0
        //private bool CommandIsDisabled;

        public AdminHelpCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, PMHandler MyPMHandler, MySqlManager MyMySqlManager, AdvHelpCommandHandler MyAdvHelpCommandHandler)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.ThePMHandler             = MyPMHandler;
            this.TheAdvHelpComanndHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#adminhelp",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                ThePMHandler.AddCommand("#adminhelp");
                TheAdvHelpComanndHandler.AddCommand("#adminhelp - displays admin help");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
        //private bool CommandIsDisabled;
        public AdminHelpCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,PMHandler MyPMHandler, MySqlManager MyMySqlManager, AdvHelpCommandHandler MyAdvHelpCommandHandler)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.ThePMHandler = MyPMHandler;
                    this.TheAdvHelpComanndHandler = MyAdvHelpCommandHandler;
                    this.TheMySqlManager = MyMySqlManager;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#adminhelp",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                ThePMHandler.AddCommand("#adminhelp");
                TheAdvHelpComanndHandler.AddCommand("#adminhelp - displays admin help");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#6
0
 public DepositCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Storage MyStorage)
 {
     this.TheTCPWrapper            = MyTCPWrapper;
     this.TheMessageParser         = MyMessageParser;
     this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
     this.TheMySqlManager          = MyMySqlManager;
     this.TheInventory             = MyInventory;
     this.TheTradeHandler          = MyTradeHandler;
     this.TheStats   = MyStats;
     this.TheStorage = MyStorage;
     {
         TheAdvHelpCommandHandler.AddCommand("#deposit - deposit something(s) into my storage");
         TheMessageParser.Got_PM       += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
         this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
     }
 }
        public WithdrawCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Storage MyStorage, TradeHandler MyTradeHandler, Stats MyStats, Inventory MyInventory)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheStorage = MyStorage;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats = MyStats;
            this.TheInventory = MyInventory;

            {
                TheAdvHelpCommandHandler.AddCommand("#withdraw - withdraw an item from storage");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
                this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
                TheMessageParser.Get_GlobalMessage += new cs_elbot.BasicCommunication.MessageParser.Get_GlobalMessageEventHandler(TheMessageParser_Get_GlobalMessage);
            }
        }
示例#8
0
        public WithdrawCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Storage MyStorage, TradeHandler MyTradeHandler, Stats MyStats, Inventory MyInventory)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheStorage      = MyStorage;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats        = MyStats;
            this.TheInventory    = MyInventory;

            {
                TheAdvHelpCommandHandler.AddCommand("#withdraw - withdraw an item from storage");
                TheMessageParser.Got_PM            += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
                this.TheTCPWrapper.GotCommand      += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
                TheMessageParser.Get_GlobalMessage += new cs_elbot.BasicCommunication.MessageParser.Get_GlobalMessageEventHandler(TheMessageParser_Get_GlobalMessage);
            }
        }
示例#9
0
        public GiveCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, PMHandler MyPMHandler)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheLogger       = MyLogger;
            this.TheTradeHandler = MyTradeHandler;
            this.ThePMHandler    = MyPMHandler;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#give",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#give / #g - give you an item");
                ThePMHandler.AddCommand("#g");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#10
0
        public DESCRIBECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, PMHandler MyPMHandler)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheLogger = MyLogger;
            this.TheTradeHandler = MyTradeHandler;
            this.ThePMHandler = MyPMHandler;

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#describe / #d - describe an item");
                ThePMHandler.AddCommand("#d");
            //                TheAdvHelpCommandHandler.AddCommand("#d - null");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#11
0
        public DESCRIBECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, PMHandler MyPMHandler)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheLogger       = MyLogger;
            this.TheTradeHandler = MyTradeHandler;
            this.ThePMHandler    = MyPMHandler;

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#describe / #d - describe an item");
                ThePMHandler.AddCommand("#d");
//                TheAdvHelpCommandHandler.AddCommand("#d - null");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#12
0
        public DONATECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheLogger = MyLogger;
            this.TheTradeHandler = MyTradeHandler;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#donate",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#donate - donate something to me");
                TheAdvHelpCommandHandler.AddCommand("#donation - null");
                TheAdvHelpCommandHandler.AddCommand("#d - null");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#13
0
        public DONATECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheLogger       = MyLogger;
            this.TheTradeHandler = MyTradeHandler;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#donate",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#donate - donate something to me");
                TheAdvHelpCommandHandler.AddCommand("#donation - null");
                TheAdvHelpCommandHandler.AddCommand("#d - null");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#14
0
        public GiveToCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, PMHandler MyPMHandler)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheLogger = MyLogger;
            this.TheTradeHandler = MyTradeHandler;
            this.ThePMHandler = MyPMHandler;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#give",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#giveto - give item to person trading with bot");
            //                ThePMHandler.AddCommand("#g");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#15
0
        public BuddyHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, BasicCommunication.Login MyLogin)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
            this.TheMessageParser.Got_LocationInfo += new cs_elbot.BasicCommunication.MessageParser.Got_LocationInfo_EventHandler(TheMessageParser_Got_LocationInfo);
            TheLogin = MyLogin;
            this.TheLogin.Got_LOG_IN_OK +=new cs_elbot.BasicCommunication.Login.Got_LOG_IN_OK_EventHandler(LOG_IN_OK);
            this.TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(TheTCPWrapper_GotConnected);

            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#online",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#online - lists online buddies");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#16
0
        public STOCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Storage MyStorage, TradeHandler MyTradeHandler, Stats MyStats)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheStorage      = MyStorage;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats        = MyStats;

            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#sto - show what's in my storage");
                //TheAdvHelpCommandHandler.AddCommand("#sto - null");
                //TheAdvHelpCommandHandler.AddCommand("#storage - null");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#17
0
        public STOCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Storage MyStorage, TradeHandler MyTradeHandler, Stats MyStats)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheStorage = MyStorage;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats = MyStats;

            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#sto - show what's in my storage");
                //TheAdvHelpCommandHandler.AddCommand("#sto - null");
                //TheAdvHelpCommandHandler.AddCommand("#storage - null");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#18
0
        public BuddyHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, BasicCommunication.Login MyLogin)
        {
            this.TheTCPWrapper                      = MyTCPWrapper;
            this.TheMessageParser                   = MyMessageParser;
            this.TheAdvHelpCommandHandler           = MyAdvHelpCommandHandler;
            this.TheMySqlManager                    = MyMySqlManager;
            this.TheTCPWrapper.GotCommand          += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
            this.TheMessageParser.Got_LocationInfo += new cs_elbot.BasicCommunication.MessageParser.Got_LocationInfo_EventHandler(TheMessageParser_Got_LocationInfo);
            TheLogin = MyLogin;
            this.TheLogin.Got_LOG_IN_OK     += new cs_elbot.BasicCommunication.Login.Got_LOG_IN_OK_EventHandler(LOG_IN_OK);
            this.TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(TheTCPWrapper_GotConnected);


            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#online",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                TheAdvHelpCommandHandler.AddCommand("#online - lists online buddies");
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#19
0
        public INVLISTCommandHandler(HelpCommandHandler MyHelpCommandHandler, TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheInventory = MyInventory;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats = MyStats;
            this.TheHelpCommandHandler = MyHelpCommandHandler;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#invlist",Settings.botid);

            //if (CommandIsDisabled == false)
            {
            //                if (Settings.IsTradeBot == true)
                {
                    TheAdvHelpCommandHandler.AddCommand("#invlist / #il - lists my entire inventory");
                    TheHelpCommandHandler.AddCommand("#il - null");
                }
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#20
0
        public INVLISTCommandHandler(HelpCommandHandler MyHelpCommandHandler, TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats)
        {
            this.TheTCPWrapper            = MyTCPWrapper;
            this.TheMessageParser         = MyMessageParser;
            this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler;
            this.TheMySqlManager          = MyMySqlManager;
            this.TheInventory             = MyInventory;
            this.TheTradeHandler          = MyTradeHandler;
            this.TheStats = MyStats;
            this.TheHelpCommandHandler = MyHelpCommandHandler;
            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#invlist",Settings.botid);

            //if (CommandIsDisabled == false)
            {
//                if (Settings.IsTradeBot == true)
                {
                    TheAdvHelpCommandHandler.AddCommand("#invlist / #il - lists my entire inventory");
                    TheHelpCommandHandler.AddCommand("#il - null");
                }
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
示例#21
0
文件: Main.cs 项目: bignall/CS-ELBot
        //public static myCoords myCurrentCoords = new myCoords();
        //public struct myCoords
        //{
        //    public int x;
        //    public int y;
        //}
        public static void Main(string[] args)
        {
            myHome.x = 0;
            myHome.y = 0;
            myHome.heading = 0;
            myHome.mapName = "";
            // Create instance of the log file handler
            Logger MyLogger = new Logger();

            // Create instance of the TCP client
            TCPClient.TCPClient MyTCPClient = new TCPClient.TCPClient();

            // Initialize the TCPWrapper
            TCPWrapper MyTCPWrapper = new TCPWrapper(MyTCPClient, MyLogger);

            // set up working directory
            if (args.Length > 0)
            {
                string botName = args[0];
                launchPath = args[1];
                SqlServer = args[2];
                SqlPort = Convert.ToInt16(args[3]);
                SqlUsername = args[4];
                SqlPassword = args[5];
                SqlDatabase = args[6];
                Environment.CurrentDirectory = launchPath + botName;
            }
            if (Environment.CurrentDirectory.ToLower().Contains("Live".ToLower()))
            {
                serverName = "live";
            }
            else if (Environment.CurrentDirectory.ToLower().Contains("Test".ToLower()))
            {
                serverName = "test";
            }
            else if (Environment.CurrentDirectory.ToLower().Contains("PK".ToLower()))
            {
                serverName = "pk";
            }
            else
            {
                launchedByBotManager = false;
            launchPath = "C:\\bot\\test\\";
                Console.WriteLine("serverName not found in file path, defaulting to test");
                Console.WriteLine("path containing cs-elbot.exe should be something like c:/bot/test/botname/");
                Console.WriteLine("If you're not using bot manager, don't worry about this message");
            }

            Settings MySettings = new Settings();

            //Load Sql Configuration if not supplied in parameters
            if (SqlServer == "")
            {
                MySettings.LoadSqlSettingsFromConfigfile();
            }

            MySettings.LoadSettings();
            errorHandler MyErrorHandler = new errorHandler();

            //Setup the MySQL Database
            MySqlManager MyMySqlManager = new MySqlManager(SqlServer, SqlUsername, SqlPassword, SqlDatabase, SqlPort, MyLogger, MyTCPWrapper, MyErrorHandler);
            Settings.TradeTimeOut = MyMySqlManager.GetTimeoutInterval(Settings.botid);
            botType = MyMySqlManager.getBotType(Settings.botid);
            //Console.WriteLine("Bot type: " + botType);

            MyMySqlManager.ImStarted(Settings.botid);
            Settings.URL = MyMySqlManager.getURL() + Settings.Loginname + ".php";

            try
            {
                System.Net.IPHostEntry ServerIPHostEntry = System.Net.Dns.GetHostEntry(Settings.ServerHostname);
                MyTCPWrapper.HostIp = ServerIPHostEntry.AddressList[0];
                MyTCPWrapper.Port = Settings.ServerPort;

                Logging.CommandLogger MyCommandDebugger = new Logging.CommandLogger(MyTCPWrapper, MyLogger);

                //BasicCommunication.HeartBeat MyHeartBeat = new BasicCommunication.HeartBeat(MyTCPWrapper, MyErrorHandler);
                BasicCommunication.HeartBeat MyHeartBeat = new BasicCommunication.HeartBeat(MyTCPWrapper);
                BasicCommunication.Ping MyPing = new BasicCommunication.Ping(MyTCPWrapper);
                Inventory MyInventory = new Inventory(MyTCPWrapper, MyLogger, MyMySqlManager);
                Storage MyStorage = new Storage(MyTCPWrapper, MyLogger, MyMySqlManager);
                BasicCommunication.new_minute MyMewMinute = new BasicCommunication.new_minute(MyTCPWrapper, MyMySqlManager, MyInventory);

                // Login here
                BasicCommunication.Login MyLogin = new BasicCommunication.Login(MyTCPWrapper);
                BasicCommunication.RawText MyRawText = new BasicCommunication.RawText(MyTCPWrapper);
                BasicCommunication.MessageParser MyMessageParser = new BasicCommunication.MessageParser(MyRawText, MyLogger, MyTCPWrapper, MyMySqlManager);
                BasicCommunication.changeMap MyChangeMap = new BasicCommunication.changeMap(MyTCPWrapper);

                //if this is a storage bot (not a tradebot) start a shutdown timer
                if (Settings.IsTradeBot == false && botType == 2)
                {
                    BasicCommunication.Shutdown MyShutdown = new BasicCommunication.Shutdown(MyTCPWrapper, MyMessageParser, MyMySqlManager, MyErrorHandler);
                }

                Logging.LoginLogger MyLoginLogger = new Logging.LoginLogger(MyLogin, MyLogger, MyTCPWrapper, MyMySqlManager);
                Logging.MessageLogger MyMessageLogger = new Logging.MessageLogger(MyMessageParser, MyLogger, MyMySqlManager);

                AdvancedCommunication.ActorHandler MyActorHandler = new AdvancedCommunication.ActorHandler(MyTCPWrapper, MyLogger, MyMySqlManager);

                AdvancedCommunication.PMHandler MyPMHandler = new AdvancedCommunication.PMHandler(MyTCPWrapper, MyMessageParser, MyMySqlManager);
                AdvancedCommunication.HelpCommandHandler MyHelpCommandHandler = new AdvancedCommunication.HelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager);
                AdvancedCommunication.AdvHelpCommandHandler MyAdvHelpCommandHandler = new AdvancedCommunication.AdvHelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager, MyHelpCommandHandler);
                AdvancedCommunication.AdminHelpCommandHandler MyAdminHelpCommandHandler = new AdvancedCommunication.AdminHelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager, MyAdvHelpCommandHandler);
                AdvancedCommunication.SAYCommandHandler MySAYCommandHandler = new AdvancedCommunication.SAYCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyPMHandler);
                AdvancedCommunication.PMCommandHandler MyPMCommandHandler = new AdvancedCommunication.PMCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager);

                AdvancedCommunication.BuddyHandler MyBuddyHandler = new AdvancedCommunication.BuddyHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogin);

                //get my stats
                Stats MyStats = new Stats(MyTCPWrapper, MyLogger, MyMySqlManager);

                TradeHandler MyTradeHandler = new TradeHandler(MyTCPWrapper, MyMessageParser, MyMySqlManager, MyInventory, MyActorHandler, MyLogger, MyStorage, MyErrorHandler, MyHelpCommandHandler);

                AdvancedCommunication.INVCommandHandler MyINVCommandHandler = new AdvancedCommunication.INVCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.INVRCommandHandler MyINVRCommandHandler = new AdvancedCommunication.INVRCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.STOCommandHandler MySTOCommandHandler = new AdvancedCommunication.STOCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyStorage, MyTradeHandler, MyStats);
                AdvancedCommunication.INVLISTCommandHandler MyINVLISTCommandHandler = new AdvancedCommunication.INVLISTCommandHandler(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.ReserveCommandHandler MyReserveCommandHandler = new AdvancedCommunication.ReserveCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyStorage);

                AdvancedCommunication.GiveCommandHandler MyGiveCommandHandler = new AdvancedCommunication.GiveCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);
                AdvancedCommunication.GiveToCommandHandler MyGiveToCommandHandler = new AdvancedCommunication.GiveToCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);
                AdvancedCommunication.BUYCommandHandler MyBUYCommandHandler = new AdvancedCommunication.BUYCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.DESCRIBECommandHandler MyDESCRIBECommandHandler = new AdvancedCommunication.DESCRIBECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);

                AdvancedCommunication.DONATECommandHandler MyDONATECommandHandler = new AdvancedCommunication.DONATECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.PUTONSALECommandHandler MyPUTONSALECommandHandler = new AdvancedCommunication.PUTONSALECommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.WANTEDCommandHandler MyWANTEDCommandHandler = new AdvancedCommunication.WANTEDCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyStats);
                AdvancedCommunication.LOCCommandHandler MyLOCCommandHandler = new AdvancedCommunication.LOCCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.BANCommandHandler MyBANCommandHandler = new AdvancedCommunication.BANCommandHandler(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.DropCommandHandler MyDropCommandHandler = new AdvancedCommunication.DropCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.LaunchCommandHandler MyLaunchCommandHandler = new AdvancedCommunication.LaunchCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.QuitCommandHandler MyQuitCommandHandler = new AdvancedCommunication.QuitCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.WearCommandHandler MyWearCommandHandler = new AdvancedCommunication.WearCommandHandler(MyActorHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.UseItemCommandHandler MyUseItemCommandHandler = new AdvancedCommunication.UseItemCommandHandler(MyActorHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);

                AdvancedCommunication.ABOUTCommandHandler MyABOUTCommandHandler = new AdvancedCommunication.ABOUTCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.AFKCommandHandler MyAFKCommandHandler = new AdvancedCommunication.AFKCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.ELTCCommandHandler MyELTCCommandHandler = new AdvancedCommunication.ELTCCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);

                AdvancedCommunication.ACCEPTMECommandHandler MyACCEPTMECommandHandler = new AdvancedCommunication.ACCEPTMECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.KICKMECommandHandler MyKICKMECommandHandler = new AdvancedCommunication.KICKMECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.GTCommandHandler MyGTCommandHandler = new AdvancedCommunication.GTCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.GuildTextHandler MyGuildTextHandler = new AdvancedCommunication.GuildTextHandler(MyRawText, MyTCPWrapper, MyMessageParser, MyMySqlManager, MyLogger);

                AdvancedCommunication.GreetPlayers MyGreetPlayers = new AdvancedCommunication.GreetPlayers(MyTCPWrapper, MyMySqlManager, MyActorHandler);
                AdvancedCommunication.AdvertHandler MyAdvertHandler = new AdvancedCommunication.AdvertHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyErrorHandler);
                AdvancedCommunication.HouseKeepingHandler MyHouseKeepingHandler = new AdvancedCommunication.HouseKeepingHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyErrorHandler);
                AdvancedCommunication.AltAdvertHandler MyAltAdvertHandler = new AdvancedCommunication.AltAdvertHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyErrorHandler);
                //AdvancedCommunication.RulesHandler MyRulesHandler = new AdvancedCommunication.RulesHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.MOVECommandHandler MyMOVECommandHandler = new AdvancedCommunication.MOVECommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);
                AdvancedCommunication.SitStandCommandHandler MySitStandCommandHandler = new AdvancedCommunication.SitStandCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);
                AdvancedCommunication.RetradeCommandHandler MyRetradeCommandHandler = new AdvancedCommunication.RetradeCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyActorHandler, MyTradeHandler);
                AdvancedCommunication.TextCommandsHandler MyTextCommandsHandler = new AdvancedCommunication.TextCommandsHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.WhoIsTradingCommandHandler MyWhoIsTradingHandler = new cs_elbot.AdvancedCommunication.WhoIsTradingCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.CancelTradeCommandHandler MyCancelTradeHandler = new cs_elbot.AdvancedCommunication.CancelTradeCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);

                //goto command handler
                AdvancedCommunication.GotoCommandHandler MyGotoCommandHandler = new cs_elbot.AdvancedCommunication.GotoCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler, MyActorHandler);

                //use object command handler
                AdvancedCommunication.UseObject MyUseObjectCommandHandler = new cs_elbot.AdvancedCommunication.UseObject(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);

                //openstorage
                AdvancedCommunication.OpenStorage MyOpenStorageCommandHandler = new cs_elbot.AdvancedCommunication.OpenStorage(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyMySqlManager, MyActorHandler, MyAdminHelpCommandHandler);
                //withdraw
                AdvancedCommunication.WithdrawCommandHandler MyWithdrawCommandHandler = new cs_elbot.AdvancedCommunication.WithdrawCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyStorage, MyTradeHandler, MyStats, MyInventory);
                AdvancedCommunication.DepositCommandHandler MyDepositCommandHandler = new cs_elbot.AdvancedCommunication.DepositCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyStorage);

                //gamble
                AdvancedCommunication.GAMBLECommandHandler MyGAMBLECommandHandler = new AdvancedCommunication.GAMBLECommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.PRIZECommandHandler MyPRIZECommandHandler = new AdvancedCommunication.PRIZECommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyLogger, MyActorHandler);

                //isonline command
                AdvancedCommunication.ISOnlineCommandHandler MyISOnlineCommandHandler = new AdvancedCommunication.ISOnlineCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);

                //Guard bot code below
                if (botType == 3)
                {
                    AdvancedCommunication.AssessThreat MyAssessThreat = new AdvancedCommunication.AssessThreat(MyTCPWrapper, MyMySqlManager, MyActorHandler);
                }

                Perks MyPerks = new Perks(MyTCPWrapper, MyLogger, MyMySqlManager);
                CLI MyCLI = new CLI(MyTCPWrapper, MyMessageParser);

                MyCLI.DoLoop();
            }
            catch (System.Net.Sockets.SocketException se)
            {
                Console.WriteLine("Error in main loop: " + se.Message);
                if (se.ErrorCode == 11001) // Host name not found
                {
                    Console.WriteLine("When this error occurs, check that you are connected to the internet and a firewall is not blocking this program.");
                }
            }
            catch (Exception except)
            {
                MyErrorHandler.writeErrorMessage("Exception in main loop: " + except);
            }
            finally
            {
                Console.ReadLine();
            }
        }
示例#22
0
文件: Main.cs 项目: waebbl/CS-ELBot
        //public static myCoords myCurrentCoords = new myCoords();

        //public struct myCoords
        //{
        //    public int x;
        //    public int y;
        //}
        public static void Main(string[] args)
        {
            myHome.x       = 0;
            myHome.y       = 0;
            myHome.heading = 0;
            myHome.mapName = "";
            // Create instance of the log file handler
            Logger MyLogger = new Logger();

            // Create instance of the TCP client
            TCPClient.TCPClient MyTCPClient = new TCPClient.TCPClient();

            // Initialize the TCPWrapper
            TCPWrapper MyTCPWrapper = new TCPWrapper(MyTCPClient, MyLogger);

            // set up working directory
            if (args.Length > 0)
            {
                string botName = args[0];
                launchPath  = args[1];
                SqlServer   = args[2];
                SqlPort     = Convert.ToInt16(args[3]);
                SqlUsername = args[4];
                SqlPassword = args[5];
                SqlDatabase = args[6];
                Environment.CurrentDirectory = launchPath + botName;
            }
            if (Environment.CurrentDirectory.ToLower().Contains("Live".ToLower()))
            {
                serverName = "live";
            }
            else if (Environment.CurrentDirectory.ToLower().Contains("Test".ToLower()))
            {
                serverName = "test";
            }
            else if (Environment.CurrentDirectory.ToLower().Contains("PK".ToLower()))
            {
                serverName = "pk";
            }
            else
            {
                launchedByBotManager = false;
                launchPath           = "C:\\bot\\test\\";
                Console.WriteLine("serverName not found in file path, defaulting to test");
                Console.WriteLine("path containing cs-elbot.exe should be something like c:/bot/test/botname/");
                Console.WriteLine("If you're not using bot manager, don't worry about this message");
            }

            Settings MySettings = new Settings();

            //Load Sql Configuration if not supplied in parameters
            if (SqlServer == "")
            {
                MySettings.LoadSqlSettingsFromConfigfile();
            }

            MySettings.LoadSettings();
            errorHandler MyErrorHandler = new errorHandler();

            //Setup the MySQL Database
            MySqlManager MyMySqlManager = new MySqlManager(SqlServer, SqlUsername, SqlPassword, SqlDatabase, SqlPort, MyLogger, MyTCPWrapper, MyErrorHandler);

            Settings.TradeTimeOut = MyMySqlManager.GetTimeoutInterval(Settings.botid);
            botType = MyMySqlManager.getBotType(Settings.botid);
            //Console.WriteLine("Bot type: " + botType);

            MyMySqlManager.ImStarted(Settings.botid);
            Settings.URL = MyMySqlManager.getURL() + Settings.Loginname + ".php";


            try
            {
                System.Net.IPHostEntry ServerIPHostEntry = System.Net.Dns.GetHostEntry(Settings.ServerHostname);
                MyTCPWrapper.HostIp = ServerIPHostEntry.AddressList[0];
                MyTCPWrapper.Port   = Settings.ServerPort;

                Logging.CommandLogger MyCommandDebugger = new Logging.CommandLogger(MyTCPWrapper, MyLogger);

                //BasicCommunication.HeartBeat MyHeartBeat = new BasicCommunication.HeartBeat(MyTCPWrapper, MyErrorHandler);
                BasicCommunication.HeartBeat MyHeartBeat = new BasicCommunication.HeartBeat(MyTCPWrapper);
                BasicCommunication.Ping      MyPing      = new BasicCommunication.Ping(MyTCPWrapper);
                Inventory MyInventory = new Inventory(MyTCPWrapper, MyLogger, MyMySqlManager);
                Storage   MyStorage   = new Storage(MyTCPWrapper, MyLogger, MyMySqlManager);
                BasicCommunication.new_minute MyMewMinute = new BasicCommunication.new_minute(MyTCPWrapper, MyMySqlManager, MyInventory);

                // Login here
                BasicCommunication.Login         MyLogin         = new BasicCommunication.Login(MyTCPWrapper);
                BasicCommunication.RawText       MyRawText       = new BasicCommunication.RawText(MyTCPWrapper);
                BasicCommunication.MessageParser MyMessageParser = new BasicCommunication.MessageParser(MyRawText, MyLogger, MyTCPWrapper, MyMySqlManager);
                BasicCommunication.changeMap     MyChangeMap     = new BasicCommunication.changeMap(MyTCPWrapper);

                //if this is a storage bot (not a tradebot) start a shutdown timer
                if (Settings.IsTradeBot == false && botType == 2)
                {
                    BasicCommunication.Shutdown MyShutdown = new BasicCommunication.Shutdown(MyTCPWrapper, MyMessageParser, MyMySqlManager, MyErrorHandler);
                }

                Logging.LoginLogger   MyLoginLogger   = new Logging.LoginLogger(MyLogin, MyLogger, MyTCPWrapper, MyMySqlManager);
                Logging.MessageLogger MyMessageLogger = new Logging.MessageLogger(MyMessageParser, MyLogger, MyMySqlManager);

                AdvancedCommunication.ActorHandler MyActorHandler = new AdvancedCommunication.ActorHandler(MyTCPWrapper, MyLogger, MyMySqlManager);

                AdvancedCommunication.PMHandler               MyPMHandler               = new AdvancedCommunication.PMHandler(MyTCPWrapper, MyMessageParser, MyMySqlManager);
                AdvancedCommunication.HelpCommandHandler      MyHelpCommandHandler      = new AdvancedCommunication.HelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager);
                AdvancedCommunication.AdvHelpCommandHandler   MyAdvHelpCommandHandler   = new AdvancedCommunication.AdvHelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager, MyHelpCommandHandler);
                AdvancedCommunication.AdminHelpCommandHandler MyAdminHelpCommandHandler = new AdvancedCommunication.AdminHelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager, MyAdvHelpCommandHandler);
                AdvancedCommunication.SAYCommandHandler       MySAYCommandHandler       = new AdvancedCommunication.SAYCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyPMHandler);
                AdvancedCommunication.PMCommandHandler        MyPMCommandHandler        = new AdvancedCommunication.PMCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager);

                AdvancedCommunication.BuddyHandler MyBuddyHandler = new AdvancedCommunication.BuddyHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogin);

                //get my stats
                Stats MyStats = new Stats(MyTCPWrapper, MyLogger, MyMySqlManager);


                TradeHandler MyTradeHandler = new TradeHandler(MyTCPWrapper, MyMessageParser, MyMySqlManager, MyInventory, MyActorHandler, MyLogger, MyStorage, MyErrorHandler, MyHelpCommandHandler);

                AdvancedCommunication.INVCommandHandler     MyINVCommandHandler     = new AdvancedCommunication.INVCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.INVRCommandHandler    MyINVRCommandHandler    = new AdvancedCommunication.INVRCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.STOCommandHandler     MySTOCommandHandler     = new AdvancedCommunication.STOCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyStorage, MyTradeHandler, MyStats);
                AdvancedCommunication.INVLISTCommandHandler MyINVLISTCommandHandler = new AdvancedCommunication.INVLISTCommandHandler(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.ReserveCommandHandler MyReserveCommandHandler = new AdvancedCommunication.ReserveCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyStorage);

                AdvancedCommunication.GiveCommandHandler     MyGiveCommandHandler     = new AdvancedCommunication.GiveCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);
                AdvancedCommunication.GiveToCommandHandler   MyGiveToCommandHandler   = new AdvancedCommunication.GiveToCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);
                AdvancedCommunication.BUYCommandHandler      MyBUYCommandHandler      = new AdvancedCommunication.BUYCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.DESCRIBECommandHandler MyDESCRIBECommandHandler = new AdvancedCommunication.DESCRIBECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);

                AdvancedCommunication.DONATECommandHandler    MyDONATECommandHandler    = new AdvancedCommunication.DONATECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.PUTONSALECommandHandler MyPUTONSALECommandHandler = new AdvancedCommunication.PUTONSALECommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.WANTEDCommandHandler    MyWANTEDCommandHandler    = new AdvancedCommunication.WANTEDCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyStats);
                AdvancedCommunication.LOCCommandHandler       MyLOCCommandHandler       = new AdvancedCommunication.LOCCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.BANCommandHandler       MyBANCommandHandler       = new AdvancedCommunication.BANCommandHandler(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.DropCommandHandler      MyDropCommandHandler      = new AdvancedCommunication.DropCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.LaunchCommandHandler    MyLaunchCommandHandler    = new AdvancedCommunication.LaunchCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.QuitCommandHandler      MyQuitCommandHandler      = new AdvancedCommunication.QuitCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.WearCommandHandler      MyWearCommandHandler      = new AdvancedCommunication.WearCommandHandler(MyActorHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.UseItemCommandHandler   MyUseItemCommandHandler   = new AdvancedCommunication.UseItemCommandHandler(MyActorHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);

                AdvancedCommunication.ABOUTCommandHandler MyABOUTCommandHandler = new AdvancedCommunication.ABOUTCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.AFKCommandHandler   MyAFKCommandHandler   = new AdvancedCommunication.AFKCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.ELTCCommandHandler  MyELTCCommandHandler  = new AdvancedCommunication.ELTCCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);

                AdvancedCommunication.ACCEPTMECommandHandler MyACCEPTMECommandHandler = new AdvancedCommunication.ACCEPTMECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.KICKMECommandHandler   MyKICKMECommandHandler   = new AdvancedCommunication.KICKMECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.GTCommandHandler       MyGTCommandHandler       = new AdvancedCommunication.GTCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.GuildTextHandler       MyGuildTextHandler       = new AdvancedCommunication.GuildTextHandler(MyRawText, MyTCPWrapper, MyMessageParser, MyMySqlManager, MyLogger);

                AdvancedCommunication.GreetPlayers        MyGreetPlayers        = new AdvancedCommunication.GreetPlayers(MyTCPWrapper, MyMySqlManager, MyActorHandler);
                AdvancedCommunication.AdvertHandler       MyAdvertHandler       = new AdvancedCommunication.AdvertHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyErrorHandler);
                AdvancedCommunication.HouseKeepingHandler MyHouseKeepingHandler = new AdvancedCommunication.HouseKeepingHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyErrorHandler);
                AdvancedCommunication.AltAdvertHandler    MyAltAdvertHandler    = new AdvancedCommunication.AltAdvertHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyErrorHandler);
                //AdvancedCommunication.RulesHandler MyRulesHandler = new AdvancedCommunication.RulesHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.MOVECommandHandler         MyMOVECommandHandler     = new AdvancedCommunication.MOVECommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);
                AdvancedCommunication.SitStandCommandHandler     MySitStandCommandHandler = new AdvancedCommunication.SitStandCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);
                AdvancedCommunication.RetradeCommandHandler      MyRetradeCommandHandler  = new AdvancedCommunication.RetradeCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyActorHandler, MyTradeHandler);
                AdvancedCommunication.TextCommandsHandler        MyTextCommandsHandler    = new AdvancedCommunication.TextCommandsHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.WhoIsTradingCommandHandler MyWhoIsTradingHandler    = new cs_elbot.AdvancedCommunication.WhoIsTradingCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.CancelTradeCommandHandler  MyCancelTradeHandler     = new cs_elbot.AdvancedCommunication.CancelTradeCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);

                //goto command handler
                AdvancedCommunication.GotoCommandHandler MyGotoCommandHandler = new cs_elbot.AdvancedCommunication.GotoCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler, MyActorHandler);

                //use object command handler
                AdvancedCommunication.UseObject MyUseObjectCommandHandler = new cs_elbot.AdvancedCommunication.UseObject(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);

                //openstorage
                AdvancedCommunication.OpenStorage MyOpenStorageCommandHandler = new cs_elbot.AdvancedCommunication.OpenStorage(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyMySqlManager, MyActorHandler, MyAdminHelpCommandHandler);
                //withdraw
                AdvancedCommunication.WithdrawCommandHandler MyWithdrawCommandHandler = new cs_elbot.AdvancedCommunication.WithdrawCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyStorage, MyTradeHandler, MyStats, MyInventory);
                AdvancedCommunication.DepositCommandHandler  MyDepositCommandHandler  = new cs_elbot.AdvancedCommunication.DepositCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyStorage);

                //gamble
                AdvancedCommunication.GAMBLECommandHandler MyGAMBLECommandHandler = new AdvancedCommunication.GAMBLECommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.PRIZECommandHandler  MyPRIZECommandHandler  = new AdvancedCommunication.PRIZECommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyLogger, MyActorHandler);

                //isonline command
                AdvancedCommunication.ISOnlineCommandHandler MyISOnlineCommandHandler = new AdvancedCommunication.ISOnlineCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);


                //Guard bot code below
                if (botType == 3)
                {
                    AdvancedCommunication.AssessThreat MyAssessThreat = new AdvancedCommunication.AssessThreat(MyTCPWrapper, MyMySqlManager, MyActorHandler);
                }

                Perks MyPerks = new Perks(MyTCPWrapper, MyLogger, MyMySqlManager);
                CLI   MyCLI   = new CLI(MyTCPWrapper, MyMessageParser);

                MyCLI.DoLoop();
            }
            catch (System.Net.Sockets.SocketException se)
            {
                Console.WriteLine("Error in main loop: " + se.Message);
                if (se.ErrorCode == 11001) // Host name not found
                {
                    Console.WriteLine("When this error occurs, check that you are connected to the internet and a firewall is not blocking this program.");
                }
            }
            catch (Exception except)
            {
                MyErrorHandler.writeErrorMessage("Exception in main loop: " + except);
            }
            finally
            {
                Console.ReadLine();
            }
        }