Advertisement
MigasRocha

Untitled

Dec 18th, 2023
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. while true do
  2.  
  3. local tArgs = { ... }
  4. local function printUsage()
  5. print( "Usage: unequip <side>" )
  6. end
  7.  
  8. if #tArgs ~= 1 then
  9. printUsage()
  10. return
  11. end
  12.  
  13. local function unequip( fnEquipFunction )
  14. for nSlot=1,16 do
  15. local nOldCount = turtle.getItemCount( nSlot )
  16. if nOldCount == 0 then
  17. turtle.select( nSlot )
  18. if fnEquipFunction() then
  19. local nNewCount = turtle.getItemCount( nSlot )
  20. if nNewCount > 0 then
  21. print( "Item unequipped" )
  22. return
  23. else
  24. print( "Nothing to unequip" )
  25. return
  26. end
  27. end
  28. end
  29. end
  30. print( "No space to unequip item" )
  31. end
  32.  
  33. local sSide = tArgs[1]
  34. if sSide == "left" then
  35. unequip( turtle.equipLeft )
  36. elseif sSide == "right" then
  37. unequip( turtle.equipRight )
  38. else
  39. printUsage()
  40. return
  41. end
  42.  
  43.  
  44. turtle.select(1) --turtle slot--
  45.  
  46. turtle.place()
  47.  
  48. --------------------
  49.  
  50. turtle.select(2) --turtle Fuel--
  51.  
  52. turtle.drop()
  53.  
  54. --------------------
  55.  
  56. sleep(15)
  57.  
  58. --------------------
  59.  
  60. turtle.up()
  61. turtle.select(3) -- EnderChest Items--
  62. turtle.placeDown()
  63. turtle.up()
  64. turtle.select(4) -- mekanism pipe--
  65. turtle.placeDown()
  66. turtle.up()
  67. turtle.select(5) -- chest --
  68. turtle.placeDown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement