Exemplo n.º 1
0
 public ActionJunkRemove(ProcessingContext ctx)
 {
     context    = ctx;
     junkFinder = new AutoResourceLoader(ctx, tempImgName, @"data\check\useless");
     buttons    = new AutoResourceLoader(ctx, tempImgName, new string[] {
         @"data\check\useless\btns\removebutton.png",
         @"data\check\useless\btns\cancelremove.png",
     });
 }
Exemplo n.º 2
0
 public ResourceClicks(ProcessingContext ctx)
 {
     if (ldr == null)
     {
         ldr = new ccVcontrol.AutoResourceLoader(ctx, StandardClicks.tempImgName, "data\\check\\action\\res\\", 2, 3000);
     }
     if (baseMark == null)
     {
         baseMark = new ccVcontrol.AutoResourceLoader(ctx, StandardClicks.tempImgName, "data\\check\\marks\\", 1);
     }
     context = ctx;
 }
Exemplo n.º 3
0
 public ActionTrainUnits(ProcessingContext ctx)
 {
     context           = ctx;
     trainButtonFinder = new AutoResourceLoader(ctx, tempImgName, new string[]
     {
         @"data\check\action\buttons\train.png",
         @"data\check\action\buttons\trainTroopsTab.png"
     });
     buildArcherWizardButton = new AutoResourceLoader(ctx, tempImgName, new string[]
     {
         @"data\check\buildwizardbutton.png",
         @"data\check\buildArchierButton.png",
     });
 }
Exemplo n.º 4
0
        public void RearmAll()
        {
            var ldr = new AutoResourceLoader(context, StandardClicks.GetTempDirFile("tmpRearmAll.png"),
                                             getCheckImgs());

            var cmd = ldr.ProcessingWithRetryTop1(r => r.extraInfo != null && r.extraInfo.Contains("townhall"));

            if (cmd == null)
            {
                context.InfoLog("Warning, didn't find townhall");
                return;
            }
            context.InfoLog($"Found townhall clicking {cmd.extraInfo} {cmd.cmpRes} {cmd.decision}");
            context.MoveMouseAndClick(cmd);
            Thread.Sleep(1000);
            context.InfoLog($"done wait, try find rearmall");
            var cmds = ldr.ProcessingWithRetry();

            cmd = cmds.Where(c => c.decision == "true" && c.extraInfo.Contains("rearmall")).OrderBy(c => c.cmpRes).FirstOrDefault();
            //cmd = cmds.FirstOrDefault(c => c.extraInfo.Contains("rearmall") && c.cmpRes < 30000);
            if (cmd == null)
            {
                context.InfoLog("Warning, didn't find rearm all");
                return;
            }
            context.InfoLog($"Found rearm all {cmd.extraInfo} {cmd.cmpRes} {cmd.decision}");
            context.MoveMouseAndClick(cmd);

            cmds = ldr.ProcessingWithRetry(r => r.extraInfo.Contains("ok_bigv1"));
            cmd  = cmds.FirstOrDefault();
            if (cmd == null)
            {
                context.InfoLog("Warning, didn't find ok button");
                return;
            }
            context.InfoLog($"Found rearm all ok button {cmd.extraInfo} {cmd.cmpRes} {cmd.decision}");
            context.MoveMouseAndClick(cmd);
        }
Exemplo n.º 5
0
 public ActionUpgrade(ProcessingContext ctx)
 {
     context = ctx;
     upgradeBuildingFinder = new AutoResourceLoader(ctx, tempImgName,
                                                    @"data\check\action\buildings\autocheck");
 }