Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function showMenu(modem)
- term.clear()
- term.setCursorPos(1,1)
- local menuOptions = {
- "Oil Rig",
- "Crude Input",
- "Crude Output",
- "Crude Refine",
- "Light Oil Output",
- "Heavy Oil Output",
- "Bitumen Processing",
- "Light Oil Refine",
- "Heavy Oil Refine",
- "Fuel Output"
- }
- term.setCursorPos(4,1)
- print("Refinery Control")
- term.setCursorPos(4,2)
- print("-=-=-=-=-=-=-=-")
- term.setCursorPos(1,4)
- print("1. Oil Rig")
- print("2. Crude Input")
- print("3. Crude Output")
- print("4. Crude Refine")
- print("5. Light Oil Output")
- print("6. Heavy Oil Output")
- print("7. Bitumen Processing")
- print("8. Light Oil Refine")
- print("9. Heavy Oil Refine")
- print("10. Fuel Output")
- local choice = nil
- repeat
- term.write("Enter your choice (1-10): ")
- choice = tonumber(read())
- until choice and choice >= 1 and choice <= 10
- term.clear()
- term.setCursorPos(1,1)
- term.write("Enter On or Off for "..menuOptions[choice]..": ")
- local onOff = read()
- local channel = nil
- if choice == 1 then
- channel = 23
- end
- if choice >= 2 and choice <= 5 then
- channel = 26
- elseif choice >= 6 and choice <= 10 then
- channel = 27
- end
- if channel then
- modem.transmit(channel, choice, onOff)
- end
- return onOff
- end
- local modem = peripheral.find("modem")
- local onOffValues = {}
- while rs.getInput("front") == false
- do
- showMenu(modem)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement