This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
amtra5's profile picture

Is There Any Way To Count/detect Running Programs?

Started by amtra5, 24 September 2013 - 01:08 AM
amtra5 #1
Posted 24 September 2013 - 03:08 AM
Title says it all ;)/>

Thanks in advance.
Kingdaro #2
Posted 24 September 2013 - 07:48 AM
Try overwriting the shell.run function?


local count = 0
do
  local run = shell.run
  function shell.run(...)
    count = count + 1
    run(...)
    count = count - 1
  end
end

This is kind of pointless unless you're using some sort of multitasking system, though.