public void Work()
        {
            List <string> cards = new List <string>();

            foreach (string s in ReadMemory())
            {
                int    start = s.IndexOf("cardId=") + 7;
                string image = s.Substring(start, s.IndexOf(' ', start) - start);

                //System.Windows.Forms.MessageBox.Show(s);
                Card c = dc.FindCardByImage(image);
                if (c != null)
                {
                    int id = Convert.ToInt32(s.Substring(4, s.IndexOf(' ') - 4));
                    if (!CardIdsAlreadyParsed.Contains(id))
                    {
                        CardControl cc = dc.FindCardInDeck(c.Name);
                        if (cc != null)
                        {
                            if (cc.Card.Count > 0)
                            {
                                cc.Card.Count--;
                            }
                            if (cc.Card.Count == 0 && dc.Options.GetAsBool("CardAutoSort"))
                            {
                                dc.Sort();
                            }
                        }
                        CardIdsAlreadyParsed.Add(id);
                    }
                }
            }
            dc.Refresh();
            dc.RefreshAllCards();
        }
Beispiel #2
0
        private void DoClick(System.Windows.Forms.MouseButtons button)
        {
            if (dc.Options.GetAsBool("SwapMouse"))
            {
                if (button == System.Windows.Forms.MouseButtons.Left)
                {
                    button = System.Windows.Forms.MouseButtons.Right;
                }
                else
                {
                    button = System.Windows.Forms.MouseButtons.Left;
                }
            }

            if (button == System.Windows.Forms.MouseButtons.Right)
            {
                if (Card.Count > 0)
                {
                    Card.Count--;
                }
                if (Card.Count == 0 && dc.Options.GetAsBool("CardAutoSort"))
                {
                    dc.Sort();
                }
            }
            if (button == System.Windows.Forms.MouseButtons.Left)
            {
                if (dc.CardCount() >= 30)
                {
                    return;
                }
                if (Card.Count < 9)
                {
                    Card.Count++;
                }
            }
        }
Beispiel #3
0
 private void checkBoxSort_CheckedChanged(object sender, EventArgs e)
 {
     dc.Options.Set("CardAutoSort", checkBoxCardAutoSort.Checked.ToString());
     dc.Sort();
 }