Temperest wrote:Here's an 8-bit subtractor! At the moment it is subtracting 0b1010 from 0b100100 to yield 0b11010.
And here is the WorldEdit save:
Link
For reference, here is my current "mesecon world":
I'm planning to put up a server dedicated to playing with mesecon circuits. Is anyone interested in joining?
Lunarhiro wrote:actually... I use turbines as redstone repeaters...
01:31:14: ERROR[main]: [LUA] ...inetest\bin\..\data\mods\mesecons_temperest\init.lua:323: attempt to call method 'register_on_signal_on' (a nil value)
mesecon:register_on_signal_on(function(pos, node)
if node.name=="mesecons_temperest:duali" then
minetest.chat_send_player("Gatharoth", "running check.")
if check_dual(pos) then
local lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z}) end
local lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x+2, y=pos.y, z=pos.z}) end
local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end
local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z+2}) end
end
end
end)
Gatharoth wrote:Okay, I'm getting a weird error. mesecon:register_on_signal_on isn't working anymore for me.
I've been working on an addon to temperest's code. (see here) When all of a sudden I get this error.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
01:31:14: ERROR[main]: [LUA] ...inetest\bin\..\data\mods\mesecons_temperest\init.lua:323: attempt to call method 'register_on_signal_on' (a nil value)
This happens even when I put the function inside it.
So likeYour phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
mesecon:register_on_signal_on(function(pos, node)
if node.name=="mesecons_temperest:duali" then
minetest.chat_send_player("Gatharoth", "running check.")
if check_dual(pos) then
local lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z}) end
local lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x+2, y=pos.y, z=pos.z}) end
local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end
local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z+2}) end
end
end
end)
Still ends with the same error.
sfan5 wrote:The Function just don't exist.
Something must be wrong with the Mesecons init.lua
mesecon:register_on_signal_on(function (pos, node)
if node.name=="mesecons_movestones:movestone" then
local direction=mesecon:get_movestone_direction({x=pos.x, y=pos.y, z=pos.z})
local checknode={}
local collpos={x=pos.x, y=pos.y, z=pos.z}
repeat -- Check if it collides with a stopper
collpos={x=collpos.x+direction.x, y=collpos.y+direction.y, z=collpos.z+direction.z}
checknode=minetest.env:get_node(collpos)
if mesecon:is_mvps_stopper(checknode.name) then
return
end
until checknode.name=="air"
or checknode.name=="ignore"
or checknode.name=="default:water"
or checknode.name=="default:water_flowing"
minetest.env:remove_node(pos)
nodeupdate(pos)
minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity")
end
end)
Gatharoth wrote:sfan5 wrote:The Function just don't exist.
Something must be wrong with the Mesecons init.lua
The problem is, it does exist; And it works. If I take out my code, and let it load, calling that function works. I mean, if you want proof, here it is in the movesontes.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
mesecon:register_on_signal_on(function (pos, node)
if node.name=="mesecons_movestones:movestone" then
local direction=mesecon:get_movestone_direction({x=pos.x, y=pos.y, z=pos.z})
local checknode={}
local collpos={x=pos.x, y=pos.y, z=pos.z}
repeat -- Check if it collides with a stopper
collpos={x=collpos.x+direction.x, y=collpos.y+direction.y, z=collpos.z+direction.z}
checknode=minetest.env:get_node(collpos)
if mesecon:is_mvps_stopper(checknode.name) then
return
end
until checknode.name=="air"
or checknode.name=="ignore"
or checknode.name=="default:water"
or checknode.name=="default:water_flowing"
minetest.env:remove_node(pos)
nodeupdate(pos)
minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity")
end
end)
sfan5 wrote:Weird!
Gatharoth wrote:EDIT: Alright, for what every reason its all working now. Everything!! :D
Temperest wrote:Gatharoth wrote:EDIT: Alright, for what every reason its all working now. Everything!! :D
Must be the magical code gremlins again.
Jeija wrote:Filled in the license; as you might have noticed I'm currently away; if there is anything that has to be changed, could please sfan5 or Temperest commit it on GitHub?
I did not read the whole thread since then but I think there was some bug and there is another thread with an AND gate; if there is
any code to commit please do it!
Users browsing this forum: No registered users and 10 guests