Beispiel #1
0
        private void Run()
        {
            money_calc = new MoneyCalculator();
            Random   rnd                   = new Random();
            int      pause_counter         = 0;
            int      runs_without_rest     = rnd.Next(40, 60);
            int      run_counter           = 0;
            DateTime last_reconnect        = DateTime.Now;
            int      next_reconnect_random = rnd.Next(0, 10);
            DateTime start                 = DateTime.Now;

            while (running && run_counter < maximum_runs)
            {
                run_counter++;
                pause_counter++;
                checkRest(ref rnd, ref pause_counter, ref runs_without_rest, run_counter);

                if (main.getInstance().getPW() != "")
                {
                    checkReconnect(ref rnd, ref last_reconnect, ref next_reconnect_random);
                }

                if (!openGame(ref rnd, run_counter))
                {
                    return;
                }

                System.Threading.Thread.Sleep(main.getInstance().getStartDelay());
                route(ref rnd, run_time, run_counter);

                if (main.getInstance().getStoreToStash())
                {
                    storeRoute(ref rnd, run_counter);
                }

                if (do_money_calc)
                {
                    int gold = D3InventoryStuff.getInstance().getGold(module_name);
                    if (gold != -1)
                    {
                        money_calc.add(new MoneyTime(DateTime.Now, gold));
                    }
                }

                updateAtMain(money_calc);

                closeGame(ref rnd);
            }

            emergencyStop("Stopped at run " + run_counter + "/" + maximum_runs + "!", run_counter);
        }
Beispiel #2
0
        private void updateAtMain(MoneyCalculator money_calc)
        {
            TimeSpan tmp_run_time     = new TimeSpan(0, 0, 0);
            int      tmp_start_gold   = 0;
            int      tmp_current_gold = 0;

            try
            {
                if (do_money_calc)
                {
                    tmp_current_gold = money_calc.current_money;
                    gold_per_hour    = money_calc.getGoldperHour();
                    tmp_start_gold   = money_calc.start_money;
                }
                tmp_run_time = DateTime.Now - money_calc.start_time;
            }
            catch { }


            main.getInstance().updateBaseBot(tmp_run_time, gold_per_hour, tmp_start_gold, tmp_current_gold, free_slots);
        }
Beispiel #3
0
        private void Run()
        {
            money_calc = new MoneyCalculator();
            Random rnd = new Random();
            int pause_counter = 0;
            int runs_without_rest = rnd.Next(40, 60);
            int run_counter = 0;
            DateTime last_reconnect = DateTime.Now;
            int next_reconnect_random = rnd.Next(0, 10);
            DateTime start = DateTime.Now;

            while (running && run_counter < maximum_runs)
            {
                run_counter++;
                pause_counter++;
                checkRest(ref rnd, ref pause_counter, ref runs_without_rest, run_counter);

                if(main.getInstance().getPW() != "")
                    checkReconnect(ref rnd, ref last_reconnect, ref next_reconnect_random);

                if (!openGame(ref rnd, run_counter))
                    return;

                System.Threading.Thread.Sleep(main.getInstance().getStartDelay());
                route(ref rnd, run_time, run_counter);

                if (main.getInstance().getStoreToStash())
                    storeRoute(ref rnd, run_counter);

                if (do_money_calc)
                {
                    int gold = D3InventoryStuff.getInstance().getGold(module_name);
                    if(gold != -1)
                        money_calc.add(new MoneyTime(DateTime.Now, gold));
                }

                updateAtMain(money_calc);

                closeGame(ref rnd);

            }

            emergencyStop("Stopped at run " + run_counter + "/" + maximum_runs + "!", run_counter);
        }
Beispiel #4
0
        private void updateAtMain(MoneyCalculator money_calc)
        {
            TimeSpan tmp_run_time = new TimeSpan(0,0,0);
            int tmp_start_gold = 0;
            int tmp_current_gold = 0;

            try
            {
                if (do_money_calc)
                {
                    tmp_current_gold = money_calc.current_money;
                    gold_per_hour = money_calc.getGoldperHour();
                    tmp_start_gold = money_calc.start_money;
                }
                tmp_run_time = DateTime.Now - money_calc.start_time;
            }
            catch { }


            main.getInstance().updateBaseBot(tmp_run_time, gold_per_hour, tmp_start_gold, tmp_current_gold, free_slots);
        }