Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Settings --
- bgcolor = 16384 -- Backgroundcolor Default = 16384 (red)
- textcolor = 32768 -- Textcolor Default = 32768 (Black)
- mside = "top" -- Side of modem.
- turtleid = 89 -- Id of your controlled turtle
- version = "[1.1]"
- sleep = 3
- -- End of settings --
- rednet.open(mside)
- function selectinventory()
- term.clear()
- term.setCursorPos(1,1)
- write("Please input a number from 1-16 (Input 17 to go back): ")
- local input = read()
- if input == "1" then
- rednet.send(turtleid, "1")
- elseif input == "2" then
- rednet.send(turtleid, "2")
- elseif input == "3" then
- rednet.send(turtleid, "3")
- elseif input == "4" then
- rednet.send(turtleid, "4")
- elseif input == "5" then
- rednet.send(turtleid, "5")
- elseif input == "6" then
- rednet.send(turtleid, "6")
- elseif input == "7" then
- rednet.send(turtleid, "7")
- elseif input == "8" then
- rednet.send(turtleid, "8")
- elseif input == "9" then
- rednet.send(turtleid, "9")
- elseif input == "10" then
- rednet.send(turtleid, "10")
- elseif input == "11" then
- rednet.send(turtleid, "11")
- elseif input == "12" then
- rednet.send(turtleid, "12")
- elseif input == "13" then
- rednet.send(turtleid, "13")
- elseif input == "14" then
- rednet.send(turtleid, "14")
- elseif input == "15" then
- rednet.send(turtleid, "15")
- elseif input == "16" then
- rednet.send(turtleid, "16")
- elseif input == "17" then
- start2()
- end
- end
- function o()
- os.reboot()
- end
- function start()
- term.clear()
- term.setTextColor(textcolor)
- term.setBackgroundColor(bgcolor)
- term.setCursorPos(1,1)
- term.setBackgroundColor(bgcolor)
- print("Running Mackan90096's Turtle Controlling program version (version)")
- term.clear()
- term.setCursorPos(5,5)
- print("[1] Start")
- term.setCursorPos(5,6)
- print("[2] Whats new in this version")
- term.setCursorPos(5,7)
- print("[3] Exit the program")
- local input = read()
- if input == "1" then
- start2()
- elseif input == "2" then
- whatsnew()
- elseif input == "3" then
- term.clear()
- end
- end
- function whatsnew()
- term.clear()
- term.setCursorPos(1,1)
- print("Whats new:")
- term.setCursorPos(1,2)
- print("[Version 1.1]")
- term.setCursorPos(1,3)
- print("Added Whats New function")
- term.setCursorPos(1,4)
- print("Added block placement and suck functionallity")
- term.setCursorPos(1,5)
- print("Added refuelng function")
- term.setCursorPos(1,6)
- print("Added slot selection tool")
- term.setCursorPos(1,8)
- write("To exit type y and press enter: ")
- local input = read()
- if input == "y" then
- term.clear()
- end
- end
- function movement()
- term.clear()
- sleep(1)
- term.setCursorPos(1,1)
- print("[1] Make turtle go forward")
- term.setCursorPos(1,2)
- print("[2] Make turtle go backwards")
- term.setCursorPos(1,3)
- print("[3] Make turtle turn left")
- term.setCursorPos(1,4)
- print("[4] Make turtle turn right")
- term.setCursorPos(1,5)
- print("[5] Make turtle go up")
- term.setCursorPos(1,6)
- print("[6] Make turtle go down")
- term.setCursorPos(1,7)
- print("[7] Make turtle dig")
- term.setCursorPos(1,8)
- print("[8] Place a block")
- ter.setCursorPos(1,9)
- print("[9] Exit")
- write("Input number please: ")
- local input = read()
- if input == "1" then
- rednet.send(turtleid, "forward")
- movement()
- elseif input == "2" then
- rednet.send(turtleid, "backwards")
- movement()
- elseif input == "3" then
- rednet.send(turtleid, "left")
- movement()
- elseif input == "4" then
- rednet.send(turtleid, "right")
- movement()
- elseif input == "5" then
- rednet.send(turtleid, "up")
- movement()
- elseif input == "6" then
- rednet.send(turtleid, "down")
- movement()
- elseif input == "7" then
- rednet.send(turtleid, "dig")
- movement()
- elseif input == "8" then
- rednet.send(turtleid, "place")
- movement()
- elseif input == "9" then
- term.clear()
- start2()
- end
- end
- function start2()
- term.setCursorPos(1,1)
- print("[1] Movement")
- term.setCursorPos(1,2)
- print("[2] Fuel")
- term.setCursorPos(1,3)
- print("[3] Inventory seletion")
- term.setCursorPos(1,4)
- write("Input a number: ")
- local input = read()
- if input == "1" then
- term.clear()
- movement()
- elseif input == "2" then
- term.clear()
- fuel()
- elseif input == "3" then
- term.clear()
- selecinventory()
- end
- end
- function fuel()
- term.clear()
- term.setCursorPos(1,1)
- print("[1] Refuel all")
- term.setCursorPos(1,2)
- print("[2] Get Fuel Level")
- term.setCursorPos(1,3)
- print("[3] Exit")
- term.setCursorPos(1,4)
- write("Please input a number: ")
- local input = read()
- if input == "1" then
- rednet.send(turtleid, "refuel")
- elseif input == "2" then
- rednet.send(turtleid, "fuellevel")
- while true do
- event, id, text = os.pullEvent()
- sleep(2)
- print(text)
- sleep(sleep)
- fuel()
- end
- elseif input == "3" then
- start2()
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement