Advertisement
jaklsfjlsak

光雷达

May 30th, 2023
1,299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. local laser = peripheral.find("warpdriveLaser")
  2. laser.beamFrequency(1420)
  3. local Tx = -1
  4. local Ty = -1
  5. --local Tz = -1
  6. while true do
  7.     laser.emitBeam(Tx, Ty, -1)
  8.     local type, x, y, z, block = laser.getScanResult()
  9.     if type == "BLOCK" then
  10.         print(block, x, y, z)
  11.     end
  12.     Ty = Ty+0.1
  13.     if Ty > 1 then
  14.         Ty = -1
  15.         Tx = Tx+0.1
  16.     end
  17.     if Tx == 1 and Ty == 1 then
  18.         exit()
  19.     end
  20.     os.sleep(0.1)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement