Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Das ist die automatische Kuhfarm von TheBommel")
- print("----------------------------------------------")
- print("Was soll gesteuert werden?")
- print("1: Bodenplatte oeffnen oder schliessen")
- print("2: Feed-Station ein- oder ausschalten")
- print("Bitte waehle zwischen 1 und 2")
- oc = read()
- if oc == "1" then
- term.clear()
- term.setCursorPos(1,1)
- print("Bodenplatte ein- oder ausfahren?")
- print("Einfahren = 1")
- print("Ausfahren = 2")
- print("Ausfahren und danach")
- print("wieder automatisch einfahren = 3")
- signal = read()
- if signal == "1" then
- rednet.send(177, "ein")
- print("Wurde ausgeführt!")
- local id,msg,dist = rednet.receive()
- if msg == "fertig" then
- print("fertig")
- end
- elseif signal == "2" then
- rednet.send(177, "aus")
- local id,msg,dist = rednet.receive()
- if msg == "fertig" then
- print("fertig")
- end
- print("Wurde ausgeführt!")
- elseif signal == "3" then
- rednet.send(177, "auto")
- print("Wurde ausgeführt!")
- local id,msg,dist = rednet.receive()
- if msg == "fertig" then
- print("fertig")
- end
- else
- print("Falsche Eingabe!")
- end
- elseif oc == "2" then
- term.clear()
- term.setCursorPos(1,1)
- print("Feed-Station ein- oder ausschalten?")
- print("Einschalten = 1")
- print("Ausschalten = 2")
- signal = read()
- if signal == "1" then
- rednet.send(176, "ein")
- print("Wurde ausgeführt!")
- local id,msg,dist = rednet.receive()
- if msg == "fertig" then
- print("fertig")
- end
- elseif signal == "2" then
- rednet.send(176, "aus")
- print("Wurde ausgeführt!")
- local id,msg,dist = rednet.receive()
- if msg == "fertig" then
- print("fertig")
- end
- else
- print("Falsche Eingabe!")
- end
- else
- print("Falsche Eingabe!")
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement