Advertisement
TheSpicePhantom

turtle

Aug 1st, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. function getEnergy()
  2.     local x = peripheral.find("draconic_rf_storage")
  3.     if x ~= nil then
  4.         energy = x.getEnergyStored()
  5.     end
  6.     x = 0
  7. end
  8.  
  9. drop = 0
  10.  
  11. function putStar()
  12.     if drop == 1 then
  13.         turtle.turnLeft()
  14.         turtle.back()
  15.         turtle.turnRight()
  16.         drop = 0
  17.     end
  18.  
  19.     if energy <= 99000000 and energy >= 1 and drop == 0 then
  20.         turtle.turnLeft()
  21.         turtle.forward()
  22.         turtle.turnRight()
  23.         turtle.drop()
  24.         drop = 1
  25.         sleep(125)
  26.     end
  27. end
  28.  
  29. while true do
  30.     getEnergy()
  31.     putStar()
  32.     sleep(0.5)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement