Advertisement
Bl4ckC4t1337

procs monitor

Dec 21st, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. getProcs = function()
  2. prog = get_shell.host_computer.show_procs.split("\n")[1:]
  3. names = []
  4. for line in prog
  5. names.push(line.split(" ")[-1])
  6. end for
  7. return names
  8. end function
  9. comp = get_shell.host_computer
  10. comp.touch(current_path, "procs.txt")
  11. procs_file = comp.File(current_path + "/procs.txt")
  12.  
  13. last_procs = getProcs()
  14. unique_progs = []
  15. while true
  16. procs = getProcs()
  17. if procs != last_procs then
  18. for name in procs
  19. if unique_progs.indexOf(name) == null then
  20. unique_progs.push(name)
  21. procs_file.set_content(unique_progs.join("\n"))
  22. end if
  23. end for
  24. print("Change!")
  25. end if
  26. last_procs = procs
  27. end while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement