Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. --Charging Station Item Switch
  2.  
  3. --Assign Top Machine to peripheral p
  4. p = peripheral.wrap("top")
  5. --get energy stored in top peripheral item in Slot 1
  6. topEnergyStored = p.getStackInSlot(1).energy_te
  7. --get the bottom peripheral
  8. u = peripheral.wrap("bottom")
  9. while true do
  10. if (topEnergyStored <= 500000) then
  11. --pull and push is reversed because its the machine doing the action and not the turtle
  12. --So its the machine pushing and pulling not the turtle
  13. p.pushItem("down",1)
  14. turtle.select(2)
  15. u.pushItem("up",3)
  16. p.pullItem("down",2)
  17. turtle.select(1)
  18. u.pullItem("up",1)
  19. end
  20. sleep(1)
  21.  
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement