Advertisement
Guest User

startup.lua

a guest
Jun 10th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. function pulse(side)
  2.     rs.setOutput(side,true)
  3.     sleep(0.05)
  4.     rs.setOutput(side,false)
  5.     sleep(0.05)
  6. end
  7. --[[
  8. function look()
  9.     while true do
  10.         local x,y = turtle.inspect()
  11.         if x then
  12.             if y.name == "minecraft:netherrack" then
  13.                 pulse "left"
  14.                 return
  15.             end
  16.         end
  17.     end
  18. end
  19.  
  20. function look2()
  21.     while true do
  22.         local x,y = turtle.inspect()
  23.         if y.name~="minecraft:netherrack" then
  24.             return
  25.         end
  26.         pulse "left"
  27.     end
  28. end
  29.  
  30. function mine()
  31.     while true do
  32.         pulse "right"
  33.         local x,y = turtle.inspect()
  34.         if not x or y.name=="minecraft:netherrack" then
  35.             return
  36.         end
  37.     end
  38. end
  39.  
  40. while true do
  41.     look() look2() mine()
  42. end]]
  43.  
  44. while true do
  45.     local exists, data = turtle.inspect()
  46.     if not exists then sleep(0.05)
  47.     elseif data.name == "minecraft:netherrack" then pulse "left"
  48.     else pulse "right" end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement