Advertisement
lucifersamfr

mjRecharger

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