check for "get" and "get_string" in the right place :-P

This commit is contained in:
Vanessa Dannenberg 2018-08-17 10:36:20 -04:00
parent d9499481cf
commit 4af469f1aa

@ -201,6 +201,10 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
led_marquee.set_timer(pos, timeout) led_marquee.set_timer(pos, timeout)
elseif msg == "scroll_step" then elseif msg == "scroll_step" then
led_marquee.scroll_text(pos) 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 else
led_marquee.set_timer(pos, 0) led_marquee.set_timer(pos, 0)
meta:set_string("last_msg", msg) meta:set_string("last_msg", msg)
@ -214,10 +218,6 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
elseif asc < 28 then elseif asc < 28 then
last_color = asc last_color = asc
meta:set_int("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
end end
elseif msg and type(msg) == "number" then elseif msg and type(msg) == "number" then