Guest User

Untitled

a guest
Oct 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1. local last=4
  2. shell.run("clear")
  3. print([["Welcome to Crafty..
  4. Use qwe,asd,xcv for crafting grid.
  5. 1..6 for inventory slots.
  6. Space to craft, k to abort."]])
  7.  
  8. turtle.select(4)
  9. turtle.suck()
  10. turtle.select(8)
  11. turtle.suck()
  12. turtle.select(12)
  13. turtle.suck()
  14. for i=16,13,-1 do
  15. turtle.select(i)
  16. turtle.suck()
  17. end
  18. while true do
  19.  
  20. function slot(a)
  21. turtle.select(a)
  22. last=a
  23. end
  24.  
  25. function cg(a)
  26. turtle.select(a)
  27. turtle.drop()
  28. turtle.select(13)
  29. turtle.suck()
  30. turtle.select(last)
  31. turtle.drop()
  32. turtle.select(a)
  33. turtle.suck()
  34. c=turtle.getItemCount(a)
  35. turtle.drop(c-1)
  36. turtle.select(last)
  37. turtle.suck()
  38. end
  39.  
  40. event, key=os.pullEvent()
  41. if     key=="1" then
  42. slot(4)
  43. elseif key=="2" then
  44. slot(8)
  45. elseif key=="3" then
  46. slot(12)
  47. elseif key=="4" then
  48. slot(16)
  49. elseif key=="5" then
  50. slot(15)
  51. elseif key=="6" then
  52. slot(14)
  53. elseif key=="q" then
  54. cg(1)
  55. elseif key=="w" then
  56. cg(2)
  57. elseif key=="e" then
  58. cg(3)
  59. elseif key=="a" then
  60. cg(5)
  61. elseif key=="s" then
  62. cg(6)
  63. elseif key=="d" then
  64. cg(7)
  65. elseif key=="x" then
  66. cg(9)
  67. elseif key=="c" then
  68. cg(10)
  69. elseif key=="v" then
  70. cg(11)
  71. elseif key==" " then
  72. turtle.select(4)
  73. turtle.drop()
  74. turtle.select(8)
  75. turtle.drop()
  76. turtle.select(12)
  77. turtle.drop()
  78. for i=16,13,-1 do
  79. turtle.select(i)
  80. turtle.drop()
  81. end
  82. turtle.select(16)
  83. turtle.craft()
  84. return
  85.  
  86. elseif key=="k" then
  87. return
  88.  
  89.  
  90. end end
Add Comment
Please, Sign In to add comment