public override void OnMatched(ScriptBase script) { // Prevent infinite loop while (!script.Host.Worker.CancellationPending) { // Scene has changed if (!Match(script)) { break; } // Wait 1 second script.Sleep(1000); // Take screenshot script.CaptureFrame(); } // Take screenshot script.CaptureFrame(); // Wait 5 seconds script.Sleep(5000); }
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"); }