Advertisement
moo3oo3oo3

Auto Repair

Feb 17th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local chest = peripheral.wrap("front")
  2. local stack, file
  3. local slot = 1
  4.  
  5.  
  6. while true do
  7.   file = fs.open("repairQueue", "r")
  8.  
  9.   stack = chest.getStackInSlot(slot)
  10.   if stack.max_dmg and stack.dmg > 0 then
  11.     file = fs.open("repairQueue", "a")  
  12.     chest.pushItem("north", slot, stack.qty, slot)
  13.     file.writeLine(stack.dmg..tostring(stack))
  14.     file.close()
  15.   end
  16.   sleep()
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement