Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  1.  
  2. Turtle (API)
  3. The Turtle API is used to work with your Turtles.
  4.  
  5. Key
  6. Color Turtles that can perform this
  7. White All
  8. Green Crafty
  9. Yellow Mining, Felling, Digging, Farming
  10. Red Any tool
  11. API
  12. Return Method name Description Min version
  13. boolean success turtle.craft(number quantity) Craft items using ingredients anywhere in the turtle's inventory and place results in the active slot. If a quantity is specified, it will craft only up to that many items, otherwise, it will craft as many of the items as possible. 1.4
  14. boolean success turtle.forward() Try to move the turtle forward ?
  15. boolean success turtle.back() Try to move the turtle backward ?
  16. boolean success turtle.up() Try to move the turtle up ?
  17. boolean success turtle.down() Try to move the turtle down ?
  18. boolean success turtle.turnLeft() Turn the turtle left ?
  19. boolean success turtle.turnRight() Turn the turtle right ?
  20. boolean success turtle.select(number slotNum) Make the turtle select slot slotNum (1 is top left, 16 (9 in 1.33 and earlier) is bottom right) ?
  21. number slot turtle.getSelectedSlot() Indicates the currently selected inventory slot 1.6
  22. number count turtle.getItemCount([number slotNum]) Counts how many items are in the currently selected slot or, if specified, slotNum slot ?
  23. number count turtle.getItemSpace([number slotNum]) Counts how many remaining items you need to fill the stack in the currently selected slot or, if specified, slotNum slot ?
  24. table data turtle.getItemDetail([number slotNum]) Returns the ID string, count and damage values of currently selected slot or, if specified, slotNum slot 1.64
  25. boolean success turtle.equipLeft() Attempts to equip an item in the current slot to the turtle's left side, switching the previously equipped item back into the inventory 1.6
  26. boolean success turtle.equipRight() Attempts to equip an item in the current slot to the turtle's right side, switching the previously equipped item back into the inventory 1.6
  27. boolean success turtle.attack() Attacks in front of the turtle. 1.4
  28. boolean success turtle.attackUp() Attacks above the turtle. 1.4
  29. boolean success turtle.attackDown() Attacks under the turtle. 1.4
  30. boolean success turtle.dig() Breaks the block in front. With hoe: tills the dirt in front of it. ?
  31. boolean success turtle.digUp() Breaks the block above. ?
  32. boolean success turtle.digDown() Breaks the block below. With hoe: tills the dirt beneath the space below it. ?
  33. boolean success turtle.place([string signText]) Places a block of the selected slot in front. Engrave signText on signs if provided. Collects water or lava if the currently selected slot is an empty bucket. 1.4
  34. boolean success turtle.placeUp() Places a block of the selected slot above. Collects water or lava if the currently selected slot is an empty bucket. ?
  35. boolean success turtle.placeDown() Places a block of the selected slot below. Collects water or lava if the currently selected slot is an empty bucket. ?
  36. boolean result turtle.detect() Detects if there is a block in front. Does not detect mobs. ?
  37. boolean result turtle.detectUp() Detects if there is a block above ?
  38. boolean result turtle.detectDown() Detects if there is a block below ?
  39. boolean success, table data/string error message turtle.inspect() Returns the ID string and metadata of the block in front of the Turtle 1.64
  40. boolean success, table data/string error message turtle.inspectUp() Returns the ID string and metadata of the block above the Turtle 1.64
  41. boolean success, table data/string error message turtle.inspectDown() Returns the ID string and metadata of the block below the Turtle 1.64
  42. boolean result turtle.compare() Detects if the block in front is the same as the one in the currently selected slot 1.31
  43. boolean result turtle.compareUp() Detects if the block above is the same as the one in the currently selected slot ?
  44. boolean result turtle.compareDown() Detects if the block below is the same as the one in the currently selected slot ?
  45. boolean result turtle.compareTo(number slot) Compare the current selected slot and the given slot to see if the items are the same. Returns true if they are the same, false if not. 1.4
  46. boolean success turtle.drop([number count]) Drops all items in the selected slot, or specified, drops count items.
  47. [>= 1.4 only:] If there is a inventory on the side (i.e in front of the turtle) it will try to place into the inventory, returning false if the inventory is full. ?
  48. boolean success turtle.dropUp([number count]) Drops all items in the selected slot, or specified, drops count items.
  49. [>= 1.4 only:] If there is a inventory on the side (i.e above the turtle) it will try to place into the inventory, returning false if the inventory is full. 1.4
  50. boolean success turtle.dropDown([number count]) Drops all items in the selected slot, or specified, drops count items.
  51. [>= 1.4 only:] If there is a inventory on the side (i.e below the turtle) it will try to place into the inventory, returning false if the inventory is full. If above a furnace, will place item in the top slot. 1.4
  52. boolean success turtle.suck([number amount]) Picks up an item stack of any number, from the ground or an inventory in front of the turtle, then places it in the selected slot. If the turtle can't pick up the item, the function returns false. amount parameter requires ComputerCraft 1.6 or later. 1.4
  53. boolean success turtle.suckUp([number amount]) Picks up an item stack of any number, from the ground or an inventory above the turtle, then places it in the selected slot. If the turtle can't pick up the item, the function returns false. amount parameter requires ComputerCraft 1.6 or later. 1.4
  54. boolean success turtle.suckDown([number amount]) Picks up an item stack of any number, from the ground or an inventory below the turtle, then places it in the selected slot. If the turtle can't pick up the item, the function returns false. amount parameter requires ComputerCraft 1.6 or later. 1.4
  55. boolean success turtle.refuel([number quantity]) If the current selected slot contains a fuel item, it will consume it to give the turtle the ability to move.
  56. Added in 1.4 and is only needed in needfuel mode. If the current slot doesn't contain a fuel item, it returns false. Fuel values for different items can be found at Turtle.refuel#Fuel_Values. If a quantity is specified, it will refuel only up to that many items, otherwise, it will consume all the items in the slot. 1.4
  57. number fuel turtle.getFuelLevel() Returns the current fuel level of the turtle, this is the number of blocks the turtle can move.
  58. If turtleNeedFuel = 0 then it returns "unlimited". 1.4
  59. number fuel turtle.getFuelLimit() Returns the maximum amount of fuel a turtle can store - by default, 20,000 for regular turtles, 100,000 for advanced.
  60. If turtleNeedFuel = 0 then it returns "unlimited". 1.6
  61. boolean success turtle.transferTo(number slot [, number quantity]) Transfers quantity items from the selected slot to slot. If quantity isn't specified, will attempt to transfer everything in the selected slot to slot. 1.45
  62. Category: APIs
  63. Navigation menu
  64. Log inPageDiscussionReadView sourceView history
  65.  
  66. Search
  67. Go
  68. Main page
  69. Recent changes
  70. Random page
  71. Links
  72. Main Site
  73. Forums
  74. Tools
  75. What links here
  76. Related changes
  77. Special pages
  78. Printable version
  79. Permanent link
  80. Page information
  81. This page was last modified on 9 June 2016, at 11:37.
  82. This page has been accessed 1,134,264 times.
  83. Privacy policyAbout ComputerCraft WikiDisclaimersPowered by MediaWiki
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement