diff --git a/init.lua b/init.lua index b29e516..fcc09b3 100644 --- a/init.lua +++ b/init.lua @@ -201,6 +201,10 @@ local on_digiline_receive_string = function(pos, node, channel, msg) led_marquee.set_timer(pos, timeout) elseif msg == "scroll_step" then led_marquee.scroll_text(pos) + elseif msg == "get" then -- get the master panel's displayed char as ASCII numerical value + digiline:receptor_send(pos, digiline.rules.default, channel, tonumber(string.match(minetest.get_node(pos).name,"led_marquee:char_(.+)"))) -- wonderfully horrible string manipulaiton + elseif msg == "getstr" then -- get the last stored message + digiline:receptor_send(pos, digiline.rules.default, channel, meta:get_string("last_msg")) else led_marquee.set_timer(pos, 0) meta:set_string("last_msg", msg) @@ -214,10 +218,6 @@ local on_digiline_receive_string = function(pos, node, channel, msg) elseif asc < 28 then last_color = asc meta:set_int("last_color", asc) - elseif msg == "get" then -- get the master panel's displayed char as ASCII numerical value - digiline:receptor_send(pos, digiline.rules.default, channel, tonumber(string.match(minetest.get_node(pos).name,"led_marquee:char_(.+)"))) -- wonderfully horrible string manipulaiton - elseif msg == "getstr" then -- get the last stored message - digiline:receptor_send(pos, digiline.rules.default, channel, meta:get_string("last_msg")) end end elseif msg and type(msg) == "number" then