Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- local option = {"drain - Start draining", "amount - Amount smeltery", "clear - Clear screen"}
- while true do
- local uinput = nil
- print("What to do?")
- uinput = read()
- if uinput == "options" then
- print("Your current options are: ")
- for k,v in pairs(option) do
- print(v)
- end
- end
- if uinput == "clear" then
- term.clear()
- term.setCursorPos(1,1)
- end
- if uinput == "drain" then
- rednet.send(3,"drain")
- print("Start the draining!")
- local senderId, message = rednet.receive()
- if message == "starting" then
- while true do
- sleep(1)
- print("Waiting...")
- event, senderId, message = os.pullEvent("rednet_message")
- if message == "done" then
- print("Done with draining")
- sleep(2)
- break
- end
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- end
- if uinput == "amount" then
- info = { }
- print("Waiting for information")
- print("-----------------------")
- rednet.send(3,"amounts")
- local senderId, message = rednet.receive()
- info = textutils.unserialize(message)
- for i=1, #info do
- print(info[i])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement