Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- notclicked = true
- side = "top"
- rednet.open(side)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1,1)
- term.clear()
- term.setTextColor(colors.blue)
- print("Welcome to turtle control!")
- term.setTextColor(colors.lime)
- paintutils.drawFilledBox(2,2,16,5,colors.yellow)
- paintutils.drawFilledBox(19,2,32,5,colors.yellow)
- paintutils.drawFilledBox(2,7,16,10,colors.yellow)
- paintutils.drawFilledBox(19,7,32,10,colors.yellow)
- paintutils.drawFilledBox(2,12,16,15,colors.yellow)
- paintutils.drawFilledBox(19,12,32,15,colors.yellow)
- term.setCursorPos(6,3)
- print("Forward")
- term.setCursorPos(21,3)
- print("Backwards")
- term.setCursorPos(6,8)
- print("Left")
- term.setCursorPos(21,8)
- print("Right")
- term.setCursorPos(6,13)
- print("Turn Left")
- term.setCursorPos(21,13)
- print("Turn Right")
- while notclicked do
- event,button,x,y = os.pullEvent("mouse_click")
- if x == 2 and y == 2 or x == 16 and y == 5 or x > 2 and x < 16 and y > 2 and y < 5 then
- rednet.open(side)
- rednet.broadcast("forward")
- rednet.close(side)
- elseif x == 19 and y == 2 or x == 32 and y == 5 or x > 19 and x < 32 and y > 2 and y < 5 then
- rednet.open(side)
- rednet.broadcast("backwards")
- rednet.close(side)
- elseif x == 2 and y == 7 or x == 16 and y == 10 or x > 2 and x < 16 and y > 7 and y < 10 then
- rednet.open(side)
- rednet.broadcast("left")
- rednet.close(side)
- elseif x == 19 and y == 7 or x == 32 and y == 10 or x > 19 and x < 32 and y > 7 and y < 10 then
- rednet.open(side)
- rednet.broadcast("right")
- rednet.close(side)
- elseif x == 2 and y == 12 or x == 16 and y == 17 or x > 2 and x < 16 and y > 12 and y < 17 then
- rednet.open(side)
- rednet.broadcast("turnleft")
- rednet.close()
- elseif x == 19 and y == 12 or x == 32 and y == 17 or x > 19 and x < 32 and y > 12 and y < 17 then
- rednet.open(side)
- rednet.broadcast("turnright")
- rednet.close()
- end
- end
- end
Add Comment
Please, Sign In to add comment