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", }); }
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; }
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", }); }
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); }
public ActionUpgrade(ProcessingContext ctx) { context = ctx; upgradeBuildingFinder = new AutoResourceLoader(ctx, tempImgName, @"data\check\action\buildings\autocheck"); }