Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url = "http://yourwebsite.com/php/scripts"
- while true do
- data = http.get(url .. "data.txt").readAll()
- file = fs.open("data", "w")
- file.write(data)
- file.close()
- file = fs.open("data", "r")
- position = file.readLine()
- button = file.readLine()
- file.close()
- term.clear()
- term.setCursorPos(1,1)
- if (position == "down") then
- if (button == "3") then
- print("Moving Forward")
- turtle.forward()
- end
- if (button == "0") then
- print("A Pressed")
- end
- if (button == "1") then
- print("Turning Right")
- turtle.turnRight()
- sleep(0.5)
- end
- if (button == "2") then
- print("Moving Left")
- turtle.turnLeft()
- sleep(0.5)
- end
- if (button == "4") then
- print("Moving Down")
- turtle.down()
- end
- if (button == "5") then
- print("Moving Up")
- turtle.up()
- end
- if (button == "6") then
- print("Destroying Block")
- turtle.dig()
- end
- if (button == "7") then
- print("Placing Block")
- turtle.place(1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment