can you please add the isRunning() peripheral function in a future update? (boolean)
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
peripheral function isRunning() suggestion
Started by martmists, 16 April 2015 - 03:15 PMPosted 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)
can you please add the isRunning() peripheral function in a future update? (boolean)
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. ;)/>
I hope I clarified. ;)/>
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/>
I hope I clarified :P/>
Edited on 16 April 2015 - 05:50 PM
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)
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…
Posted 17 April 2015 - 07:14 PM
Well, i mean if they are on, but not running a program.
should have explained better.
should have explained better.
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.
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.
Posted 12 May 2015 - 03:54 AM
If you want to know what program is being run, use shell.getRunningProgram()
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.
Posted 12 May 2015 - 09:21 PM
I thought computers could access one another.
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)
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).
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 signalsit 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
Posted 12 May 2015 - 10:00 PM
Oh
Posted 12 May 2015 - 11:28 PM
This is all you can do with a computer as a peripheral.I thought computers could access one another.