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

Preventing the pocket computer from turning off

Started by gril002, 04 April 2016 - 06:50 PM
gril002 #1
Posted 04 April 2016 - 08:50 PM
If the pocket computer is not in your inventory it will turn off. Is there a way to prevent this?
Bomb Bloke #2
Posted 05 April 2016 - 01:07 AM
Yes, keep it in your inventory.

You might be better off explaining what it is you're actually trying to accomplish.
Lupus590 #3
Posted 05 April 2016 - 02:27 PM
Pocket computers will stay on for a few seconds when it's not in your inventory, this is to allow trading with other players. You may be able to use this feature to your needs.

[slightlyOffTopic] anyone know if fake players such as autonomous activators can keep a pocket computer active? [/sightlyOffTopic]

Another possible solution could be to have the program executing on a normal block-based computer and have the pocket computer acting as a remote control for the block-based one. VNCD will allow you to do this.

As Bomb Bloke said, it will be easier to help you once we have a better understanding of what you are trying to do.
Edited on 05 April 2016 - 12:27 PM
gril002 #4
Posted 06 April 2016 - 05:43 PM
So if I have a Pocket computer in the disk drive and I start the computer attached to it it runs the Pockets startup instead of it's own. So is this suppose to be a thing? I know you can do it but I thought you had to specifficaly call it from the disk directory which I am not doing. I am using the pocket comp. as a security feature so this is not ideal.
Lyqyd #5
Posted 06 April 2016 - 05:47 PM
If I recall correctly, the startup file is executed with shell.run. You should be able to use shell.getRunningProgram in the pocket computer's startup file to check whether it should perform its startup or run the computer's startup.

Yes, mounted disks' startup files overriding the computer's startup file is an intended (and very useful) feature.
gril002 #6
Posted 06 April 2016 - 05:49 PM
When I insert the Pocket comp. in the drive bay it turns off. I want to prevent this becouse it has to delete a file when it's in there. If it turn off it will not delete it and it will stay on there. I am using the PoC as a security check so it writes the login data to the file so it can be accesed and checked by the door computer. It is obviously not the best thing if the file stays on if someone were to grab ithe PoC and find the file

Pocket computers will stay on for a few seconds when it's not in your inventory, this is to allow trading with other players. You may be able to use this feature to your needs.

[slightlyOffTopic] anyone know if fake players such as autonomous activators can keep a pocket computer active? [/sightlyOffTopic]

Another possible solution could be to have the program executing on a normal block-based computer and have the pocket computer acting as a remote control for the block-based one. VNCD will allow you to do this.

As Bomb Bloke said, it will be easier to help you once we have a better understanding of what you are trying to do.
Yes, keep it in your inventory.

You might be better off explaining what it is you're actually trying to accomplish.
Edited on 06 April 2016 - 03:49 PM
Lyqyd #7
Posted 06 April 2016 - 05:52 PM
I've merged these threads since they are about a single project.

It sounds like your interests would be best served by utilizing the fact that the pocket computer's startup is used to have it do whatever it needs to do in your security system.