From ac539f32d65f1459b833758e0b2432477ca0bfda Mon Sep 17 00:00:00 2001 From: "navid.sassan" Date: Fri, 2 Apr 2021 16:47:50 +0200 Subject: [PATCH] testing --- energy_control | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/energy_control b/energy_control index 71baff8..411c0b6 100644 --- a/energy_control +++ b/energy_control @@ -35,16 +35,11 @@ function recv() local updated = false while true do local id, data = rednet.receive() - print(type(id)) if id == redstone_toggle_id then - print('id') - print(type(data)) if type(data) == 'table' then - print('table') if data[1] == 'output_state' then redstone_toggle_state = data[2] updated = true - print('updated') end end elseif id == de_store_mon_id then @@ -52,25 +47,24 @@ function recv() end if updated == true then - print(tostring(redstone_toggle_state)) - -- term.clear() - -- term.setCursorPos(0, 0) - -- term.setTextColor(colors.white) - -- term.setBackgroundColor(colors.black) - -- print('Press "R" to toggle the rainbows') - -- term.write('Rainbows state: ') - -- if redstone_toggle_state == true then - -- term.setBackgroundColor(colors.green) - -- term.write('On') - -- elseif redstone_toggle_state == false then - -- term.setBackgroundColor(colors.red) - -- term.write('Off') - -- elseif redstone_toggle_state == nil then - -- term.setBackgroundColor(colors.purple) - -- term.write('Unknown') - -- end - -- print() - -- term.setBackgroundColor(colors.black) + term.clear() + term.setCursorPos(0, 0) + term.setTextColor(colors.white) + term.setBackgroundColor(colors.black) + print('Press "R" to toggle the rainbows') + term.write('Rainbows state: ') + if redstone_toggle_state == true then + term.setBackgroundColor(colors.green) + term.write('On') + elseif redstone_toggle_state == false then + term.setBackgroundColor(colors.red) + term.write('Off') + elseif redstone_toggle_state == nil then + term.setBackgroundColor(colors.purple) + term.write('Unknown') + end + print() + term.setBackgroundColor(colors.black) end end end