public override void OnMatched(ScriptBase script) { if (script.MatchTemplate(classicFocus, 98) && !script.MatchTemplate(data, 98)) { script.Press(new DualShockState() { Triangle = true }); /* To restart AutomateMatch next time */ MyClub.Sim.AutomateMatch.Instance.MatchDone(); /* Register Match and date */ Log.Log2File(Name, "Starting match"); } else if (!script.MatchTemplate(classicFocus, 98) && script.MatchTemplate(data, 98)) { /* To keep PS4 alive while waiting end of match */ script.Press(new DualShockState() { Square = true }); Log.LogMessage(Name, "Waiting end of match ..."); Thread.Sleep(5000); } }
public override void OnMatched(ScriptBase script) { script.Press(new DualShockState() { DPad_Right = true }); script.Press(new DualShockState() { Cross = true }); }
public override void OnMatched(ScriptBase script) { script.Press(new DualShockState() { DPad_Right = true }); script.Sleep(Settings.Default.InputDelay); script.Press(new DualShockState() { DPad_Right = false }); }
public override void OnMatched(ScriptBase script) { script.Press(new DualShockState() { Cross = true }); script.Sleep(Settings.Default.TowerStartDelay); }
public override void OnMatched(ScriptBase script) { MyClub.Sim.AutomateMatch.ClubHouseAction action = MyClub.Sim.AutomateMatch.Instance.ActionForClubHouse(); switch (action) { case MyClub.Sim.AutomateMatch.ClubHouseAction.enterManageTeam: Log.LogMessage(Name, "Enter to 'Manage Team'."); if (script.MatchTemplate(manageTeamSelected, 98)) { script.Press(new DualShockState() { Cross = true }); MyClub.Sim.AutomateMatch.Instance.SelectManageTeamDone(); } else { SelectManageTeam(script); } break; case MyClub.Sim.AutomateMatch.ClubHouseAction.enterPlayNow: Log.LogMessage(Name, "Enter to 'Play Now'."); if (script.MatchTemplate(playNowSelected, 98)) { script.Press(new DualShockState() { Cross = true }); MyClub.Sim.AutomateMatch.Instance.LaunchMatchDone(); } else { SelectPlayNow(script); } break; case MyClub.Sim.AutomateMatch.ClubHouseAction.none: default: Log.LogMessage(Name, "No action to do."); break; } }
public override void OnMatched(ScriptBase script) { // Press play script.Press(new DualShockState() { Cross = true }); // Wait 10 seconds script.Sleep(10000); }
public override void OnMatched(ScriptBase script) { script.Press(new DualShockState() { Options = true }); /* Register Match and date */ Log.Log2File(Name, "Ending match"); }
public override void OnMatched(ScriptBase script) { var sleepTime = 1000; script.Press(new DualShockState() { Cross = true }); script.Sleep(sleepTime); script.Press(new DualShockState() { Cross = true }); script.Sleep(sleepTime); script.Press(new DualShockState() { Cross = true }); script.Sleep(sleepTime); }
private PixelMap SelectPlayNow(ScriptBase script) { PixelMap from = noSelected, to = playNowSelected; from = SelectManageTeam(script); script.Press(new DualShockState() { DPad_Left = true }); Log.LogMessage(Name, "Go from '" + from.ID + "' to '" + to.ID + "'"); return(from); }
public static void Press(string keytopress, int TimesPress, int waiter, ScriptBase script) { keytopress = keytopress.ToLower(); while (TimesPress > 0) { switch (keytopress) { case "cross": script.Press(new DualShockState() { Cross = true }); break; case "circle": script.Press(new DualShockState() { Circle = true }); break; case "dpad_right": script.Press(new DualShockState() { DPad_Right = true }); break; case "dpad_left": script.Press(new DualShockState() { DPad_Left = true }); break; case "dpad_down": script.Press(new DualShockState() { DPad_Down = true }); break; case "dpad_up": script.Press(new DualShockState() { DPad_Up = true }); break; } script.Sleep(waiter); TimesPress--; } }
public override void OnMatched(ScriptBase script) { script.Press(new DualShockState() { Cross = true }); if (script.MatchTemplate(seasonMaintainFocus, 98)) { /* Register End of season & date */ Log.Log2File(Name, "End of season : Maintain"); } else if (script.MatchTemplate(seasonPromoteFocus, 98)) { /* Register End of season & date */ Log.Log2File(Name, "End of season : Promote"); } }
public override void OnMatched(ScriptBase script) => script.Press(new DualShockState() { Options = true });
private void SwitchTeam(ScriptBase script, MyClub.Sim.AutomateMatch.Team team) { script.Press(new DualShockState() { Triangle = true }); script.Press(new DualShockState() { DPad_Down = true }); script.Press(new DualShockState() { Cross = true }); /*while (!script.MatchTemplate(script.CaptureFrame(), ????, 98)) * { * Thread.Sleep(1000); * Log.LogMessage(Name, "Waiting for 'Select team menu'"); * }*/ // TODO : CAPTURE THE PICTURE !! Thread.Sleep(5000); if (team == MyClub.Sim.AutomateMatch.Team.winTwo) { /* Select Team.win2 - Add short pause between same key */ script.Press(new DualShockState() { DPad_Down = true }); Thread.Sleep(100); script.Press(new DualShockState() { DPad_Down = true }); script.Press(new DualShockState() { Cross = true }); } if (team == MyClub.Sim.AutomateMatch.Team.winOne) { /* Select Team.win1 - Add short pause between same key */ script.Press(new DualShockState() { DPad_Down = true }); Thread.Sleep(100); script.Press(new DualShockState() { DPad_Down = true }); Thread.Sleep(100); script.Press(new DualShockState() { DPad_Down = true }); script.Press(new DualShockState() { Cross = true }); } if (team == MyClub.Sim.AutomateMatch.Team.loseTwo) { /* Select Team.lose2 - Add short pause between same key */ script.Press(new DualShockState() { DPad_Down = true }); script.Press(new DualShockState() { Cross = true }); } else if (team == MyClub.Sim.AutomateMatch.Team.loseOne) { /* Select Team.lose1 - Add short pause between same key */ script.Press(new DualShockState() { DPad_Down = true }); Thread.Sleep(100); script.Press(new DualShockState() { DPad_Down = true }); Thread.Sleep(100); script.Press(new DualShockState() { DPad_Down = true }); Thread.Sleep(100); script.Press(new DualShockState() { DPad_Down = true }); script.Press(new DualShockState() { Cross = true }); } Log.LogMessage(Name, "Switch to team " + team.ToString() + " : OK."); }
public override void OnMatched(ScriptBase script) { MyClub.Sim.AutomateMatch.ManageTeamAction action = MyClub.Sim.AutomateMatch.Instance.ActionForManageTeam(); switch (action) { case MyClub.Sim.AutomateMatch.ManageTeamAction.readTeamNumber: Log.LogMessage(Name, "Read team number."); Log.LogMatchTemplate(script, Name, new List <RectMap> { team_WinOne_Focus, teamWinTwo_Focus, team_LoseOne_Focus, team_LoseTwo_Focus }); MyClub.Sim.AutomateMatch.Team t; if (script.MatchTemplate(team_WinOne_Focus, 98)) { t = MyClub.Sim.AutomateMatch.Team.winOne; } else if (script.MatchTemplate(teamWinTwo_Focus, 98)) { t = MyClub.Sim.AutomateMatch.Team.winTwo; } else if (script.MatchTemplate(team_LoseOne_Focus, 98)) { t = MyClub.Sim.AutomateMatch.Team.loseOne; } else if (script.MatchTemplate(team_LoseTwo_Focus, 98)) { t = MyClub.Sim.AutomateMatch.Team.loseTwo; } else { t = MyClub.Sim.AutomateMatch.Team.unknown; } if (t != MyClub.Sim.AutomateMatch.Team.unknown) { MyClub.Sim.AutomateMatch.Instance.ReadTeamNumberDone(t); Log.LogMessage(Name, "Read team number = " + t.ToString()); Thread.Sleep(5000); } else { script.Press(new DualShockState() { Circle = true }); Log.LogMessage(Name, "Failed to read team number."); } break; case MyClub.Sim.AutomateMatch.ManageTeamAction.switchTeams: MyClub.Sim.AutomateMatch.Team from, to; from = MyClub.Sim.AutomateMatch.Instance.TeamNumber; switch (from) { case MyClub.Sim.AutomateMatch.Team.loseOne: to = MyClub.Sim.AutomateMatch.Team.loseTwo; break; case MyClub.Sim.AutomateMatch.Team.loseTwo: to = MyClub.Sim.AutomateMatch.Team.loseOne; break; case MyClub.Sim.AutomateMatch.Team.winOne: to = MyClub.Sim.AutomateMatch.Team.winTwo; break; case MyClub.Sim.AutomateMatch.Team.winTwo: to = MyClub.Sim.AutomateMatch.Team.winOne; break; case MyClub.Sim.AutomateMatch.Team.unknown: default: to = MyClub.Sim.AutomateMatch.Team.unknown; break; } Log.LogMessage(Name, "Switch from team " + from.ToString() + " to " + to.ToString() + "."); SwitchTeam(script, to); MyClub.Sim.AutomateMatch.Instance.SwitchTeamDone(); break; case MyClub.Sim.AutomateMatch.ManageTeamAction.exit: Log.LogMessage(Name, "Exit manage team."); script.Press(new DualShockState() { Circle = true }); MyClub.Sim.AutomateMatch.Instance.ExitManageTeamDone(); break; case MyClub.Sim.AutomateMatch.ManageTeamAction.none: default: Log.LogMessage(Name, "No action to do."); break; } }
private PixelMap SelectManageTeam(ScriptBase script) { PixelMap from = noSelected, to = manageTeamSelected; if (script.MatchTemplate(playNowSelected, 98)) { script.Press(new DualShockState() { DPad_Right = true }); from = playNowSelected; } else if (script.MatchTemplate(manageTeamSelected, 98)) { from = manageTeamSelected; } else if (script.MatchTemplate(memberSelected, 98)) { script.Press(new DualShockState() { DPad_Left = true }); from = memberSelected; } else if (script.MatchTemplate(trainingSelected, 98)) { script.Press(new DualShockState() { DPad_Left = true }); from = trainingSelected; } else if (script.MatchTemplate(historySelected, 98)) { script.Press(new DualShockState() { DPad_Right = true }); script.Press(new DualShockState() { DPad_Up = true }); from = historySelected; } else if (script.MatchTemplate(planSelected, 98)) { script.Press(new DualShockState() { DPad_Up = true }); from = planSelected; } else if (script.MatchTemplate(shopSelected, 98)) { script.Press(new DualShockState() { DPad_Up = true }); script.Press(new DualShockState() { DPad_Left = true }); from = shopSelected; } else if (script.MatchTemplate(mailSelected, 98)) { script.Press(new DualShockState() { DPad_Up = true }); script.Press(new DualShockState() { DPad_Left = true }); from = mailSelected; } Log.LogMessage(Name, "Go from '" + from.ID + "' to '" + to.ID + "'"); return(from); }
public override void OnMatched(ScriptBase script) { var mainscript = script as Script; mainscript.MainForm.Log("Entered Freemode"); script.Press(new DualShockState() { Options = true }); script.Sleep(400); script.Press(new DualShockState() { DPad_Right = true }); script.Sleep(350); script.Press(new DualShockState() { Cross = true }); script.Sleep(350); script.Press(new DualShockState() { Cross = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { Cross = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { Cross = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(350); script.Press(new DualShockState() { Cross = true }); script.Sleep(350); for (int i = 1; i <= 2; i++) { script.Press(new DualShockState() { DPad_Down = true }); script.Sleep(50); } script.Press(new DualShockState() { Cross = true }); script.Sleep(350); script.Press(new DualShockState() { Cross = true }); script.Sleep(30000); }
public override void OnMatched(ScriptBase script) { bool manager = script.MatchTemplate(extensionManagerFocusHeader, 98); Log.LogMessage(Name, "Start"); // List of player to renew script.Press(new DualShockState() { DPad_Right = true }); script.Press(new DualShockState() { Cross = true }); Log.LogMessage(Name, "Accept to renew players/Manager"); // Cost and kind of money while (!script.MatchTemplate(script.CaptureFrame(), extension2Focus, 98)) { Thread.Sleep(1000); Log.LogMessage(Name, "Waiting for 'Pay with GP money'"); } script.Press(new DualShockState() { Cross = true }); Log.LogMessage(Name, "Pay with GP money"); // Confirmation while (!script.MatchTemplate(script.CaptureFrame(), extension3Focus, 98)) { Thread.Sleep(1000); Log.LogMessage(Name, "Waiting for 'Confirm'"); } script.Press(new DualShockState() { DPad_Right = true }); script.Press(new DualShockState() { Cross = true }); Log.LogMessage(Name, "Confirm"); // Transaction'status while (!script.MatchTemplate(script.CaptureFrame(), extension4Focus, 98)) { Thread.Sleep(1000); Log.LogMessage(Name, "Waiting for 'Skip transaction status'"); } script.Press(new DualShockState() { Cross = true }); Log.LogMessage(Name, "Skip transaction'status"); /* Only for manager */ if (manager) { // Transaction'status 2 /*while (!script.MatchTemplate(script.CaptureFrame(), extension5Focus, 98)) * { * Thread.Sleep(1000); * Log.LogMessage(Name, "Waiting for 'Skip transaction status2'"); * }*/ // TODO : CAPTURE THE PICTURE !! Thread.Sleep(5000); script.Press(new DualShockState() { Cross = true }); Log.LogMessage(Name, "Skip transaction'status2"); } Log.LogMessage(Name, "End"); }