r/ComputerCraft • u/Chemical-Base6374 • Apr 25 '25
help - setting up a control centre to control redstone out and inputs
Hello,
i dont know how to do it properly, so i thought i might just ask here.
The idea is to create a "control center" from which i can turn redstone signals on and off to start or stop my Create-Farms. The redstone links from the create pack lose their connection to quick and i like the idea of having a control center with a computer etc.
Maybe some of you know how to do that because i dont know how to fix the following problems:
To have the other pcs on the farms run the "listen" command on startup so that i dont have to switch them on.
And, since the redstone signal have to be turned "on" to stop the farm, set that as the default value.
I am very thankful for any type of response :)
1
u/Chemical-Base6374 Apr 27 '25
So i wrote the following startup:
local farmStat
local function ironOff()
rs.setOutput("bottom", true)
farmStat = false
end
local function ironOn()
rs.setOutput("bottom", false)
farmStat = true
end
ironOff()
while true do
read()
if farmStat == true and read() == "iron on" then
print("still running")
elseif farmStat == false and read() == "iron on" then
ironOn()
print("iron online")
elseif farmStat == true and read() == "iron off" then
ironOff()
print("iron offline")
elseif farmStat == false and read() == "iron off" then
print("still offline")
end
end
But sometimes i have to type the command like "iron on" into the computer like 3 times and i dont know why. And i also dont know how to set up the code to have it listen to a rednet message :(
Does anyone know what i am doing wrong?
1
u/BurningCole Apr 26 '25
If you have a file named startup in base folder then it will automatically run, you can add your listen command as well as set the redstone outputs in the file.
1
u/fatboychummy Apr 26 '25
startup.lua--> Computers will automatically check for a file with this name, and run it upon startup. It must be in the root directory though (i.e:/startup.lua, not/folder/startup.lua).Just initially the redstone output on.
If you need what the current state of the farm is, you can just keep another variable with
trueorfalsein it.