basic Lua 5.4 implementation with few example commands
This commit is contained in:
parent
c9b9482cc8
commit
c4a774b5cf
35 changed files with 2554 additions and 460 deletions
16
resources/commands/counter/script.lua
Normal file
16
resources/commands/counter/script.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- 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 }
|
||||
Loading…
Add table
Add a link
Reference in a new issue