Exemplo n.º 1
0
 public CharacterSelectionForm(string result)
 {
     InitializeComponent();
     ResultString = result;
     ParseSite();
     MQOEvents.TestEvent("Select a Character");
 }
Exemplo n.º 2
0
 private void UpdateChat()
 {
     if (isConnected)
     {
         MQOEvents.RequestChatUpdate(true);
     }
 }
Exemplo n.º 3
0
        private void btnSendChat_Click(object sender, EventArgs e)
        {
            string tempString = txtChatToSend.Text;

            MQOEvents.SendMessage(tempString);
            txtChatToSend.Text = "";
        }
Exemplo n.º 4
0
 private void UpdateStats()
 {
     if (isConnected)
     {
         MQOEvents.RequestStatUpdate(true);
     }
 }
Exemplo n.º 5
0
 void MQOEvents_onStatReady(object obj)
 {
     CharacterShort = (string)obj;
     if (StatsActive && isConnected)
     {
         string parsedStats = "";
         parsedStats += ParseStats("PlayerName") + ",";
         parsedStats += ParseStats("PlayerHP") + ",";
         parsedStats += ParseStats("PlayerMana") + ",";
         parsedStats += ParseStats("PlayerLevel") + ",";
         parsedStats += ParseStats("Gold") + ",";
         parsedStats += ParseStats("Elements") + ",";
         parsedStats += ParseStats("Chests") + ",";
         parsedStats += ParseStats("Relics") + ",";
         parsedStats += ParseStats("StatPoints") + ",";
         parsedStats += ParseStats("Workload") + ",";
         parsedStats += ParseStats("PlayerLevelPercent") + ",";
         parsedStats += ParseStats("Skill1Percent") + ",";
         parsedStats += ParseStats("Skill1") + ",";
         parsedStats += ParseStats("Skill2Percent") + ",";
         parsedStats += ParseStats("Skill2");
         MQOEvents.StatUpdate(parsedStats);
     }
     //}
 }
Exemplo n.º 6
0
        void MQOEvents_onRequestLogin(object obj)
        {
            MQOEvents.TestEvent("Loggin requested");
            if (!LoginWebClient.IsBusy)
            {
                string[] parsed = obj.ToString().Split(',');

                var values = new NameValueCollection
                {
                    { "User", parsed[0] },
                    { "Pass", parsed[1] },
                };

                // Upload values
                string tempStringUri = "http://midenquest.com/UserLogin.aspx";
                LoginWebClient.UploadValues(tempStringUri, values);

                // Get Character Page
                string charPage = LoginWebClient.DownloadString("http://midenquest.com/UserCharacterSelection.aspx");

                SetCookies();

                MQOEvents.OpenCharacterSelection(charPage);
            }
            else
            {
                MQOEvents.TestEvent("Busy");
            }
        }
Exemplo n.º 7
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            string user = txtUser.Text;
            string pass = txtPass.Text;

            string connection = user + "," + pass;

            MQOEvents.RequestLogin(connection);
        }
Exemplo n.º 8
0
 void MQOEvents_onLoadFight(object obj)
 {
     if (!FightWebClient.IsBusy)
     {
         Uri tempUri = new Uri("http://midenquest.com/loadFight.aspx?id=" + obj.ToString() + "&sid=" + GetSID().ToString());
         FightWebClient.DownloadString(tempUri);
         MQOEvents.TestEvent("Loading Monster ID: " + obj.ToString());
     }
 }
Exemplo n.º 9
0
 void MQOEvents_onDoWork(object obj)
 {
     if (!SkillWebClient.IsBusy)
     {
         MQOEvents.TestEvent("Doing work");
         Uri tempUri = new Uri("http://midenquest.com/useWork.aspx?start=" + obj.ToString() + "&null=");
         SkillWebClient.DownloadString(tempUri);
     }
 }
Exemplo n.º 10
0
 public void Fight()
 {
     if (GetEnemyCount() == 0)
     {
         MQOEvents.LoadFight(MobToFight);
     }
     else
     {
         Attack();
     }
 }
Exemplo n.º 11
0
        void MQOEvents_onChatReady(object obj)
        {
            if (Chat != (string)obj.ToString())
            {
                string Uncleaned = (string)obj.ToString();
                string Cleaned   = Regex.Replace(Uncleaned, @"<[^>]*>", String.Empty);
                Cleaned = Regex.Replace(Cleaned, @"[[^>[]", "\r\n[");

                Chat = Cleaned;
                MQOEvents.ChatUpdate(Chat);
            }
        }
Exemplo n.º 12
0
        private void Attack()
        {
            int derp  = Int32.Parse(ParseStats("Enemy1HP").ToString());
            int derp2 = Int32.Parse(ParseStats("Enemy2HP").ToString());

            if (Int32.Parse(ParseStats("Enemy1HP").ToString()) > 0)
            {
                MQOEvents.Attack(0);
            }
            else
            {
                MQOEvents.Attack(1);
            }
        }
Exemplo n.º 13
0
        void MQOEvents_onRequestCharacterLogin(object obj)
        {
            if (!LoginWebClient.IsBusy)
            {
                MQOEvents.TestEvent("Attempting to login...");
                var values = new NameValueCollection
                {
                    { "CharId", (string)obj.ToString() },
                };

                // Upload the values
                string tempUri = "http://midenquest.com/Game.aspx";
                LoginWebClient.UploadValues(tempUri, values);

                MQOEvents.Connected(true);
            }
            else
            {
                MQOEvents.TestEvent("Login Client is busy");
            }
        }
Exemplo n.º 14
0
 private void btnStartSkill_Click(object sender, EventArgs e)
 {
     MQOEvents.StartWork(SkillToDo);
 }
Exemplo n.º 15
0
        public object ParseStats(string str)
        {
            if (isConnected)
            {
                string   unparsed = CharacterShort;
                string[] parsed   = unparsed.Split('|');

                if (parsed.Length > 5)
                {
                    StatsActive = true;
                    if (parsed[0] != "1")
                    {
                        isConnected = false;
                    }

                    if (str == "PlayerName")
                    {
                        return(parsed[4]);
                    }
                    else if (str == "PlayerHP")
                    {
                        return(parsed[12]);
                    }
                    else if (str == "PlayerMana")
                    {
                        return(parsed[20]);
                    }
                    else if (str == "PlayerLevel")
                    {
                        return(parsed[8]);
                    }
                    else if (str == "PlayerLevelPercent")
                    {
                        return(parsed[79]);
                    }
                    else if (str == "Gold")
                    {
                        return(parsed[82]);
                    }
                    else if (str == "Elements")
                    {
                        return(parsed[89]);
                    }
                    else if (str == "Chests")
                    {
                        int  number;
                        bool result = Int32.TryParse(parsed[116].ToString(), out number);
                        if (result)
                        {
                            return(number);
                        }
                        else
                        {
                            return(0);
                        }
                    }
                    else if (str == "Relics")
                    {
                        return(parsed[117]);
                    }
                    else if (str == "Chests")
                    {
                        return(parsed[116]);
                    }
                    else if (str == "StatPoints")
                    {
                        return(parsed[88]);
                    }
                    else if (str == "Workload")
                    {
                        if (parsed[115] == "")
                        {
                            return(0);
                        }
                        else
                        {
                            return(parsed[115]);
                        }
                    }
                    else if (str == "Enemy1HP")
                    {
                        if (parsed[18] != "")
                        {
                            return(parsed[18]);
                        }
                        return(0);
                    }
                    else if (str == "Enemy2HP")
                    {
                        if (parsed[19] != "")
                        {
                            return(parsed[19]);
                        }
                        return(0);
                    }
                    else if (str == "Enemy1")
                    {
                        if (parsed[2] != "")
                        {
                            return(parsed[2]);
                        }
                        else
                        {
                            return(0);
                        }
                    }
                    else if (str == "Enemy2")
                    {
                        if (parsed[3] != "")
                        {
                            return(parsed[3]);
                        }
                        else
                        {
                            return(0);
                        }
                    }
                    else if (str == "State")
                    {
                        if (parsed[114] == "Working")
                        {
                            return("Working");
                        }
                        else
                        {
                            return("Idle");
                        }
                    }
                    else if (str == "Skill1Percent")
                    {
                        return(parsed[80]);
                    }
                    else if (str == "Skill1")
                    {
                        return(parsed[90]);
                    }
                    else if (str == "Skill2Percent")
                    {
                        return(parsed[81]);
                    }
                    else if (str == "Skill2")
                    {
                        return(parsed[91]);
                    }
                    else
                    {
                        MQOEvents.TestEvent("(Parse Stat)Command not found: " + str);
                        return(0);
                    }
                }
                else
                {
                    StatsActive = false;
                    return(0);
                }
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 16
0
 void MainWebClient_DownloadStringCompleted(object sender, System.Net.DownloadStringCompletedEventArgs e)
 {
     MQOEvents.MainReady(true);
 }
Exemplo n.º 17
0
 void ChatWebClient_DownloadStringCompleted(object sender, System.Net.DownloadStringCompletedEventArgs e)
 {
     MQOEvents.ChatReady(e.Result);
 }
Exemplo n.º 18
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            MQOEvents.Disconnected(true);

            Log("Disconnected");
        }
Exemplo n.º 19
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     MQOEvents.OpenLogin(true);
 }
Exemplo n.º 20
0
 private void btnStopFight_Click(object sender, EventArgs e)
 {
     MQOEvents.StopFight(true);
 }
Exemplo n.º 21
0
 private void btnStartFight_Click(object sender, EventArgs e)
 {
     MQOEvents.Fight(MobToFight);
 }
Exemplo n.º 22
0
 private void DoWork()
 {
     MQOEvents.DoWork(SkillToDo);
 }
Exemplo n.º 23
0
 private void OpenChests()
 {
     MQOEvents.OpenChest(true);
 }
Exemplo n.º 24
0
 private void StopWork()
 {
     MQOEvents.StopWork(true);
 }
Exemplo n.º 25
0
 public LoginForm()
 {
     InitializeComponent();
     MQOEvents.TestEvent("Logging in");
 }
Exemplo n.º 26
0
 private void btnPlay3_Click(object sender, EventArgs e)
 {
     MQOEvents.TestEvent("Logging into: " + lblPlayerName3.Text);
     MQOEvents.RequestCharacterLogin(PlayerIDs[2]);
 }
Exemplo n.º 27
0
 void MQOEvents_onConnected(object obj)
 {
     MQOEvents.TestEvent("Connected");
     isConnected = true;
 }
Exemplo n.º 28
0
 private void btnStopSkill_Click(object sender, EventArgs e)
 {
     MQOEvents.StopWork(true);
 }