Luke aka SwissalpS 72ace567de
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
whitespace controller.lua (#6)
two spaces that escaped previous cleanup
2024-12-14 18:24:00 +01:00
2023-05-16 08:54:43 +02:00
2023-05-16 08:54:43 +02:00
2020-04-27 11:43:53 +02:00
2023-05-16 08:54:43 +02:00
2024-12-12 14:09:03 +01:00
2024-12-14 18:24:00 +01:00
2023-05-16 08:54:43 +02:00
2023-05-16 08:05:12 +02:00
2023-05-16 08:54:43 +02:00
2024-12-12 14:09:03 +01:00
2020-04-27 11:43:53 +02:00
2024-12-12 14:09:03 +01:00
2023-05-22 14:45:39 +02:00
2023-05-22 14:45:39 +02:00

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

Description
No description provided
Readme 49 KiB
Languages
Lua 94.9%
Dockerfile 3.6%
Mathematica 1.5%