Advertisement
SergOmarov

reactorControll.lua

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