This commit is contained in:
LordMZTE 2021-11-12 23:38:31 +01:00
commit 980b4a8d2b
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,17 @@
local pl_detector = peripheral.find "playerDetector"
local mon = peripheral.find "monitor"
if mon == nil or pl_detector == nil then
error "not all peripherals present! need monitor and player detector"
end
while true do
local players = pl_detector.getOnlinePlayers()
for i, p in ipairs(players) do
local pos = pl_detector.getPlayerPos(p)
mon.setCursorPos(1, i)
mon.write(p .. " @ X: " .. pos.x .. " Y: " .. pos.y .. " Z: " .. pos.z)
end
sleep(2)
end

3
format.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
# requires the stylua formatter to be installed
stylua $(find -name '*.lua')

2
stylua.toml Normal file
View File

@ -0,0 +1,2 @@
indent_type = "Spaces"
no_call_parentheses = true