mirror of
https://github.com/Priler/jarvis.git
synced 2026-05-26 15:13:39 +00:00
16 lines
395 B
Lua
16 lines
395 B
Lua
-- simple counter demonstrating state persistence
|
|
|
|
local count = jarvis.state.get("count") or 0
|
|
count = count + 1
|
|
jarvis.state.set("count", count)
|
|
|
|
local lang = jarvis.context.language
|
|
local msg = lang == "ru"
|
|
and "Счётчик: " .. count
|
|
or "Counter: " .. count
|
|
|
|
jarvis.log("info", msg)
|
|
jarvis.system.notify("Counter", tostring(count))
|
|
jarvis.audio.play_ok()
|
|
|
|
return { chain = true } |