public void Run() { var logFileListener = new LogFileReader(); logFileListener.RegisterListener(GetListener()); NativeApiWrapper.RunGame(); }
void OnFogResult(object sender, ImageProcessorEventArgs <GameMapProcessorResult <MapDirectionMoveInfo> > e) { time += NativeApiWrapper.StandartDelay; var calcRes = e.ImageProcessorResult.VectorizationResult.ToList(); var itemsToRemove = calcRes.Where(a => a.Angle >= MaxAngle || a.Angle <= MinAngle).ToList(); foreach (var item in itemsToRemove) { calcRes.Remove(item); } AddToFogHistory(new HistoryElement <MapDirectionMoveInfo>() { MoveInfos = calcRes }); if (!mapHistory.Any()) { return; } if (lockObserver.Locked) { return; } if (time > MaxAreaTime) { OnAreaEnded(); return; } var mainAngle = MainAreaOrientation; IEnumerable <MapDirectionMoveInfo> vectorizationResult = null;; if (!calcRes.Any()) { var lastSuccessResult = fogHistory.OrderByDescending(a => a.ID).Where(a => a.MoveInfos.Any()); if (lastSuccessResult.Any()) { vectorizationResult = lastSuccessResult.OrderBy(a => a.ID).Last().MoveInfos; } } else { vectorizationResult = calcRes; } if (vectorizationResult == null) { OnAreaEnded(); return; } var nextMarker = ProcessNextMarker(vectorizationResult); mainAngle = nextMarker.CenterAngle; AttackPusher.CenterAngle = nextMarker.CenterAngle; var point = NativeApiWrapper.GetScreenRotatedPoint((int)mainAngle); AvailableInput.MouseMove(point); AvailableInput.Input(Settings.MoveKey); }
public AttackPusher() { PusherInfo pusherInfo = new PusherInfo(); pusherInfo.BeforePush = () => { if (CenterAngle == -1) { return; } var point = NativeApiWrapper.GetScreenRotatedPoint((int)CenterAngle); AvailableInput.MouseMove(point); }; pusherInfo.Code = Settings.MainAttack; pusherInfo.Delay = Settings.AttackDelay; CreatePusher(pusherInfo); }
protected override Script StartRecord() { var script = new Script(); script.DoDelay(() => 100); script.DoDelay(() => { NativeApiWrapper.InitGameInstance(); return(1.5); }); script.DoInput(() => InputCodes.Space); script.DoInput(() => InputCodes.Space); script.DoInput(() => InputCodes.Space); script.DoMouseMoveWithClick(() => new System.Drawing.Point(344, 448)); //go to password box script.DoInputWithModifiers(() => { Clipboard.SetText(Settings.Password); return(Ctrl_V); }); script.DoMouseMoveWithClick(() => new System.Drawing.Point(564, 425)); // click login script.DoInput(() => InputCodes.Return, 10); return(script); }
private void button1_Click(object sender, EventArgs e) { NativeApiWrapper.InitGameInstance(); RelogScript aqueducProfile = new RelogScript(); aqueducProfile.Run(); //ReturnToHideoutScript gameRunScript = new ReturnToHideoutScript(); //gameRunScript.Run(); ////AqueductNewAreaScript aqueductNewAreaScript = new AqueductNewAreaScript(); ////aqueductNewAreaScript.Run(); //LogFileReader logFileReader = new LogFileReader(); //logFileReader.NewData += LogFileReader_NewData; ////AvailableInput.MouseMove(new Point(50, 50)); ////AvailableInput.Input(InputCodes.LButton); ////AvailableInput.Input(InputCodes.Return); ////AvailableInput.InputCombination(InputCodes.ControlKey, InputCodes.V); ////ItemFactory itemFactory = new ItemFactory(); ////var item = itemFactory.GetModel(); ////var res = Settings.Pickit.IsValid(item); }