Minecraft Server
Players online on a Minecraft server
| System | AWTRIX NG Scripts |
|---|---|
| Firmware | AWTRIX NG |
| Topic | Social |
| Built by | Blueforcer |
| File | S4Z3uA9MXABr.ax · 3.2 KB |
| Icons | — |
| Published | 4 Aug 2026 |
Players currently online on any Minecraft server. Just enter the server address.
Updates every 10 minutes.
S4Z3uA9MXABr.ax
# @name Minecraft
# @desc Players online on a Minecraft server
# @author Blueforcer
# @version 2.0
# @config host text "Server address" default="mc.hypixel.net" maxlen=64 help="The address you type into the game, e.g. mc.hypixel.net"
class Minecraft
var url, period
var players, label, full, online, err
var ticks, busy
var glyph, pal, ramp
def init()
self.url = "https://api.mcsrvstat.us/3/" + store.get("host")
self.period = 600 # every 10min
self.players = nil
self.label = nil
self.full = nil
self.online = nil # nil until the first answer lands
self.err = false
self.ticks = 3
self.busy = false
self.glyph = [0x5555, 0x6969, 0x6969, 0x5695,
0x5AA5, 0x5AA5, 0x5965, 0x5555]
self.pal = [0x6CBB3C, 0x0D1F0D]
self.ramp = [0x6CBB3C, 0xCFF08A]
end
def human(n)
if n < 1000 return str(n) end
var d = 1000
var suf = "K"
if n >= 1000000000
d = 1000000000
suf = "B"
elif n >= 1000000
d = 1000000
suf = "M"
end
var v = n / (d + 0.0)
if v >= 10 return str(round(v)) + suf end
var t = round(v * 10)
return str(int(t / 10)) + "." + str(t % 10) + suf
end
def on_body(body, status)
self.busy = false
shared.set("f", 0)
if status != 200
self.err = true
return
end
self.err = false
if body == nil
self.online = false
self.players = nil
self.label = nil
self.full = nil
return
end
var m = re.search("(\\d+)", body)
if m == nil return end
self.players = num(m[1])
self.full = str(self.players)
self.label = self.human(self.players)
self.online = true
end
def tls_busy()
for k : shared.keys()
if size(k) > 2 && k[size(k) - 2 .. size(k) - 1] == ".f" && shared.get(k) == 1
var a = shared.age(k)
if a != nil && a < 20000 return true end
end
end
return false
end
def loop()
if self.ticks <= 0
if !self.busy && !self.tls_busy()
self.ticks = self.period
self.busy = true
shared.set("f", 1)
http.get(self.url, / b, st -> self.on_body(b, st),
{'find': "\"players\":{\"online\":", 'keep': 32})
end
end
self.ticks -= 1
end
def draw()
clear()
var lit = self.label != nil
for y : 0 .. 7
var row = self.glyph[y]
for x : 0 .. 7
var c = (row >> (14 - 2 * x)) & 3
if c > 0
var col = self.pal[c - 1]
pixel(x, y, lit ? col : (col >> 3) & 0x1F1F1F)
end
end
end
if lit
var avail = width() - 9
var s = self.full
var w = text_ink_width(s)
if w > avail
s = self.label
w = text_ink_width(s)
end
ramp_text(9 + (avail - w) / 2, 6, s, self.ramp)
return
end
var s = "..."
var c = 0x555555
if self.online == false
s = "off"
c = 0xAA3333
elif self.err
s = "?"
c = 0xCC7722
end
var w = text_ink_width(s)
text(9 + (width() - 9 - w) / 2, 6, s, c)
end
end
return Minecraft()
Install it on your AWTRIX NG
Your browser writes the script straight to the device on your network. It joins the app rotation right away.
Some browsers refuse to talk to a device on your network from a public page. Download the flow and paste it into the Scripts tab of your device, or install it from a terminal:
More flows for AWTRIX NG Scripts or Social
Something wrong with this flow? Report it.