Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Control_Interface:14
- Control_RedstoneServer:15
- Control_RedstoneClient1:24
- Control_Bee:25
- --]]
- local WLAN = "top"
- local coloroff = colors.red;
- local coloron = colors.green;
- local commands = {} --
- commands["boringmachine"] = true -- has to be always true!
- --table.insert(orders,"exctractor",true)
- function send (c,s)
- rednet.send(15,c.." "..s)
- end
- function init ()
- term.clear()
- if rednet.isOpen(WLAN) == false then
- rednet.open(WLAN)
- end
- end
- function menu () -- TODO: lots of writes and formating
- print("_________________________")
- print("Commands: command")
- for i,v in pairs(commands) do
- print(i.." on/off")
- end
- end
- init()
- local answer,command, status
- repeat
- menu()
- print("_________________________")
- print("Enter command.")
- io.flush()
- answer=io.read() -- or pullevent
- -- check answer
- answer = string.lower(answer)
- command, status = string.find(answer," ") -- found positions
- if found ~= nil then
- command = string.sub(answer, 1, command) -- found command
- status = string.sub(answer, status) -- found status
- if command[found] ~= nil then
- send(command,status)
- end
- end
- until false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement