Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Form Field -------
- secondsToRepeat = 5
- -----------------------
- local whitelist = {
- "Spectrolus"
- }
- for index, value in pairs(whitelist) do
- whitelist[value] = "Mafia"
- end
- local radar = require("component").radar
- local term = require("term")
- local computer = require("computer")
- local noise = require("component").noise
- term.clear()
- while true do
- term.clear()
- print(computer.energy())
- freq = 0
- found = 0
- for i, v in ipairs(radar.getPlayers()) do
- if whitelist[v.name] == nil then
- if v.distance > freq then
- freq = (500 - v.distance) + 50
- end
- print(v.name, v.distance)
- found = 1
- end
- if found == 1 then
- noise.setMode(1, noise.modes.triangle)
- noise.play({{170, 0.3}})
- end
- end
- os.sleep(secondsToRepeat)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement