Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- term.clear()
- term.setCursorPos(1, 1)
- version = 1.2
- function startupClear()
- f = fs.open("startup", "w")
- f.write("shell.run('pastebin run ASa2uiTC')")
- f.close()
- end
- local function readCommand()
- local command = read()
- return command
- end
- function autoMode()
- sender, message = rednet.receive()
- if message == "running" then
- term.setTextColor(colors.red)
- print("UberMiner : AutoMode, is already running somewhere else")
- else if message == true then
- term.setTextColor(colors.lime)
- print("UberMiner : AutoMode, now online!")
- else
- term.setTextColor(colors.red)
- print("UberMiner : AutoMode, now offline.")
- end
- end
- sleep(2)
- end
- local function processCommand(command)
- if command:lower() == "/help" then
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.red)
- print("List o' Commands:")
- term.setTextColor(colors.cyan)
- print("/wither | /w -- Spawns and Kills a Wither!")
- print("/autoMode | /am -- Puts UberMiner on/off AutoMode")
- print("/forward | /f -- UberMiner Forward!")
- print("/reboot | /r -- Reboot the computer to refresh the program")
- print("/help -- List o' Commands (Obviously)")
- term.setTextColor(colors.red)
- print("Press any key to return to prompt")
- os.pullEvent("key")
- else if command:lower() == "/reboot" or command:lower() == "/r" then
- term.setTextColor(colors.blue)
- print("Rebooting...")
- sleep(0.2)
- os.reboot()
- else if command:lower() == "/wither" or command:lower() == "/w" then
- rednet.broadcast("wither")
- term.setTextColor(colors.cyan)
- print("Wither Command executed")
- sleep(2)
- else if command:lower() == "/autoMode" or command:lower() == "/am" then
- rednet.broadcast("autoMode")
- term.setTextColor(colors.cyan)
- autoMode()
- print("Auto Command executed")
- else if command:lower() == "/forward" or command:lower() == "/f" then
- rednet.broadcast("forward")
- term.setTextColor(colors.cyan)
- print("Forward Command executed")
- sleep(2)
- else
- rednet.broadcast(command)
- term.setTextColor(colors.red)
- print("Invalid command.")
- sleep(.2)
- os.reboot()
- end
- end
- end
- end
- end
- end
- startupClear()
- function commandReceiver()
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.red)
- print("Command: (ex: /help) v"..version)
- write("> ")
- local command = readCommand()
- processCommand(command)
- end
- while true do
- commandReceiver()
- end
Advertisement
Add Comment
Please, Sign In to add comment