Guest User

Untitled

a guest
Jul 12th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. url = "http://yourwebsite.com/php/scripts"
  2.  
  3. while true do
  4. data = http.get(url .. "data.txt").readAll()
  5. file = fs.open("data", "w")
  6. file.write(data)
  7. file.close()
  8.  
  9. file = fs.open("data", "r")
  10. position = file.readLine()
  11. button = file.readLine()
  12. file.close()
  13. term.clear()
  14. term.setCursorPos(1,1)
  15.  
  16. if (position == "down") then
  17. if (button == "3") then
  18. print("Moving Forward")
  19. turtle.forward()
  20. end
  21. if (button == "0") then
  22. print("A Pressed")
  23. end
  24. if (button == "1") then
  25. print("Turning Right")
  26. turtle.turnRight()
  27. sleep(0.5)
  28. end
  29. if (button == "2") then
  30. print("Moving Left")
  31. turtle.turnLeft()
  32. sleep(0.5)
  33. end
  34. if (button == "4") then
  35. print("Moving Down")
  36. turtle.down()
  37. end
  38. if (button == "5") then
  39. print("Moving Up")
  40. turtle.up()
  41. end
  42. if (button == "6") then
  43. print("Destroying Block")
  44. turtle.dig()
  45. end
  46. if (button == "7") then
  47. print("Placing Block")
  48. turtle.place(1)
  49. end
  50. end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment