Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local max_x, max_y = term.getSize()
- write("INSERT RADIUS: ")
- local radius = tonumber(read())
- write("INSERT X: ")
- local c_x = tonumber(read())
- write("INSERT Z: ")
- local c_z = tonumber(read())
- monitor = peripheral.wrap("top")
- term.redirect(monitor)
- function string.split(str, sep)
- if sep == nil then
- sep = "%s"
- end
- local t = {}
- for sr in string.gmatch(str, "([^"..sep.."]+)") do
- table.insert(t, sr)
- end
- return t
- end
- function int(n)
- return tonumber(n)
- end
- local interpolate = (c_z*2)/max_y
- term.clear()
- term.setCursorPos(1,1)
- while true do
- local git = http.get("https://raw.githubusercontent.com/banana-boye/cannon-thingy/refs/heads/test/main.json")
- local info = textutils.unserialiseJSON(git.readAll())
- for player, c_string in pairs(info) do
- local spl = string.split(string.sub(c_string,2,#c_string-1), " | ")
- local x,y,z = tonumber(spl[1]),tonumber(spl[2]),tonumber(spl[3])
- if (x >= c_x-radius and x <= c_x+radius) and (z >= c_z-radius and z <= c_z+radius) then
- term.clear()
- term.setCursorPos(1,1)
- write(player.." found at "..c_string)
- end
- end
- paintutils.drawPixel(max_x/2,max_y/2)
- os.sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement