Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function menu(id, text)
- if sid == id then
- print("["..text.."]")
- else
- print(" "..text)
- end
- end
- function RCmaster()
- sid = 0
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("TurtleControl V "..version..". Mode: Broadcast")
- menu(0, "Movement")
- menu(1, "Block Placing")
- menu(2, "Others")
- menu(3, "Exit")
- local sEvent, param = os.pullEvent("key")
- if(sEvent == "key") then
- if(param == 200) then
- if sid > 0 then
- sid = sid - 1
- elseif sid == 0 then
- sid = 3
- end
- elseif (param == 208) then
- if sid < 3 then
- sid = sid + 1
- elseif sid == 3 then
- sid = 0
- end
- elseif (param == 28) then
- if (sid == 0 and section == 0) then
- sid = 0
- term.clear()
- term.setCursorPos(1,1)
- print("Correct! Now use the arrow keys to select the forward option")
- sleep(5)
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("TurtleControl V "..version..". Mode: Broadcast")
- menu(0, "Forward")
- menu(1, "Backward")
- menu(2, "Turn Left")
- menu(3, "Turn Right")
- menu(4, "Up")
- menu(5, "Down")
- menu(6, "Attack")
- menu(7, "Mine")
- menu(8, "Return to main menu")
- local sEvent, param = os.pullEvent("key")
- if(sEvent == "key") then
- if(param == 200) then
- if sid > 0 then
- sid = sid - 1
- elseif sid == 0 then
- sid = 8
- end
- elseif (param == 208) then
- if sid < 8 then
- sid = sid + 1
- elseif sid == 8 then
- sid = 0
- end
- elseif (param == 28) then
- if (sid == 0 and section == 0) then
- term.clear()
- term.setCursorPos(1,1)
- rednet.broadcast("TS Forward")
- print("Right! Now go on and select the backward option")
- section = 1
- sleep(5)
- elseif (sid ~= 0 and section == 0) then
- term.clear()
- term.setCursorPos(1,1)
- print("I said forward!")
- sleep(4)
- elseif (sid == 1 and section == 1) then
- term.clear()
- term.setCursorPos(1,1)
- rednet.broadcast("TS Backward")
- print("You're learning fast! Now select the up option")
- section = 2
- sleep(5)
- elseif (sid ~= 1 and section == 1) then
- term.clear()
- term.setCursorPos(1,1)
- print("Backward you dummy!")
- sleep(4)
- elseif (sid == 4 and section == 2) then
- term.clear()
- term.setCursorPos(1,1)
- rednet.broadcast("TS Up")
- print("You got it! Go for the down option")
- section = 3
- sleep(5)
- elseif (sid ~= 4 and section == 2) then
- term.clear()
- term.setCursorPos(1,1)
- print("*Facepalm* You know what UP is right?")
- sleep(4)
- elseif (sid == 5 and section == 3) then
- term.clear()
- term.setCursorPos(1,1)
- rednet.broadcast("TS Down")
- print("You mastered it! One last test, choose the return to main menu option and then exit the tutorial")
- section = 4
- sleep(5)
- elseif (sid ~= 5 and section == 3) then
- term.clear()
- term.setCursorPos(1,1)
- print("....... I won't tell anything else")
- sleep(4)
- elseif (sid == 8 and section == 4) then
- RCmaster()
- elseif (sid ~= 8 and section == 4) then
- term.clear()
- term.setCursorPos(1,1)
- print("FAIL!")
- sleep(4)
- end
- end
- end
- end
- elseif (sid ~= 0 and section == 0) then
- term.clear()
- term.setCursorPos(1,1)
- print("I asked for the movement menu!")
- sleep(4)
- elseif (sid == 3 and section == 4) then
- term.clear()
- term.setCursorPos(1,1)
- print("Congrats! You're now an official turtle driver. You know the basics, now it's time to explore the real program and all it's power")
- sleep(12)
- term.clear()
- term.setCursorPos(1,1)
- print("Collect your medal in the forum post and place it in your forum signature!")
- sleep(8)
- shell.run("delete", "startup")
- os.reboot()
- elseif (sid ~= 3 and section == 4) then
- term.clear()
- term.setCursorPos(1,1)
- print("You were so close, derp!")
- sleep(4)
- end
- end
- end
- end
- end
- section=0
- version=1.0
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to the Turtle Remote V "..version.." tutorial, here you'll learn the basics to use the program. Make sure you have a turtle running the receiver program or you won't see how it moves. Now lets get started! NOTE: Some options have been disabled in this tutorial, explore them in the normal program")
- sleep(25)
- term.clear()
- term.setCursorPos(1,1)
- print("Ok! Your first task will be to head over to the movement menu. Use the arrow keys to change option and click enter to choose an option")
- sleep(10)
- RCmaster()
Advertisement
Add Comment
Please, Sign In to add comment