Advertisement
FNCxPro

TurtleBox 1.4

May 30th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. --[[
  2.  
  3. *
  4. * TurtleBox V1.4
  5. * Changes
  6. * + Bypassing blocked turtle methods :D
  7. *
  8. * Made by Relative
  9. * Credits to /u/BOOMBOOMTHEHACKER(BoomBoomLHack in MC) for the turtleapi
  10. *
  11.  
  12. ]]--
  13.  
  14. os.pullEvent = os.pullEventRaw
  15. local p = peripheral.wrap("right")
  16. local version = "1.4"
  17. p.setLabel("TurtleBox")
  18. p.say("Loaded version "..version)
  19. local function parse(cmd,name)
  20. if cmd == "forward" then
  21. turtle.forward()
  22. elseif cmd == "back" then
  23. turtle.back()
  24. elseif cmd == "right" then
  25. turtle.turnRight()
  26. elseif cmd == "left" then
  27. turtle.turnLeft()
  28. elseif cmd == "up" then
  29. turtle.up()
  30. elseif cmd == "down" then
  31. turtle.down()
  32. elseif cmd:sub(1,6) == "select" then
  33. local sel = tonumber(cmd:sub(8))
  34. if sel > 16 or sel < 1 then
  35. p.say("Invalid select item entered, "..name)
  36. return
  37. end
  38. turtle.select(sel)
  39. elseif cmd == "refuel" then
  40. for i = 1, 16 do
  41. ta.select(i)
  42. if turtle.refuel(0) then
  43. ta.refuel()
  44. end
  45. end
  46. turtle.select(1)
  47. p.say("New fuel level: "..turtle.getFuelLevel())
  48. elseif cmd == "fuel" then
  49. p.say("Fuel level: "..turtle.getFuelLevel())
  50. elseif cmd == "flimit" then
  51. p.say("Fuel limit: "..turtle.getFuelLimit())
  52. elseif cmd == "digUp" then
  53. turtle.digUp()
  54. elseif cmd == "digDown" then
  55. turtle.digDown()
  56. elseif cmd == "dig" then
  57. turtle.dig()
  58. elseif cmd == "place" then
  59. turtle.place()
  60. elseif cmd == "placeUp" then
  61. turtle.placeUp()
  62. elseif cmd == "placeDown" then
  63. turtle.placeDown()
  64. else
  65. p.say("Invalid command, "..name)
  66. end
  67. end
  68. while true do
  69. local event = {os.pullEvent()}
  70. if event[1] == "chatbox_command" then
  71. if event[3] == "Relative" then
  72. local cmd = event[4]
  73. parse(cmd,event[3])
  74. else
  75. p.say(event[3]..", you are not allowed to use Turtlebox")
  76. end
  77. end
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement