コード例 #1
0
ファイル: SimpleController.cs プロジェクト: gzhangx/ccauto
        public SimpleController()
        {
            doUpgrades = false;
            doDonate   = true;
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("log4net.conf"));
            Logger = LogManager.GetLogger("ccVcontrol");
            string tmp;
            var    files = SwitchAccount.GetAccountFiles(out tmp);

            accountStartCounts = new int[files.Count()];
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: gzhangx/ccauto
        private static void DoProcess(ProcessingContext context)
        {
            var controller = context.vdcontroller;

            //context.DebugLog("TODOREMOVETEMP");
            //Thread.Sleep(5000);
            //context.MouseDragTo(1024/2, 768/2, 1024/4, 768/4); //Christmas hack

            var  resourceClick  = new ResourceClicks(context);
            var  baseType       = resourceClick.PrimaryOrSecondary();
            bool skipProcessing = TryForceMoveToPrimary(resourceClick, context);

            resourceClick.Processing(baseType);
            skipProcessing = TryForceMoveToPrimary(resourceClick, context);
            context.DebugLog("ENDTODOREMOVETEMP");

            resourceClick.RearmAll();

            new ActionJunkRemove(context).Process();
            new ActionUpgrade(context).Process();
            //while(controller.humanMode && controller.CurState != ProcessState.SwitchAccount)
            //{
            //    controller.Sleep(100);
            //}
            var switchAccount = new SwitchAccount(context);

            context.GetToEntrance();
            context.DebugLog("In Entrance, sleep 100");
            context.Sleep(1000);
            int acct = switchAccount.CheckAccount();

            if (acct <= 0)
            {
                context.InfoLog("failed to get account, try again");
                context.Sleep(4000);
                acct = switchAccount.CheckAccount();
            }
            context.InfoLog($"===>Step gen acct pic {acct}");
            switchAccount.CurAccount = acct;
            GenerateAccountPics(context, switchAccount.CurAccount);
            context.InfoLog($"===>Step Using account {switchAccount.CurAccount}");
            context.vdcontroller.NotifyStartingAccount(switchAccount);
            if (!skipProcessing)
            {
                if (controller.DoDonate())
                {
                    var train = new ActionTrainUnits(context);
                    train.ProcessCommand(context);
                }

                if (controller.DoDonate() && controller.doDonate)
                {
                    context.InfoLog("===>Step Donate");
                    //cmds = Utils.GetAppInfo();
                    ProcessDonate(context, context.GetToEntrance());
                    context.GetToEntrance();
                }
                if (controller.DoBuilds() && !controller.switchAccountOnly)
                {
                    context.InfoLog("===>Step textmap");
                    new ProcessorMapByText(context).ProcessCommand(acct);
                }
            }

            DoProcessSecondary(resourceClick, context);

            switchAccount.CurAccount = controller.CheckSetCurAccount(acct);
            context.InfoLog("===>Step SwitchAccount");
            switchAccount.Process();
            context.InfoLog("===>Step get to entrance");
            context.GetToEntrance();
            context.Sleep(4000);
            controller.DoneCurProcessing();
        }