Advertisement
Guest User

recharge

a guest
Jun 15th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. function rechargeCell()
  2.  
  3.   turtle.place()
  4.  
  5.   for i, j in pairs(peripheral.call("right","get")) do
  6.     print(i)  
  7.     print(j)
  8.   end
  9.        
  10.   while true do
  11.     print("waiting...")
  12.     sleep(5)
  13.     if peripheral.call("right", "get")["Full Energy"] == true then
  14.       print("Cellule chargee!")
  15.       turtle.dig()
  16.       return true
  17.     end
  18.   end
  19.  
  20. end
  21.  
  22. for i=1,16 do
  23.   turtle.select(i)
  24.   print("Recharging slot"..i)
  25.   rechargeCell()  
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement