summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-08-09 23:09:02 +0200
committerJeija <norrepli@gmail.com>2012-08-09 23:09:02 +0200
commitce928a5954f620158d911ea43b096bf18037e210 (patch)
tree3bbf251a3588a3bc545406e1dfa312666af4381a
parent686e42043014f870496c9c5c2fdffe5db24c8aff (diff)
downloadmesecons-ce928a5954f620158d911ea43b096bf18037e210.tar
mesecons-ce928a5954f620158d911ea43b096bf18037e210.tar.gz
mesecons-ce928a5954f620158d911ea43b096bf18037e210.tar.bz2
mesecons-ce928a5954f620158d911ea43b096bf18037e210.tar.xz
mesecons-ce928a5954f620158d911ea43b096bf18037e210.zip
Little bugfix for programming the microcontroller
-rw-r--r--mesecons_microcontroller/init.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua
index 6fec372..b6385e2 100644
--- a/mesecons_microcontroller/init.lua
+++ b/mesecons_microcontroller/init.lua
@@ -69,13 +69,9 @@ minetest.register_node(nodename, {
fields.code = "if(A)sbi(1,1); if(!A&#1&B)off(B)sbi(1,0); if(!A&#1&!B)on(B)sbi(1,0); :A is input, B is output (Q), toggles with falling edge"
elseif fields.brsflop then
fields.code = "if(A)on(C);if(B)off(C); :A is S (Set), B is R (Reset), C is output (R dominates)"
- elseif fields.program then
- meta:set_string("infotext", "Programmed Microcontroller")
+ elseif fields.program then --nothing
else return nil end
- meta:set_int("heat", 0)
- yc_reset (pos)
- update_yc(pos)
meta:set_string("code", fields.code)
meta:set_string("formspec", "size[9,2.5]"..
"field[0.256,-0.2;9,2;code;Code:;"..fields.code.."]"..
@@ -86,6 +82,10 @@ minetest.register_node(nodename, {
"button[6 ,0.2;1.5,3;btflop;T-Flop]"..
"button[7.5,0.2;1.5,3;brsflop;RS-Flop]"..
"button_exit[3.5,1;2,3;program;Program]")
+ meta:set_string("infotext", "Programmed Microcontroller")
+ meta:set_int("heat", 0)
+ yc_reset (pos)
+ update_yc(pos)
end,
})
local rules={}