Some checks failed
luacheck / build (push) Has been cancelled
test / build (5.3.0) (push) Has been cancelled
test / build (5.4.0) (push) Has been cancelled
test / build (5.5.0) (push) Has been cancelled
test / build (5.6.0) (push) Has been cancelled
test / build (5.7.0) (push) Has been cancelled
test / build (latest) (push) Has been cancelled
two spaces that escaped previous cleanup
Digilines global memory controller
Overview
Global digiline storage for variables of any kind (use with care)
Usage
Usage:
Reading:
if event.type == "program" then
digiline_send("channel", {
command = "GET",
name = "my_register"
})
end
if event.type == "digiline" and event.channel == "channel" then
print("Value: " .. event.msg)
end
Writing:
if event.type == "program" then
digiline_send("channel", {
command = "SET",
name = "my_register",
value = 3.141
})
end
if event.type == "digiline" and event.channel == "channel" then
-- event.msg.success: true/false
-- event.msg.message: the error message, if any
-- event.msg.code: the error code: -1 = data too long, -2 = number of per-player entries exceeded
end
Atomic write:
if event.type == "program" then
digiline_send("channel", {
command = "INC",
name = "my_register",
value = 1
})
end
if event.type == "digiline" and event.channel == "channel" then
print("New value: " .. event.msg)
end
NOTE: the memory is bound to the user who placed the memory controller, the same register can only be accessed by controllers placed by the same player
Chatcommands
/digiline_global_memory <register name>
Returns the contents of the current players memory with given name/digiline_global_memory_clear
Clears the current players memory
Memory constraints
- Per-value data-complexity of
50000
"units?" - Per-player max-entries of
100
Persistence
Memory contents are persisted to mod-storage periodically
License
- textures/global_memory_controller_top.png
- CC BY-SA 3.0 https://cheapiesystems.com/git/digistuff
Description
Languages
Lua
94.9%
Dockerfile
3.6%
Mathematica
1.5%