From 980b4a8d2ba9b68a02f80e1257e3d8dcf4145c4d Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Fri, 12 Nov 2021 23:38:31 +0100 Subject: [PATCH] init --- classic_tech/bigbrother.lua | 17 +++++++++++++++++ format.sh | 3 +++ stylua.toml | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 classic_tech/bigbrother.lua create mode 100755 format.sh create mode 100644 stylua.toml diff --git a/classic_tech/bigbrother.lua b/classic_tech/bigbrother.lua new file mode 100644 index 0000000..bc9482b --- /dev/null +++ b/classic_tech/bigbrother.lua @@ -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 diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..413f1ce --- /dev/null +++ b/format.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# requires the stylua formatter to be installed +stylua $(find -name '*.lua') diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..f307a39 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,2 @@ +indent_type = "Spaces" +no_call_parentheses = true