Advertisement
Guest User

r.lua

a guest
Aug 5th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. local robot=require("robot")
  2. local c=require("component")
  3. local craft=c.crafting
  4. local rs=c.redstone
  5. inv.select(1)
  6. if(inv.getStackInInternalSlot(2).name~="minecraft:blockRedstone" or inv.getStackInInternalSlot(2).name~="minecraft:blockLapis")then
  7. print("Пожалуйста, вставьте во второй слот блоки красной пыли или лазурита(в зависимости от ващих конденсаторов")
  8. end
  9. local inv=c.inventory_controller
  10. local function repairItem(slot)
  11. inv.suckFromSlot(0,j)
  12. craft.craft()
  13. inv.dropIntoSlot(0,j)
  14. end
  15. local slots={
  16.  
  17. }
  18. local i=true
  19. while i do
  20. for j=1,#slots do
  21. local item=inv.getStackInSlot(0,j)
  22. if(item.damage/item.maxDamage>0.1)then
  23. repairItem(j)
  24. end
  25. end
  26. and
  27. rs.setOutput(3,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement