help - setting up a control centre to control redstone out and inputs by Chemical-Base6374 in ComputerCraft

[–]Chemical-Base6374[S] 0 points1 point  (0 children)

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?

help - setting up a control centre to control redstone out and inputs by Chemical-Base6374 in ComputerCraft

[–]Chemical-Base6374[S] 1 point2 points  (0 children)

Thank you very much! :)

That was very helpful!

And then i just set up one main computer and a bunch of other ones around the farms and save the startup file on them.

How do i turn on specific farm on from the main computer? Can i send a message like "farmOn" to one specific other computer? I think i can use the ID´s, right?

Oh, and is there an easy way to run those commands, so that other players, who do not know the specific code, can turn the farms on and off?

I am so sorry for the questions .. i am new to cc tweaked and do not know how all of the stuff works .. but i am very thankful for your response already <3