Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- state("Lufia2MemoryMonitor"){
- }
- startup {
- DataReceivedEventHandler MyOutputHandler = (sender, e) =>
- {
- if (!String.IsNullOrEmpty(e.Data))
- {
- string line = e.Data.Replace("\n", String.Empty).Replace("\r", String.Empty);
- print("TESTING: " + line);
- if (line == "SPLIT")
- {
- print("TO_SPLIT");
- vars.needSplit = true;
- }
- }
- };
- Process[] processes = Process.GetProcessesByName("Lufia2MemoryMonitor");
- if (processes.Length == 0) {
- vars.proc = new Process();
- vars.proc.StartInfo.UseShellExecute = false;
- vars.proc.StartInfo.RedirectStandardOutput = true;
- vars.proc.StartInfo.FileName = "D:\\Lufia2MemoryMonitor.exe";
- vars.proc.OutputDataReceived += new DataReceivedEventHandler(MyOutputHandler);
- vars.proc.Start();
- vars.proc.BeginOutputReadLine();
- }
- vars.needSplit = false;
- }
- shutdown {
- Process[] processes = Process.GetProcessesByName("Lufia2MemoryMonitor");
- if (processes.Length > 0) {
- processes[0].CloseMainWindow();
- }
- }
- split {
- if (vars.needSplit) {
- print("SPLIT");
- vars.needSplit = false;
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement