Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- --Computer Craft Frequency Scanner
- --Scans all frequencies (most frequencies are found in the first % complete update)
- --Takes 1h 15min to complete a full scan (Only 128 frequencies can be scanned at once)
- local max = 511
- if type(tArgs[1]) == "string" and tArgs[1] == "quick" then
- max = 64
- end
- modem = peripheral.wrap( "back" )
- for j = 0,max,1 do
- for i = j*128,j*128+127,1 do
- modem.open(i)
- end
- local timeout = os.startTimer(10)
- while true do
- event = {os.pullEvent()}
- if event[1] == "modem_message" then
- print(event[3]..": "..senderDistance.."m")
- elseif event[1] == "timer" and event[2] == timeout then
- break
- end
- end
- for i = j*128,j*128+127,1 do
- modem.close(i)
- end
- if math.mod(j, 32) == 0 then
- print((j/511).."% Complete (0 ->"..(j*128+127)..")")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement