aboutsummaryrefslogtreecommitdiff
path: root/example/print-node.lua
blob: 3cf514e846cbe2a768490df64142cce9ef8fd93c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env hydra-dragonfire
local client = require("client")()
client:enable("map")

client:subscribe("move_player")
client:connect()

local pos

while not hydra.canceled() do
	local pkt, interrupted = client:poll(1)

	if pkt then
		pos = (pkt.pos / hydra.BS + vec3(0, -1, 0)):round()
	elseif not interrupted then
		break
	elseif pos then
		local node = client.map:node(pos)
		print(pos, node and node.param0)
	end
end

client:close()