コード例 #1
0
ファイル: Actions.cs プロジェクト: Smallinger/FreewarBot
        public void PutMoneyToGround(int money)
        {
            if (getStats.Geld() >= money)
            {
                WebClient wc = new WebClient();
                wc.Headers.Add(HttpRequestHeader.Cookie, Settings.Cookie);
                string s = wc.DownloadString("http://" + Settings._World + ".freewar.de/freewar/internal/item.php?action=moneydrop1");
                s = s.Remove(0, s.IndexOf("2&checkid") + 10);
                s = s.Substring(0, s.IndexOf("\""));

                var    encoding  = new ASCIIEncoding();
                var    postData  = "moneytodrop=" + money.ToString();
                byte[] data      = encoding.GetBytes(postData);
                var    myRequest =
                    (HttpWebRequest)WebRequest.Create("http://" + Settings._World + ".freewar.de/freewar/internal/item.php?action=moneydrop2&checkid=" + s);
                myRequest.Method          = "POST";
                myRequest.ContentType     = "application/x-www-form-urlencoded";
                myRequest.ContentLength   = data.Length;
                myRequest.CookieContainer = new CookieContainer();
                myRequest.CookieContainer.SetCookies(new Uri("http://" + Settings._World + ".freewar.de/freewar/internal/item.php?action=moneydrop2&checkid=" + s), Settings.Cookie);
                myRequest.Referer = "http://" + Settings._World + ".freewar.de/freewar/internal/item.php?action=moneydrop1";
                var newStream = myRequest.GetRequestStream();
                newStream.Write(data, 0, data.Length);
                newStream.Close();
                var response       = myRequest.GetResponse();
                var responseStream = response.GetResponseStream();
                var responseReader = new StreamReader(responseStream);
                responseReader.ReadToEnd();
                _wB.Document.Window.Frames[6].Navigate("http://" + Settings._World + ".freewar.de/freewar/internal/item.php");
            }
        }
コード例 #2
0
ファイル: frmBot.cs プロジェクト: Smallinger/FreewarBot
 private bool SomethingToDo()
 {
     if ((getStats.px() == 92 && getStats.py() == 105) && (manager.SomethingToBankEinlagern()))
     {
         return(true);
     }
     else if (getStats.px() == 92 && getStats.py() == 105 && getStats.Geld() > Settings.MaxMoney)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #3
0
ファイル: Manager.cs プロジェクト: Smallinger/FreewarBot
        public void CheckStats()
        {
            try
            {
                Settings.LoggedIn = true;
                LoadCookie();
                if (_wB.Document.Window.Frames[7].Document.Body.OuterText.Contains("Position X: Y: "))
                {
                    _wB.Navigate("http://" + Settings._World + ".freewar.de/freewar/");
                    Paths._Actual = new List <string>();
                }
                actions.Drink(Settings._minLP);
                actions.DrinkBeer(Settings._minLP);
                getStats.Erfahrung();
                getStats.MaxLP();
                OpenInv();
                LoadInventar();
                //  Sell();
                CheckWaffeAnoderAblegen();
                OpenBankEinzahlung();
                useHealItems();
                UseProtection();
                GetAuftrag();
                MakeAuftrag();
                if (Settings._playerkiller)
                {
                    actions.AttackPlayer();
                }
                if (Settings._attack)
                {
                    actions.Attack();
                }
                if (Settings.NPCVerjagen)
                {
                    actions.Verjagen();
                }
                if (Settings._take)
                {
                    actions.Take();
                }
                if (Settings.Harvest)
                {
                    actions.Harvest();
                }
                if ((_wB.Document.Window.Frames[1].Document.Body.OuterHtml.Contains("Wieviel Gold willst du für das Item")) & Settings._sell)
                {
                    Sell();
                }
                else if (Settings._sell && !(getStats.px() == 96 & getStats.py() == 101) && (_wB.Document.Window.Frames[1].Document.Body.OuterHtml.Contains("main.php?arrive_eval=verkaufen") | _wB.Document.Window.Frames[1].Document.Body.OuterHtml.Contains("Welches deiner Items möchtest du verkaufen?")))
                {
                    Sell();
                }
                if ((getStats.px() == 96 & getStats.py() == 101) && (_wB.Document.Window.Frames[1].Document.Body.OuterHtml.Contains("Item in der Markthalle kaufen")) && Settings._maha)
                {
                    SellMaha();
                }
                OpenBankLagerung();
                if (_wB.Document.Window.Frames[1].Document.Body.OuterHtml.Contains("Goldmünzen auf dein Konto eingezahlt."))
                {
                    _wB.Document.Window.Frames[1].Navigate("http://" + Settings._World + ".freewar.de/freewar/internal/main.php");
                }
                if (WayBankinProgress == false && WayHealinProgress == false && SomethingToBank())
                {
                    Paths._Actual     = pathFinder.Directions(new Point(getStats.px(), getStats.py()), new Point(92, 105));
                    WayBankinProgress = true;
                }
                {
                    WayBankinProgress = false;
                }
                if (getStats.CurrentLP() <= Settings._minLP && WayHealinProgress == false && WayBankinProgress == false)
                {
                    if (getStats.CurrentLP() <= Settings._minLP & getStats.Geld() >= 30)
                    {
                        Paths._Actual = pathFinder.ShortestWayToHeal(new Point(getStats.px(), getStats.py()));
                    }
                    else if (getStats.CurrentLP() <= Settings._minLP & getStats.Geld() < 30)
                    {
                        Paths._Actual = pathFinder.Directions(new Point(getStats.px(), getStats.py()), new Point(93, 101));
                    }
                    Paths._Actual     = new List <string>();
                    WayHealinProgress = true;
                }
                if (getStats.CurrentLP() > Settings._minLP & WayHealinProgress == true)
                {
                    WayHealinProgress = false;
                }
                if ((getStats.px() == 92) & (getStats.py() == 89) & IsMoneyInBankHigher() & Settings._TranserMoney)
                {
                    Ueberweisen();
                    WayUeberweisenProgress = false;
                }
                if (Settings._TranserMoney && IsMoneyInBankHigher())
                {
                    if (Paths._Actual.Count != 16)
                    {
                        WayUeberweisenProgress = true;
                    }
                }
                if (_wB.Document.Window.Frames[1].Document.Body.OuterText.Contains("Du kannst nicht 0 Goldmünzen einzahlen."))
                {
                    _wB.Document.Window.Frames[1].Navigate("http://" + Settings._World + ".freewar.de/freewar/internal/main.php");
                }

                TakeOilOrSumpfgas();
                TakeFederation();
                PfeileInBeutel();
                GeisterfunkeninGeisterschild();
                if ((Settings._RepairWeapons && _wB.Document.Window.Frames[1].Document.Body.OuterHtml.Contains("Waffen reparieren")))
                {
                    RepairWeapon();
                }
            }
            catch { }
        }