jaklsfjlsak

Single Laser Debug

Jul 26th, 2023
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local laser = peripheral.find("warpdriveLaserCamera")
  2. local speaker = peripheral.find("warpdriveSpeaker")
  3. -- Sets the frequency of the laser to 1420
  4. laser.beamFrequency(1420)
  5.  
  6. while true do
  7.     os.sleep(0.5)
  8.     local event, key = os.pullEvent()
  9.    
  10.     if event == "laserScanning" then
  11.         local type, lx, ly, lz, block = laser.getScanResult()
  12.         block = block or "nil" -- if the block type is nil, replace it with "nil"
  13.         speaker.speak("Laser Coordinates:" .. block .. ", x=" .. tostring(lx) .. ", y=" .. tostring(ly) .. ", z=" .. tostring(lz))
  14.     end
  15. end
Add Comment
Please, Sign In to add comment