Jump to content




peripheral function isRunning() suggestion



13 replies to this topic

#1 martmists

  • Members
  • 16 posts

Posted 16 April 2015 - 04: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)

#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 16 April 2015 - 04: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. ;)

#3 flaghacker

  • Members
  • 655 posts

Posted 16 April 2015 - 06: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 by flaghacker, 16 April 2015 - 06:50 PM.


#4 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 16 April 2015 - 06: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)

#5 flaghacker

  • Members
  • 655 posts

Posted 16 April 2015 - 07:04 PM

View PostDog, on 16 April 2015 - 06:55 PM, said:

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...

#6 martmists

  • Members
  • 16 posts

Posted 17 April 2015 - 06:14 PM

Well, i mean if they are on, but not running a program.
should have explained better.

#7 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 17 April 2015 - 07:20 PM

The are always running a program. Shell is a program. And when you terminate shell, the PC stops.

#8 ElvishJerricco

  • Members
  • 803 posts

Posted 18 April 2015 - 11:10 AM

View Postmartmists, on 17 April 2015 - 06:14 PM, said:

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.

#9 ViperLordX

  • Members
  • 43 posts
  • LocationEarth

Posted 12 May 2015 - 02:54 AM

If you want to know what program is being run, use shell.getRunningProgram()

#10 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 12 May 2015 - 01:09 PM

View PostViperLordX, on 12 May 2015 - 02:54 AM, said:

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.

#11 ViperLordX

  • Members
  • 43 posts
  • LocationEarth

Posted 12 May 2015 - 08:21 PM

I thought computers could access one another.

#12 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 12 May 2015 - 08: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???

Edited by Lupus590, 12 May 2015 - 09:20 PM.


#13 ViperLordX

  • Members
  • 43 posts
  • LocationEarth

Posted 12 May 2015 - 09:00 PM

Oh

#14 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 12 May 2015 - 10:28 PM

View PostViperLordX, on 12 May 2015 - 08:21 PM, said:

I thought computers could access one another.
This is all you can do with a computer as a peripheral.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users