SHOW:
|
|
- or go back to the newest paste.
| 1 | local lasers = peripheral.getNames() | |
| 2 | ||
| 3 | rednet.open("top")
| |
| 4 | ||
| 5 | for i = #lasers, 1, -1 do | |
| 6 | if peripheral.getType(lasers[i]) ~= "warpdriveLaserCamera" then | |
| 7 | table.remove(lasers, i) | |
| 8 | else | |
| 9 | peripheral.wrap(lasers[i]).beamFrequency(1420) | |
| 10 | end | |
| 11 | end | |
| 12 | ||
| 13 | - | print("Emit Scanning Laser to Target a Block")
|
| 13 | + | print("Emit Scanning Laser to Set Jump Target Without Y Movements")
|
| 14 | ||
| 15 | while true do | |
| 16 | local event, laserName, lx, ly, lz, block, _, _, _, type, metadata, resistance = os.pullEvent() | |
| 17 | ||
| 18 | if event == "laserScanning" then | |
| 19 | -- Convert the laser scanning coordinates to numbers and store them | |
| 20 | local lastLx = tonumber(lx) | |
| 21 | local lastLy = tonumber(ly) | |
| 22 | local lastLz = tonumber(lz) | |
| 23 | ||
| 24 | ||
| 25 | - | print("Laser target: X:" .. lastLx .. " Y:" .. lastLy .. " Z:" .. lastLz)
|
| 25 | + | print("Laser Target: X:" .. lastLx .. " Y:" .. lastLy .. " Z:" .. lastLz)
|
| 26 | ||
| 27 | -- Package the coordinates into a table (you can also send a formatted string) | |
| 28 | local data = { x = lastLx, y = lastLy, z = lastLz }
| |
| 29 | ||
| 30 | -- Broadcast the coordinates using a custom protocol ("coordBroadcast")
| |
| 31 | - | rednet.broadcast(data, "SMineBroadcast") |
| 31 | + | rednet.broadcast(data, "HorizontalJumpBroadcast") |
| 32 | end | |
| 33 | end | |
| 34 |