fix railbot
This commit is contained in:
parent
2550294514
commit
f6b0042989
@ -21,8 +21,15 @@ end
|
||||
function ws.dcm(msg)
|
||||
return minetest.display_chat_message(msg)
|
||||
end
|
||||
function ws.set_bool_bulk(settings,value)
|
||||
if type(settings) ~= 'table' then return false end
|
||||
for k,v in pairs(settings) do
|
||||
minetest.settings:set_bool(v,value)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function ws.globalhacktemplate(setting,func,funcstart,funcstop)
|
||||
function ws.globalhacktemplate(setting,func,funcstart,funcstop,daughters)
|
||||
funcstart = funcstart or function() end
|
||||
funcstop = funcstop or function() end
|
||||
return function()
|
||||
@ -31,9 +38,12 @@ function ws.globalhacktemplate(setting,func,funcstart,funcstop)
|
||||
if nextact[setting] and nextact[setting] > os.clock() then return end
|
||||
nextact[setting] = os.clock() + 0.1
|
||||
if not ghwason[setting] then
|
||||
funcstart()
|
||||
ws.dcm(setting.. " activated")
|
||||
ghwason[setting] = true
|
||||
if not funcstart() then
|
||||
ws.set_bool_bulk(daughters,true)
|
||||
ghwason[setting] = true
|
||||
ws.dcm(setting.. " activated")
|
||||
else minetest.settings:set_bool(setting,false)
|
||||
end
|
||||
else
|
||||
func()
|
||||
end
|
||||
@ -41,6 +51,7 @@ function ws.globalhacktemplate(setting,func,funcstart,funcstop)
|
||||
elseif ghwason[setting] then
|
||||
ghwason[setting] = false
|
||||
funcstop()
|
||||
ws.set_bool_bulk(daughters,false)
|
||||
ws.dcm(setting.. " deactivated")
|
||||
end
|
||||
end
|
||||
@ -50,8 +61,8 @@ function ws.register_globalhack(func)
|
||||
table.insert(ws.registered_globalhacks,func)
|
||||
end
|
||||
|
||||
function ws.register_globalhacktemplate(name,category,setting,func,funcstart,funcstop)
|
||||
ws.register_globalhack(ws.globalhacktemplate(setting,func,funcstart,funcstop))
|
||||
function ws.register_globalhacktemplate(name,category,setting,func,funcstart,funcstop,daughters)
|
||||
ws.register_globalhack(ws.globalhacktemplate(setting,func,funcstart,funcstop,daughters))
|
||||
minetest.register_cheat(name,category,setting)
|
||||
end
|
||||
|
||||
@ -321,6 +332,6 @@ function ws.dig(pos)
|
||||
|
||||
end
|
||||
|
||||
ws.rg('DigHead','Player','dighead',function()
|
||||
ws.dig(ws.dircoord(0,1,0))
|
||||
end)
|
||||
local snapdir="north"
|
||||
ws.rg('DigHead','Player','dighead',function() ws.dig(ws.dircoord(0,1,0)) end)
|
||||
ws.rg('SnapYaw','Bots','snapyaw',function() ws.setdir(snapdir) end,function() snapdir=ws.getdir() end)
|
||||
|
@ -108,7 +108,7 @@ minetest.register_chatcommand("sc_reset", { func = scaffold.reset })
|
||||
|
||||
function scaffold.can_place_at(pos)
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
return (node and (node.name == "air" or minetest.get_node_def(node.name).buildable_to))
|
||||
return (node and (node.name == "air" or node.name=="mcl_core:water_source" or node.name=="mcl_core:water_flowing" or node.name=="mcl_core:lava_source" or node.name=="mcl_core:lava_flowing" or minetest.get_node_def(node.name).buildable_to))
|
||||
end
|
||||
|
||||
-- should check if wield is placeable
|
||||
@ -152,7 +152,7 @@ function scaffold.place_if_needed(items, pos, place)
|
||||
--if lastplc + actint > os.time() then return end
|
||||
if not pos then return end
|
||||
lastplc=os.time()
|
||||
if minetest.settings:get_bool('scaffold.locky') and math.round(pos.y) ~= math.round(scaffold.locky) then return end
|
||||
|
||||
place = place or minetest.place_node
|
||||
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
@ -257,300 +257,79 @@ local function checknode(pos)
|
||||
return false
|
||||
end
|
||||
|
||||
if turtle then
|
||||
scaffold.register_template_scaffold("TBM", "scaffold_tbm", function(pos)
|
||||
scaffold.dig(turtle.dircoord(1,1,0))
|
||||
scaffold.dig(turtle.dircoord(1,0,0))
|
||||
end)
|
||||
scaffold.register_template_scaffold("TallTBM", "scaffold_ttbm", function(pos)
|
||||
pos = {
|
||||
scaffold.register_template_scaffold("TBM", "scaffold_tbm", function(pos)
|
||||
scaffold.dig(ws.dircoord(1,1,0))
|
||||
scaffold.dig(ws.dircoord(1,0,0))
|
||||
end)
|
||||
scaffold.register_template_scaffold("TallTBM", "scaffold_ttbm", function(pos)
|
||||
pos = {
|
||||
|
||||
turtle.dircoord(1,4,2),
|
||||
turtle.dircoord(1,3,2),
|
||||
turtle.dircoord(1,2,2),
|
||||
turtle.dircoord(1,1,2),
|
||||
turtle.dircoord(1,0,2),
|
||||
ws.dircoord(1,4,2),
|
||||
ws.dircoord(1,3,2),
|
||||
ws.dircoord(1,2,2),
|
||||
ws.dircoord(1,1,2),
|
||||
ws.dircoord(1,0,2),
|
||||
|
||||
turtle.dircoord(1,4,-2),
|
||||
turtle.dircoord(1,3,-2),
|
||||
turtle.dircoord(1,2,-2),
|
||||
turtle.dircoord(1,1,-2),
|
||||
turtle.dircoord(1,0,-2),
|
||||
ws.dircoord(1,4,-2),
|
||||
ws.dircoord(1,3,-2),
|
||||
ws.dircoord(1,2,-2),
|
||||
ws.dircoord(1,1,-2),
|
||||
ws.dircoord(1,0,-2),
|
||||
|
||||
|
||||
turtle.dircoord(1,4,1),
|
||||
turtle.dircoord(1,3,1),
|
||||
turtle.dircoord(1,2,1),
|
||||
turtle.dircoord(1,1,1),
|
||||
turtle.dircoord(1,0,1),
|
||||
ws.dircoord(1,4,1),
|
||||
ws.dircoord(1,3,1),
|
||||
ws.dircoord(1,2,1),
|
||||
ws.dircoord(1,1,1),
|
||||
ws.dircoord(1,0,1),
|
||||
|
||||
turtle.dircoord(1,4,-1),
|
||||
turtle.dircoord(1,3,-1),
|
||||
turtle.dircoord(1,2,-1),
|
||||
turtle.dircoord(1,1,-1),
|
||||
turtle.dircoord(1,0,-1),
|
||||
ws.dircoord(1,4,-1),
|
||||
ws.dircoord(1,3,-1),
|
||||
ws.dircoord(1,2,-1),
|
||||
ws.dircoord(1,1,-1),
|
||||
ws.dircoord(1,0,-1),
|
||||
|
||||
turtle.dircoord(1,4,0),
|
||||
turtle.dircoord(1,3,0),
|
||||
turtle.dircoord(1,2,0),
|
||||
turtle.dircoord(1,1,0),
|
||||
turtle.dircoord(1,0,0)
|
||||
}
|
||||
for k,v in pairs(pos) do
|
||||
scaffold.dig(v)
|
||||
ws.dircoord(1,4,0),
|
||||
ws.dircoord(1,3,0),
|
||||
ws.dircoord(1,2,0),
|
||||
ws.dircoord(1,1,0),
|
||||
ws.dircoord(1,0,0)
|
||||
}
|
||||
for k,v in pairs(pos) do
|
||||
scaffold.dig(v)
|
||||
end
|
||||
minetest.settings:set_bool('continuous_forward',true)
|
||||
for k,v in pairs(pos) do
|
||||
local n=minetest.get_node_or_nil(v)
|
||||
if n and n.name ~= "air" then
|
||||
minetest.settings:set_bool('continuous_forward',false)
|
||||
end
|
||||
minetest.settings:set_bool('continuous_forward',true)
|
||||
for k,v in pairs(pos) do
|
||||
local n=minetest.get_node_or_nil(v)
|
||||
if n and n.name ~= "air" then
|
||||
minetest.settings:set_bool('continuous_forward',false)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
scaffold.register_template_scaffold("Cobbler", "scaffold_cobbler", function(pos)
|
||||
if minetest.settings:get_bool('freecam') then return end
|
||||
local fpos=turtle.dircoord(1,0,0)
|
||||
local fn=minetest.get_node_or_nil(fpos)
|
||||
pos = {
|
||||
|
||||
turtle.dircoord(2,4,2),
|
||||
turtle.dircoord(2,3,2),
|
||||
turtle.dircoord(2,2,2),
|
||||
turtle.dircoord(2,1,2),
|
||||
turtle.dircoord(2,0,2),
|
||||
|
||||
turtle.dircoord(2,4,-2),
|
||||
turtle.dircoord(2,3,-2),
|
||||
turtle.dircoord(2,2,-2),
|
||||
turtle.dircoord(2,1,-2),
|
||||
turtle.dircoord(2,0,-2),
|
||||
|
||||
turtle.dircoord(2,4,1),
|
||||
turtle.dircoord(2,3,1),
|
||||
turtle.dircoord(2,2,1),
|
||||
turtle.dircoord(2,1,1),
|
||||
turtle.dircoord(2,0,1),
|
||||
|
||||
turtle.dircoord(2,4,-1),
|
||||
turtle.dircoord(2,3,-1),
|
||||
turtle.dircoord(2,2,-1),
|
||||
turtle.dircoord(2,1,-1),
|
||||
turtle.dircoord(2,0,-1),
|
||||
|
||||
turtle.dircoord(2,4,0),
|
||||
turtle.dircoord(2,3,0),
|
||||
turtle.dircoord(2,2,0),
|
||||
turtle.dircoord(2,1,0),
|
||||
turtle.dircoord(2,0,0),
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
turtle.dircoord(3,4,2),
|
||||
turtle.dircoord(3,3,2),
|
||||
turtle.dircoord(3,2,2),
|
||||
turtle.dircoord(3,1,2),
|
||||
turtle.dircoord(3,0,2),
|
||||
|
||||
turtle.dircoord(3,4,-2),
|
||||
turtle.dircoord(3,3,-2),
|
||||
turtle.dircoord(3,2,-2),
|
||||
turtle.dircoord(3,1,-2),
|
||||
turtle.dircoord(3,0,-2),
|
||||
|
||||
|
||||
turtle.dircoord(4,4,1),
|
||||
turtle.dircoord(4,3,1),
|
||||
turtle.dircoord(4,2,1),
|
||||
turtle.dircoord(4,1,1),
|
||||
turtle.dircoord(4,0,1),
|
||||
scaffold.register_template_scaffold("TriScaffold", "scaffold_three_wide", function(pos)
|
||||
scaffold.place_if_able(pos)
|
||||
scaffold.place_if_able(ws.dircoord(0, -1, 1))
|
||||
scaffold.place_if_able(ws.dircoord(0, -1, -1))
|
||||
end)
|
||||
|
||||
turtle.dircoord(4,4,-1),
|
||||
turtle.dircoord(4,3,-1),
|
||||
turtle.dircoord(4,2,-1),
|
||||
turtle.dircoord(4,1,-1),
|
||||
turtle.dircoord(4,0,-1),
|
||||
scaffold.register_template_scaffold("headTriScaff", "scaffold_three_wide_head", function(pos)
|
||||
scaffold.place_if_able(ws.dircoord(0, 3, 0))
|
||||
scaffold.place_if_able(ws.dircoord(0, 3, 1))
|
||||
scaffold.place_if_able(ws.dircoord(0, 3, -1))
|
||||
end)
|
||||
|
||||
turtle.dircoord(4,4,0),
|
||||
turtle.dircoord(4,3,0),
|
||||
turtle.dircoord(4,2,0),
|
||||
turtle.dircoord(4,1,0),
|
||||
turtle.dircoord(4,0,0),
|
||||
scaffold.register_template_scaffold("QuintScaffold", "scaffold_five_wide", function(pos)
|
||||
scaffold.place_if_able(pos)
|
||||
scaffold.place_if_able(ws.dircoord(0, -1, 1))
|
||||
scaffold.place_if_able(ws.dircoord(0, -1, -1))
|
||||
scaffold.place_if_able(ws.dircoord(0, -1, 2))
|
||||
scaffold.place_if_able(ws.dircoord(0, -1, -2))
|
||||
end)
|
||||
|
||||
turtle.dircoord(5,4,2),
|
||||
turtle.dircoord(5,3,2),
|
||||
turtle.dircoord(5,2,2),
|
||||
turtle.dircoord(5,1,2),
|
||||
turtle.dircoord(5,0,2),
|
||||
|
||||
turtle.dircoord(5,4,-2),
|
||||
turtle.dircoord(5,3,-2),
|
||||
turtle.dircoord(5,2,-2),
|
||||
turtle.dircoord(5,1,-2),
|
||||
turtle.dircoord(5,0,-2),
|
||||
|
||||
|
||||
turtle.dircoord(5,4,1),
|
||||
turtle.dircoord(5,3,1),
|
||||
turtle.dircoord(5,2,1),
|
||||
turtle.dircoord(5,1,1),
|
||||
turtle.dircoord(5,0,1),
|
||||
|
||||
turtle.dircoord(5,4,-1),
|
||||
turtle.dircoord(5,3,-1),
|
||||
turtle.dircoord(5,2,-1),
|
||||
turtle.dircoord(5,1,-1),
|
||||
turtle.dircoord(5,0,-1),
|
||||
|
||||
turtle.dircoord(5,4,0),
|
||||
turtle.dircoord(5,3,0),
|
||||
turtle.dircoord(5,2,0),
|
||||
turtle.dircoord(5,1,0),
|
||||
turtle.dircoord(5,0,0)
|
||||
}
|
||||
|
||||
if fn and fn.name == "mcl_core:cobble" then
|
||||
for k,v in pairs(pos) do
|
||||
scaffold.place_if_needed({"mcl_core:cobble"},v)
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
scaffold.register_template_scaffold("LanternTBM", "scaffold_ltbm", function(pos)
|
||||
--scaffold.dig(turtle.dircoord(1,1,0)) -- let lTBM just be additionally place lanterns mode - useful for rail too.
|
||||
--scaffold.dig(turtle.dircoord(1,0,0))
|
||||
local dir=turtle.getdir()
|
||||
local pl=false
|
||||
if dir == "north" or dir == "south" then
|
||||
if pos.z % 8 == 0 then
|
||||
pl=true
|
||||
end
|
||||
else
|
||||
if pos.x % 8 == 0 then
|
||||
pl=true
|
||||
end
|
||||
end
|
||||
if pl then
|
||||
local lpos=turtle.dircoord(0,3,0)
|
||||
local nd=minetest.get_node_or_nil(lpos)
|
||||
if nd and nd.name ~= 'mcl_ocean:sea_lantern' then
|
||||
scaffold.dig(lpos)
|
||||
minetest.after("0.1",function() scaffold.place_if_needed({'mcl_ocean:sea_lantern'},lpos) end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
scaffold.register_template_scaffold("TriScaffold", "scaffold_three_wide", function(pos)
|
||||
scaffold.place_if_able(pos)
|
||||
scaffold.place_if_able(turtle.dircoord(0, -1, 1))
|
||||
scaffold.place_if_able(turtle.dircoord(0, -1, -1))
|
||||
end)
|
||||
scaffold.register_template_scaffold("WallBot", "scaffold_behind", function(pos)
|
||||
minetest.settings:set_bool('scaffold_lockyaw',true)
|
||||
minetest.settings:set('movement_speed_walk',1)
|
||||
pos = {
|
||||
|
||||
turtle.dircoord(-2,4,2),
|
||||
turtle.dircoord(-2,3,2),
|
||||
turtle.dircoord(-2,2,2),
|
||||
turtle.dircoord(-2,1,2),
|
||||
turtle.dircoord(-2,0,2),
|
||||
|
||||
turtle.dircoord(-2,4,-2),
|
||||
turtle.dircoord(-2,3,-2),
|
||||
turtle.dircoord(-2,2,-2),
|
||||
turtle.dircoord(-2,1,-2),
|
||||
turtle.dircoord(-2,0,-2),
|
||||
|
||||
|
||||
turtle.dircoord(-2,4,1),
|
||||
turtle.dircoord(-2,3,1),
|
||||
turtle.dircoord(-2,2,1),
|
||||
turtle.dircoord(-2,1,1),
|
||||
turtle.dircoord(-2,0,1),
|
||||
|
||||
turtle.dircoord(-2,4,-1),
|
||||
turtle.dircoord(-2,3,-1),
|
||||
turtle.dircoord(-2,2,-1),
|
||||
turtle.dircoord(-2,1,-1),
|
||||
turtle.dircoord(-2,0,-1),
|
||||
|
||||
turtle.dircoord(-2,4,0),
|
||||
turtle.dircoord(-2,3,0),
|
||||
turtle.dircoord(-2,2,0),
|
||||
turtle.dircoord(-2,1,0),
|
||||
turtle.dircoord(-2,0,0),
|
||||
turtle.dircoord(-2,4,2),
|
||||
turtle.dircoord(-2,3,2),
|
||||
turtle.dircoord(-2,2,2),
|
||||
turtle.dircoord(-2,1,2),
|
||||
turtle.dircoord(-2,0,2),
|
||||
|
||||
turtle.dircoord(-3,4,-2),
|
||||
turtle.dircoord(-3,3,-2),
|
||||
turtle.dircoord(-3,2,-2),
|
||||
turtle.dircoord(-3,1,-2),
|
||||
turtle.dircoord(-3,0,-2),
|
||||
|
||||
|
||||
turtle.dircoord(-3,4,1),
|
||||
turtle.dircoord(-3,3,1),
|
||||
turtle.dircoord(-3,2,1),
|
||||
turtle.dircoord(-3,1,1),
|
||||
turtle.dircoord(-3,0,1),
|
||||
|
||||
turtle.dircoord(-3,4,-1),
|
||||
turtle.dircoord(-3,3,-1),
|
||||
turtle.dircoord(-3,2,-1),
|
||||
turtle.dircoord(-3,1,-1),
|
||||
turtle.dircoord(-3,0,-1),
|
||||
|
||||
turtle.dircoord(-3,4,0),
|
||||
turtle.dircoord(-3,3,0),
|
||||
turtle.dircoord(-3,2,0),
|
||||
turtle.dircoord(-3,1,0),
|
||||
turtle.dircoord(-3,0,0)
|
||||
}
|
||||
|
||||
local ngo=false
|
||||
|
||||
for k,v in pairs(pos) do
|
||||
local n=minetest.get_node_or_nil(v)
|
||||
if n and n.name ~= "mcl_core:cobble" then
|
||||
scaffold.dig(v)
|
||||
ngo=false
|
||||
else ngo=true
|
||||
end
|
||||
if n == nil then ngo=false end
|
||||
end
|
||||
|
||||
for k,v in pairs(pos) do
|
||||
scaffold.place_if_needed({'mcl_core:cobble'},v)
|
||||
end
|
||||
|
||||
minetest.settings:set_bool('continuous_forward',ngo)
|
||||
end,false,function()
|
||||
minetest.settings:set_bool('continuous_forward',false)
|
||||
minetest.settings:set_bool('scaffold_locky',false)
|
||||
minetest.settings:set_bool('scaffold_lockyaw',false)
|
||||
minetest.settings:set_bool('scaffold_ltbm',false)
|
||||
minetest.settings:set('movement_speed_walk',4)
|
||||
end)
|
||||
|
||||
scaffold.register_template_scaffold("headTriScaff", "scaffold_three_wide_head", function(pos)
|
||||
scaffold.place_if_able(turtle.dircoord(0, 3, 0))
|
||||
scaffold.place_if_able(turtle.dircoord(0, 3, 1))
|
||||
scaffold.place_if_able(turtle.dircoord(0, 3, -1))
|
||||
end)
|
||||
|
||||
scaffold.register_template_scaffold("QuintScaffold", "scaffold_five_wide", function(pos)
|
||||
scaffold.place_if_able(pos)
|
||||
scaffold.place_if_able(turtle.dircoord(0, -1, 1))
|
||||
scaffold.place_if_able(turtle.dircoord(0, -1, -1))
|
||||
scaffold.place_if_able(turtle.dircoord(0, -1, 2))
|
||||
scaffold.place_if_able(turtle.dircoord(0, -1, -2))
|
||||
end)
|
||||
end
|
||||
|
||||
if nlist then
|
||||
scaffold.register_template_scaffold("RandomScaff", "scaffold_rnd", function(below)
|
||||
|
@ -16,66 +16,68 @@ local tunnelmaterial = {
|
||||
'mcl_core:dirt',
|
||||
'mcl_core:andesite',
|
||||
'mcl_core:diorite',
|
||||
'mcl_core:granite'
|
||||
'mcl_core:granite',
|
||||
"mesecons_torch:redstoneblock"
|
||||
|
||||
}
|
||||
|
||||
|
||||
minetest.register_cheat("RailT",'Scaffold','scaffold_railtunnel')
|
||||
|
||||
minetest.register_cheat("RailT",'Bots','scaffold_railtunnel')
|
||||
local function checknode(pos)
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
if node and node.name ~="mesecons_torch:redstoneblock" and not node.name:find("_rail") then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
scaffold.register_template_scaffold("RailBot", "scaffold_rails", function(below)
|
||||
if not scaffold.wason.scaffold_rails then
|
||||
minetest.settings:set_bool('continuous_forward',true)
|
||||
--minetest.settings:set_bool('scaffold_locky',true)
|
||||
minetest.settings:set_bool('scaffold_lockyaw',true)
|
||||
minetest.settings:set_bool('scaffold_ltbm',true)
|
||||
local function dignodes(poss)
|
||||
for k,v in pairs(poss) do
|
||||
if checknode(v) then ws.dig(v) end
|
||||
end
|
||||
local lp = turtle.dircoord(0,1,0)
|
||||
|
||||
local fpos1=turtle.dircoord(1,2,0)
|
||||
local fpos2=turtle.dircoord(1,1,0)
|
||||
local fpos3=turtle.dircoord(1,0,0)
|
||||
|
||||
local fpos4=turtle.dircoord(2,1,0)
|
||||
local fpos5=turtle.dircoord(2,0,0)
|
||||
local fpos6=turtle.dircoord(2,-1,0)
|
||||
|
||||
if checknode(fpos1) then scaffold.dig(fpos1) end
|
||||
if checknode(fpos3) then scaffold.dig(fpos3) end
|
||||
if checknode(fpos2) then scaffold.dig(fpos2) end
|
||||
|
||||
local pos1=vector.add(lp,{x=-2,y=0,z=-2})
|
||||
local pos2=vector.add(lp,{x=2,y=4,z=2})
|
||||
end
|
||||
local function blockliquids()
|
||||
local lp=ws.lp:get_pos()
|
||||
local liquids={'mcl_core:lava_source','mcl_core:water_source','mcl_core:lava_flowing','mcl_core:water_flowing'}
|
||||
local liquids={'mcl_core:lava_source','mcl_core:water_source'}
|
||||
|
||||
local bn,cnt=minetest.find_nodes_in_area(pos1,pos2,liquids,false)
|
||||
local bn=minetest.find_nodes_near(lp, 5, liquids, true)
|
||||
for kk,vv in pairs(bn) do
|
||||
minetest.switch_to_item("mcl_nether:netherrack")
|
||||
minetest.place_node(vv)
|
||||
scaffold.place_if_needed(tunnelmaterial,vv)
|
||||
end
|
||||
end
|
||||
|
||||
local function invcheck(item)
|
||||
if mintetest.switch_to_item(item) then return true end
|
||||
refill.refill_at(ws.dircoord(1,1,0),'railkit')
|
||||
end
|
||||
|
||||
ws.rg("RailBot","Bots", "scaffold_rails", function()
|
||||
local lp = ws.dircoord(0,0,0)
|
||||
local below = ws.dircoord(0,-1,0)
|
||||
blockliquids()
|
||||
local dpos= {
|
||||
ws.dircoord(0,1,0),
|
||||
ws.dircoord(0,0,0),
|
||||
ws.dircoord(0,-1,0),
|
||||
ws.dircoord(1,1,0),
|
||||
ws.dircoord(1,0,0),
|
||||
ws.dircoord(1,-1,0),
|
||||
ws.dircoord(2,1,0),
|
||||
ws.dircoord(2,0,0),
|
||||
ws.dircoord(2,-1,0)
|
||||
}
|
||||
dignodes(dpos)
|
||||
local bln=minetest.get_node_or_nil(below)
|
||||
local lpn=minetest.get_node_or_nil(lp)
|
||||
|
||||
if bln and lpn and lpn.name == "mcl_minecarts:golden_rail_on" then
|
||||
--bln.name == "mesecons_torch:redstoneblock" and
|
||||
minetest.settings:set_bool('continuous_forward',true)
|
||||
else
|
||||
--if lpn and lpn.name then minetest.display_chat_message(lpn.name) end
|
||||
minetest.settings:set_bool('continuous_forward',false)
|
||||
end
|
||||
|
||||
minetest.after("0.1",function()
|
||||
local frpos=turtle.dircoord(1,1,0)
|
||||
local fgpos=turtle.dircoord(1,0,0)
|
||||
local rpos=turtle.dircoord(0,1,0)
|
||||
local gpos=turtle.dircoord(0,0,0)
|
||||
local it = core.find_item("mesecons_torch:redstoneblock")
|
||||
if not it then minetest.settings:set_bool('continuous_forward',false) end
|
||||
minetest.after("0",function()
|
||||
local frpos=ws.dircoord(1,0,0)
|
||||
local fgpos=ws.dircoord(1,-1,0)
|
||||
local rpos=ws.dircoord(0,0,0)
|
||||
local gpos=ws.dircoord(0,-1,0)
|
||||
scaffold.place_if_needed(ground, gpos)
|
||||
scaffold.place_if_needed(rails, rpos)
|
||||
scaffold.place_if_needed(ground, fgpos)
|
||||
@ -83,15 +85,38 @@ scaffold.register_template_scaffold("RailBot", "scaffold_rails", function(below)
|
||||
|
||||
end)
|
||||
if minetest.settings:get_bool('scaffold_railtunnel') then
|
||||
scaffold.place_if_needed(tunnelmaterial, turtle.dircoord(0,3,0))
|
||||
scaffold.place_if_needed(tunnelmaterial, turtle.dircoord(0,2,1))
|
||||
scaffold.place_if_needed(tunnelmaterial, turtle.dircoord(0,1,1))
|
||||
scaffold.place_if_needed(tunnelmaterial, turtle.dircoord(0,2,-1))
|
||||
scaffold.place_if_needed(tunnelmaterial, turtle.dircoord(0,1,-1))
|
||||
scaffold.place_if_needed(tunnelmaterial, ws.dircoord(0,2,0))
|
||||
scaffold.place_if_needed(tunnelmaterial, ws.dircoord(0,1,1))
|
||||
scaffold.place_if_needed(tunnelmaterial, ws.dircoord(0,0,1))
|
||||
scaffold.place_if_needed(tunnelmaterial, ws.dircoord(0,1,-1))
|
||||
scaffold.place_if_needed(tunnelmaterial, ws.dircoord(0,0,-1))
|
||||
end
|
||||
end,false,function()
|
||||
minetest.settings:set_bool('continuous_forward',false)
|
||||
minetest.settings:set_bool('scaffold_locky',false)
|
||||
minetest.settings:set_bool('scaffold_lockyaw',false)
|
||||
minetest.settings:set_bool('scaffold_ltbm',false)
|
||||
end)
|
||||
end,
|
||||
function()--startfunc
|
||||
|
||||
end,function() --stopfunc
|
||||
|
||||
end,{'scaffold_ltbm','snapyaw','continuous_forward'})
|
||||
|
||||
scaffold.register_template_scaffold("LanternTBM", "scaffold_ltbm", function()
|
||||
local dir=ws.getdir()
|
||||
local lp=vector.round(ws.dircoord(0,0,0))
|
||||
local pl=false
|
||||
if dir == "north" or dir == "south" then
|
||||
if lp.z % 8 < 1 then
|
||||
pl=true
|
||||
end
|
||||
else
|
||||
if lp.x % 8 < 1 then
|
||||
pl=true
|
||||
end
|
||||
end
|
||||
if pl then
|
||||
local lpos=ws.dircoord(0,2,0)
|
||||
local nd=minetest.get_node_or_nil(lpos)
|
||||
if nd and nd.name ~= 'mcl_ocean:sea_lantern' then
|
||||
ws.dig(lpos)
|
||||
minetest.after("0",function() ws.place(lpos,'mcl_ocean:sea_lantern') end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user