asteroidsteam icon

acd

asteroidsteam | PRO | 04/05/18 11:19:36 PM UTC | 0 ⭐ | 314 👁️ | Never ⏰ | []
text |

1.29 KB

|

None

|

0 👍

/

0 👎

rednet.open("top")
local instruct = [[
Commands:
oil-on: Turns On Oil
oil-off: Turns Off Oil
water-on: Turns On Water
water-off: Turns Off water
all-on: Turns All on
all-off: Turns All Off
]]
print(instruct)
while true do
    local inp = read()
    if inp == "oil-on" then
        rednet.broadcast("oil")
		os.sleep(1)
        rednet.broadcast("1")
        print("Oil On.")
    elseif inp == "oil-off" then
        rednet.broadcast("oil")
		os.sleep(1)
        rednet.broadcast("2")
        print("Oil Off.")
    elseif inp == "water-on" then
        rednet.broadcast("water")
		os.sleep(1)
        rednet.broadcast("1")
        print("Water On.")
    elseif inp == "water-off" then
        rednet.broadcast("water")
		os.sleep(1)
        rednet.broadcast("2")
        print("Water Off.")
    elseif inp == "all-on" then
        rednet.broadcast("water")
		os.sleep(1)
        rednet.broadcast("1")
        rednet.broadcast("oil")
		os.sleep(1)
        rednet.broadcast("1")
        print("All On.")
    elseif inp == "all-off" then
        rednet.broadcast("water")
		os.sleep(1)
        rednet.broadcast("2")
        rednet.broadcast("oil")
		os.sleep(1)
        rednet.broadcast("2")
        print("All Off.")
    else
        print("Error: Unknown Command!")
    end
end

Comments