Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. state("Lufia2MemoryMonitor"){
  2. }
  3.  
  4. startup {
  5. DataReceivedEventHandler MyOutputHandler = (sender, e) =>
  6. {
  7. if (!String.IsNullOrEmpty(e.Data))
  8. {
  9. string line = e.Data.Replace("\n", String.Empty).Replace("\r", String.Empty);
  10. print("TESTING: " + line);
  11. if (line == "SPLIT")
  12. {
  13. print("TO_SPLIT");
  14. vars.needSplit = true;
  15. }
  16. }
  17. };
  18.  
  19. Process[] processes = Process.GetProcessesByName("Lufia2MemoryMonitor");
  20. if (processes.Length == 0) {
  21. vars.proc = new Process();
  22. vars.proc.StartInfo.UseShellExecute = false;
  23. vars.proc.StartInfo.RedirectStandardOutput = true;
  24. vars.proc.StartInfo.FileName = "D:\\Lufia2MemoryMonitor.exe";
  25.  
  26. vars.proc.OutputDataReceived += new DataReceivedEventHandler(MyOutputHandler);
  27.  
  28. vars.proc.Start();
  29. vars.proc.BeginOutputReadLine();
  30. }
  31.  
  32. vars.needSplit = false;
  33. }
  34.  
  35. shutdown {
  36. Process[] processes = Process.GetProcessesByName("Lufia2MemoryMonitor");
  37. if (processes.Length > 0) {
  38. processes[0].CloseMainWindow();
  39. }
  40. }
  41.  
  42. split {
  43. if (vars.needSplit) {
  44. print("SPLIT");
  45. vars.needSplit = false;
  46. return true;
  47. }
  48. return false;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement