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

activate computer/program via pressure plate

Started by MrR0ket0, 30 July 2012 - 07:43 PM
MrR0ket0 #1
Posted 30 July 2012 - 09:43 PM
Hello folks,

once again i have a question since i found nothing on wiki or in this forum.
Is it somehow possible to active a computer and a program start just by simply stepping over a pressure plate?
Iam asking because yesterday i set up a big mointor with a text on it and everytime i leave it running alone for a while i had to restart the programm on the computer cause it will shutdown after a while

If anyone knows i would appreciate thx
SavinaRoja #2
Posted 30 July 2012 - 10:03 PM
To my knowledge, you cannot activate or "start" an (inactive/offline) computer with a redstone current such as provided by a pressure plate; though an active computer can interact with them as well as transmit its own signals. I believe that a player has to access it in order to turn it on. I can offer a suggestion that will at least save you some time in the restart process. Add a startup file to your computer with "edit startup" and give it instructions to launch your program. This file will be accessed whenever your computer is turned on or reboots, saving you some typing.
Edited on 30 July 2012 - 08:04 PM
MrR0ket0 #3
Posted 30 July 2012 - 10:19 PM
thx for the reply, its sad cause i think it can be a usefull feature to turn on offline computers by a preassure plate
anyways id stick for now with the startup or implement a loop in my source so that the computer runs all the time my textdisplay programm instead shuting down completely
Xenthera #4
Posted 30 July 2012 - 10:24 PM
thx for the reply, its sad cause i think it can be a usefull feature to turn on offline computers by a preassure plate
anyways id stick for now with the startup or implement a loop in my source so that the computer runs all the time my textdisplay programm instead shuting down completely

Honestly that logically wouldn't make sense though. Just change your program to not shutdown the computer.
EmTeaKay #5
Posted 30 July 2012 - 10:26 PM
Maybe this would work?

if not rs.getInput("side") then
os.shutdown()
end
I think that would work, if you put that in a startup file, it would require power, i.e. you to be stepping on a pressure plate to turn on.
I'm testing now.

EDIT: That won't work. I am clueless.
Luanub #6
Posted 30 July 2012 - 10:47 PM
The only way to do it that I know of is to use two computers. Have one turn the other on by accessing it like a peripheral.

I still think it would be awesome if someone who knows java would make a periph for CC that did this. You apply redstone signal to it and it toggles the computer from either off to on or on to off.
MrR0ket0 #7
Posted 31 July 2012 - 12:00 AM
The only way to do it that I know of is to use two computers. Have one turn the other on by accessing it like a peripheral.

I still think it would be awesome if someone who knows java would make a periph for CC that did this. You apply redstone signal to it and it toggles the computer from either off to on or on to off.

can you give an code example for that? would be awesome id rather go with two computers instead of monitoring my comp if it shuts down again
Lyqyd #8
Posted 31 July 2012 - 01:11 AM
It sounds like you're asking for something, but actually want something else. Have you tried adding the welcome program to the startup?
Luanub #9
Posted 01 August 2012 - 03:33 AM
Doing it with another computer only takes a couple lines of code, very easy.


local computer = peripheral.wrap( "top" )  -- change to side computer is on that you want to control
computer.turnOn() -- use the var computer from the above line

Other commands available when you use a computer as a peripheral are.

computer.shutdown()
computer.reboot()
computer.getid()

This will also work with Turtles. Hope this helps.

:ph34r:/>/> 500th post woot!!
Edited on 01 August 2012 - 02:04 AM
Cloudy #10
Posted 01 August 2012 - 08:47 AM
Why don't you just have the computer not doing anything until it gets a rednet signal? Why is it so important that it is fully off?
Kolpa #11
Posted 01 August 2012 - 09:59 AM
Maybe this would work?

if not rs.getInput("side") then
os.shutdown()
end
I think that would work, if you put that in a startup file, it would require power, i.e. you to be stepping on a pressure plate to turn on.
I'm testing now.

EDIT: That won't work. I am clueless.
you probably could use os.reboot() that should work as startup file
Lyqyd #12
Posted 01 August 2012 - 03:43 PM
Guys, read the last part of the original post again. He just wants the program to run automatically on startup.