Advertisement
ChicagoFire3

GenUtil

Jun 8th, 2025 (edited)
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | Gaming | 0 0
  1. function ReFuel(Silent)
  2.   if not Silent then
  3.     print('Refueling...')
  4.   end
  5.   local SavedSlot = turtle.getSelectedSlot()
  6.   turtle.select(1)
  7.   local ItemCount = turtle.getItemCount()
  8.   turtle.refuel(ItemCount-1)
  9.   if not Silent then
  10.     local FuelCount = turtle.getFuelLevel()
  11.     local NewItemCount = turtle.getItemCount()
  12.     print('New FuelCount: ', tostring(FuelCount))
  13.     print('Items consumed: ', tostring(ItemCount - NewItemCount))
  14.   end
  15.   turtle.select(SavedSlot)
  16. end
  17.  
  18. function EmptyForward(SkipSlotCount)
  19.   print('Emptying inventory besides: ', tostring(SkipSlotCount))
  20.   local SavedSlot = turtle.getSelectedSlot()
  21.   local i = SkipSlotCount+1
  22.  
  23.   while i < 17 do
  24.     turtle.select(i)
  25.     turtle.drop()
  26.     i = i+1
  27.   end
  28.   turtle.select(SavedSlot)
  29. end
  30.  
  31. function EmptyUp(SkipSlotCount)
  32.   print('Emptying inventory besides: ', tostring(SkipSlotCount))
  33.   local SavedSlot = turtle.getSelectedSlot()
  34.   local i = SkipSlotCount+1
  35.  
  36.   while i < 17 do
  37.     turtle.select(i)
  38.     turtle.dropUp()
  39.     i = i+1
  40.   end
  41.   turtle.select(SavedSlot)
  42. end
  43.  
  44. function EmptySlot(Slot)
  45.   --print('Emptying slot: ', tostring(Slot))
  46.   local SavedSlot = turtle.GetSelectedSlot()
  47.   turtle.select(Slot)
  48.   turtle.drop()
  49.   turtle.select(SavedSlot)
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement