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

peripheral function isRunning() suggestion

Started by martmists, 16 April 2015 - 03:15 PM
martmists #1
Posted 16 April 2015 - 05:15 PM
i love computercraft, but there is one thing i am missing. i have a computer telling me which computers are on/off, but what i really want to know is whether they are running.
can you please add the isRunning() peripheral function in a future update? (boolean)
Creator #2
Posted 16 April 2015 - 05:51 PM
Computers are constantly running. When it is in the shell, it is not idle. So as long at it is on it is running.

I hope I clarified. ;)/>
flaghacker #3
Posted 16 April 2015 - 07:50 PM
Computers can be off, aka "not running". They can be shut down via os.shutdown and I think they don't boot when the world reloads and there's no startup file (don't quote me on that thought)

I hope I clarified :P/>
Edited on 16 April 2015 - 05:50 PM
Dog #4
Posted 16 April 2015 - 07:55 PM
I don't think the startup file matters - in my experience, if the computer was off when the world was shut down it'll stay off when the world restarts (even if there is a startup file)
flaghacker #5
Posted 16 April 2015 - 08:04 PM
I don't think the startup file matters - in my experience, if the computer was off when the world was shut down it'll stay off when the world restarts (even if there is a startup file)

Yes, that would be it. I was trying to think of a reason they sometimes don't boot…
martmists #6
Posted 17 April 2015 - 07:14 PM
Well, i mean if they are on, but not running a program.
should have explained better.
Creator #7
Posted 17 April 2015 - 08:20 PM
The are always running a program. Shell is a program. And when you terminate shell, the PC stops.
ElvishJerricco #8
Posted 18 April 2015 - 12:10 PM
Well, i mean if they are on, but not running a program.
should have explained better.

There is no difference between on and running a program. It can't be on and not running a program. The peripheral API shouldn't be able to tell what program it's running, that's not its job.

Whatever you need this for, you're going to have to look into other solutions. Such as running a rednet service.
ViperLordX #9
Posted 12 May 2015 - 03:54 AM
If you want to know what program is being run, use shell.getRunningProgram()
KingofGamesYami #10
Posted 12 May 2015 - 02:09 PM
If you want to know what program is being run, use shell.getRunningProgram()

Peripheral calls don't have access to the shell. Read the thread, please.
ViperLordX #11
Posted 12 May 2015 - 09:21 PM
I thought computers could access one another.
Lupus590 #12
Posted 12 May 2015 - 09:59 PM
only via rednet/redstone, computers can only turn each other on and off when one is wrapped as a peripheral
even via rednet, other computers can only access what the host offers (taking nsh as an example, I can't connect to any computer, only those running a nsh compatible server)


computers communicating via redstone???before modems were in the mod, people wrote programs which exchanged messages via redstone signals
it is/was very inefficient as signals could be easily corrupted and sending data took a while (one bit per redstone dust line per tick (1/10 seconds) is the theoretical fastest without another mod, with (redpower/project: red) bundled cables: one bit per cable per tick or 2 bytes per bundled cable (16 colours) per tick both theoretical fastest again).
Edited on 12 May 2015 - 08:20 PM
ViperLordX #13
Posted 12 May 2015 - 10:00 PM
Oh
theoriginalbit #14
Posted 12 May 2015 - 11:28 PM
I thought computers could access one another.
This is all you can do with a computer as a peripheral.