h
This commit is contained in:
parent
1ff3cea4d6
commit
5422d52065
21 changed files with 21953 additions and 369 deletions
12
computer/1/rebuildschematic.lua
Normal file
12
computer/1/rebuildschematic.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
fs.delete("tobuild")
|
||||
file = fs.open("tobuild","w")
|
||||
for i = -80,80,8 do
|
||||
for j = -150,150,8 do
|
||||
for k = -150,150,8 do
|
||||
if i > -48 or ((i == -48) and j >= 66) then
|
||||
file.writeLine(j..","..i..","..k)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
file.close()
|
|
@ -25,4 +25,3 @@ while true do
|
|||
--file = fs.open(filename,"r")
|
||||
--print(file.readAll())
|
||||
end
|
||||
|
||||
|
|
21754
computer/1/tobuild
21754
computer/1/tobuild
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,15 @@
|
|||
return {
|
||||
{
|
||||
name = "water",
|
||||
amount = 13100,
|
||||
amount = 32900,
|
||||
},
|
||||
{
|
||||
name = "blood",
|
||||
amount = 100,
|
||||
amount = 150,
|
||||
},
|
||||
{
|
||||
name = "still_milk",
|
||||
amount = 1000,
|
||||
amount = 2000,
|
||||
},
|
||||
{
|
||||
name = "lava",
|
||||
|
|
|
@ -131,12 +131,11 @@ function connectTankOrAssign(fluid)
|
|||
end
|
||||
|
||||
function connectTank(name)
|
||||
-- TODO only single tank, otherwise pipes break
|
||||
for index, tank in pairs(_G.fluidTanks) do
|
||||
if tank.name == name then
|
||||
if index == _G.connectTank then
|
||||
print("tank", name, index, "already connected")
|
||||
return
|
||||
break
|
||||
end
|
||||
goTo(tankPos[index])
|
||||
redstone.setOutput("bottom", true)
|
||||
|
@ -144,10 +143,9 @@ function connectTank(name)
|
|||
redstone.setOutput("bottom", false)
|
||||
_G.connectedTank = index
|
||||
print("tank", name, index, "already connected")
|
||||
return
|
||||
break
|
||||
end
|
||||
end
|
||||
saveFluids()
|
||||
end
|
||||
|
||||
function fluidInvAdd(name, amount)
|
||||
|
|
|
@ -14,6 +14,7 @@ compactor_pos = vector.new(-2,0,0)
|
|||
spout_pos = vector.new(-3,0,0)
|
||||
melter_pos = vector.new(-4,1,-3)
|
||||
casting_table_pos = vector.new(-3,0,-3)
|
||||
washer_pos = vector.new(3,0,-4)
|
||||
|
||||
function spout(extra_items)
|
||||
local fluid = extra_items[1]
|
||||
|
@ -123,9 +124,11 @@ function press(_)
|
|||
sleep(1)
|
||||
takeDepot()
|
||||
end
|
||||
function compact(extra_items)
|
||||
printError("unimplemented :3")
|
||||
sfx.fail()
|
||||
function compact(extra_items, product, yield)
|
||||
silly_temp = mixer_pos
|
||||
mixer_pos = compactor_pos
|
||||
mix(extra_items, product, yield)
|
||||
mixer_pos = silly_temp
|
||||
end
|
||||
function make_water(_,_,yield)
|
||||
selectFluidDevice("water_source")
|
||||
|
@ -170,18 +173,6 @@ function alloy(parts, product)
|
|||
for _, fluid in pairs(parts) do
|
||||
fluidInvAdd(fluid.name, -created_amount)
|
||||
end
|
||||
-- for _, fluid in pairs(parts) do
|
||||
|
||||
-- end
|
||||
-- TODO
|
||||
--[[
|
||||
wait until at least one input fluid is used up
|
||||
if two remain, it needs to keep track of which tank gets what when draining
|
||||
]]
|
||||
|
||||
-- while true do
|
||||
|
||||
-- end
|
||||
end
|
||||
function melt(_, product, yield)
|
||||
goTo(melter_pos, "north")
|
||||
|
@ -281,6 +272,20 @@ function craft(extra_items)
|
|||
turtle.craft()
|
||||
end
|
||||
|
||||
function wash(_, product)
|
||||
goTo(washer_pos, "east")
|
||||
insertDepot(1)
|
||||
repeat
|
||||
is_done = false
|
||||
for _,item in pairs(pFront("items")) do
|
||||
if stripModname(item.name) == product then
|
||||
is_done = true
|
||||
end
|
||||
end
|
||||
until is_done
|
||||
takeDepot()
|
||||
end
|
||||
|
||||
return {
|
||||
mill = mill,
|
||||
deploy = deploy,
|
||||
|
@ -295,4 +300,5 @@ return {
|
|||
saw = saw,
|
||||
spout = spout,
|
||||
make_water = make_water,
|
||||
wash = wash,
|
||||
}
|
|
@ -276,8 +276,8 @@ steps:
|
|||
mill wheat
|
||||
|
||||
blood
|
||||
yield 50
|
||||
base rotten_flesh
|
||||
yield 100
|
||||
base salmon
|
||||
steps:
|
||||
melt
|
||||
|
||||
|
@ -314,3 +314,55 @@ craft nil andesite_alloy nil andesite_alloy polished_rose_quartz andesite_alloy
|
|||
spout
|
||||
steps:
|
||||
craft copper_casing nil nil dried_kelp
|
||||
|
||||
brass_funnel
|
||||
steps:
|
||||
craft filter golden_sheet nil comparator observer nil andesite_tunnel andesite_funnel
|
||||
|
||||
filter
|
||||
steps:
|
||||
craft iron_nugget white_wool iron_nugget
|
||||
|
||||
iron_nugget
|
||||
yield 9
|
||||
steps:
|
||||
craft iron_ingot
|
||||
|
||||
golden_sheet
|
||||
base gold_ingot
|
||||
steps:
|
||||
press
|
||||
|
||||
andesite_tunnel
|
||||
yield 2
|
||||
steps:
|
||||
craft andesite_alloy andesite_alloy nil rubber rubber
|
||||
|
||||
andesite_funnel
|
||||
yield 2
|
||||
steps:
|
||||
craft andesite_alloy nil nil rubber
|
||||
|
||||
disk_drive
|
||||
steps:
|
||||
craft andesite_alloy andesite_alloy andesite_alloy andesite_alloy polished_rose_quartz andesite_alloy andesite_alloy polished_rose_quartz andesite_alloy
|
||||
|
||||
wet_sponge
|
||||
base sponge
|
||||
steps:
|
||||
wash
|
||||
|
||||
clay_ball
|
||||
base clay_block
|
||||
yield 4
|
||||
steps:
|
||||
deploy_tool flint_knife
|
||||
|
||||
clay_block
|
||||
steps:
|
||||
compact wet_sponge sand
|
||||
|
||||
salmon
|
||||
yield 0.25
|
||||
steps:
|
||||
compact wet_sponge
|
||||
|
|
18
computer/13/startup.lua
Normal file
18
computer/13/startup.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
|
||||
|
||||
parallel.waitForAny(
|
||||
function()
|
||||
shell.run("shell")
|
||||
end,
|
||||
function()
|
||||
while true do
|
||||
os.pullEvent("turtle_inventory")
|
||||
if math.random(100) > 95 then
|
||||
peripheral.call("left","playSound","entity.cat.ambient")
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
os.shutdown()
|
|
@ -1,6 +1,3 @@
|
|||
sw: fluid basin
|
||||
hw: spout
|
||||
sw: spout
|
||||
casting
|
||||
stock keeping
|
||||
multi-item crafting
|
||||
|
|
|
@ -93,6 +93,7 @@ function tryCreating(recipe)
|
|||
if len(missing_ingredients) == 0 then
|
||||
work_queue[#work_queue] = nil
|
||||
turtle.select(1)
|
||||
--peripheral.call("left","playSound","entity.cat.ambient")
|
||||
-- todo exclude deploy_tool too and make it get its own tool
|
||||
if recipe.steps[1].machine ~= "craft" and
|
||||
recipe.steps[1].machine ~= "alloy"
|
||||
|
|
|
@ -1,6 +1,30 @@
|
|||
tonk = peripheral.wrap("right")
|
||||
|
||||
redrouter = peripheral.wrap("redrouter_0")
|
||||
vault = peripheral.wrap("create:item_vault_0")
|
||||
while true do
|
||||
sleep(0.5)
|
||||
tonk.pushFluid("left",math.abs(300-tonk.tanks()[1].amount))
|
||||
lava = 0
|
||||
for i,v in pairs(tonk.tanks()) do
|
||||
lava = (lava or 0)
|
||||
+ ((
|
||||
(
|
||||
v.name == "minecraft:lava"
|
||||
)
|
||||
and
|
||||
v.amount
|
||||
)or 0 )
|
||||
end
|
||||
if lava > 300 then
|
||||
tonk.pushFluid("left",lava-300)
|
||||
end
|
||||
counts = {}
|
||||
for i,v in pairs(vault.items()) do
|
||||
counts[v.name] = (counts[v.name] or 0) + v.count
|
||||
end
|
||||
redrouter.setOutput(
|
||||
"bottom",
|
||||
((counts["minecraft:iron_nugget"] or 0) > 64)
|
||||
and
|
||||
((counts["techreborn:andesite_dust"] or 0) > 64)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -2,7 +2,8 @@ sf = require("structure")
|
|||
local pf = require("pathfinding")
|
||||
local im = require("inventorymanager")
|
||||
local origin = vector.new(-15,235,120)
|
||||
function build(x,y,z)
|
||||
function build(chunk)
|
||||
local x,y,z = stringtovec(chunk)
|
||||
store = {height = 0}
|
||||
grocerylist = {}
|
||||
for h = 1,8 do
|
||||
|
@ -27,14 +28,14 @@ function build(x,y,z)
|
|||
end
|
||||
end
|
||||
if store.height==0 then
|
||||
--print("cell at",x,y,z,"is done")
|
||||
removechunk(x,y,z)
|
||||
print("cell at",x,y,z,"is done")
|
||||
return true
|
||||
|
||||
end
|
||||
flag = false
|
||||
count = im.countinventory()
|
||||
for k,v in pairs(grocerylist) do
|
||||
if im.count(k) < v then
|
||||
if (count[k] or -1) < v then
|
||||
print("not enough "..k.." need "..v.." of it")
|
||||
flag = true
|
||||
end
|
||||
|
@ -49,11 +50,13 @@ function build(x,y,z)
|
|||
return false
|
||||
end
|
||||
pf.to(origin + vector.new(x+1,y+8,z+1))
|
||||
--print("going")
|
||||
--pf.to(origin+vector.new(1,1,1))
|
||||
--im.select("minecraft:barrel")
|
||||
--turtle.placeDown()
|
||||
for w = 1,8 do
|
||||
for h = 1,8 do
|
||||
print(store[h].width)
|
||||
for w = 1,store[h].width do
|
||||
print(store[h][w].depth)
|
||||
for d = 1,store[h][w].depth do
|
||||
for d = 1,8 do
|
||||
if store[h][w][d] then
|
||||
pf.to(origin+vector.new(x+w,y+h,z+d))
|
||||
im.select(store[h][w][d])
|
||||
|
@ -62,55 +65,21 @@ function build(x,y,z)
|
|||
end
|
||||
end
|
||||
end
|
||||
removechunk(x,y,z)
|
||||
return true
|
||||
end
|
||||
|
||||
function removechunk(x,y,z)
|
||||
|
||||
--::success::
|
||||
local file = fs.open("tobuild","r")
|
||||
local rest = {}
|
||||
line = file.readLine()
|
||||
while line do
|
||||
table.insert(rest,line)
|
||||
line = file.readLine()
|
||||
end
|
||||
file.close()
|
||||
file = fs.open("tobuild","w")
|
||||
str = tostring(vector.new(x,y,z))
|
||||
for _,v in ipairs(rest) do
|
||||
if v ~= str then
|
||||
file.writeLine(v)
|
||||
end
|
||||
end
|
||||
file.close()
|
||||
end
|
||||
function stringtovec(str)
|
||||
parts = {}
|
||||
for part in string.gmatch(str, "([^,]+)") do
|
||||
table.insert(parts, part)
|
||||
table.insert(parts, tonumber(part))
|
||||
end
|
||||
return vector.new(unpack(parts))
|
||||
return unpack(parts)
|
||||
end
|
||||
--pf.to(origin)
|
||||
file=fs.open("tobuild","r")
|
||||
chunk = file.readLine()
|
||||
file.close()
|
||||
print(chunk)
|
||||
vec = stringtovec(chunk)
|
||||
X1,Y1,Z1 = vec.x,vec.y,vec.z
|
||||
print(X1,Y1,Z1)
|
||||
while build(X1,Y1,Z1) do
|
||||
-- term.clear()
|
||||
print(X1,Y1,Z1)
|
||||
file = fs.open("tobuild","r")
|
||||
chunk = file.readLine()
|
||||
vec = stringtovec(chunk)
|
||||
X1,Y1,Z1 = vec.x,vec.y,vec.z
|
||||
file.close()
|
||||
--term.clear()
|
||||
sleep(0)
|
||||
end
|
||||
pf.returnHome()
|
||||
repeat
|
||||
rednet.send(1,nil,"getnexttobuild")
|
||||
print(chunk)
|
||||
_,chunk = rednet.receive("nexttobuild")
|
||||
until not build(chunk)
|
||||
|
||||
rednet.send(1,chunk,"failedtobuild")
|
||||
pf.returnHome()
|
||||
|
|
113
computer/3/inventorymanager
Normal file
113
computer/3/inventorymanager
Normal file
|
@ -0,0 +1,113 @@
|
|||
function count(name)
|
||||
local value = 0
|
||||
for i = 1,16 do
|
||||
local item = turtle.getItemDetail(i)
|
||||
if item and item.name == name then
|
||||
value = value + item.count
|
||||
end
|
||||
if item and item.name == "packages:package" then
|
||||
turtle.select(i)
|
||||
turtle.placeUp()
|
||||
sleep(.1)
|
||||
pack = peripheral.wrap("top")
|
||||
items = pack.list()
|
||||
for i,v in pairs(items) do
|
||||
if v.name == name then
|
||||
value = value + v.count
|
||||
end
|
||||
end
|
||||
turtle.digUp()
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
function countinventory()
|
||||
counts = {}
|
||||
for i = 1,16 do
|
||||
item = turtle.getItemDetail(i)
|
||||
if item then
|
||||
if item.name == "packages:package" then
|
||||
turtle.select(i)
|
||||
turtle.placeUp()
|
||||
sleep(0.1)
|
||||
for i,item2 in pairs(peripheral.call("top","list")) do
|
||||
write(item2.name,item2.count)
|
||||
counts[item2.name] =
|
||||
(counts[item2.name] or 0)
|
||||
+ item2.count
|
||||
print(counts[item2.name])
|
||||
end
|
||||
turtle.digUp()
|
||||
else
|
||||
counts[item.name] = counts[item.name] or 0 + item.count
|
||||
end end
|
||||
end
|
||||
return counts
|
||||
end
|
||||
function select(name)
|
||||
local flag = false
|
||||
for i = 1,16 do
|
||||
item = turtle.getItemDetail(i)
|
||||
if not item then
|
||||
flag = true
|
||||
end
|
||||
if item and item.name == name then
|
||||
turtle.select(i)
|
||||
return true
|
||||
end
|
||||
end
|
||||
for i = 1,16 do
|
||||
item = turtle.getItemDetail(i)
|
||||
if flag and item and item.name == "packages:package" then
|
||||
turtle.select(i)
|
||||
turtle.placeUp()
|
||||
sleep(0.1)
|
||||
items = peripheral.call("top","list")
|
||||
for i,v in pairs(items) do
|
||||
if v.name == name then
|
||||
turtle.suckUp(64)
|
||||
break
|
||||
end
|
||||
end
|
||||
turtle.digUp()
|
||||
for i = 1,16 do
|
||||
item = turtle.getItemDetail(i)
|
||||
if item and item.name == name then
|
||||
turtle.select(i)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
print("no"..name.."found")
|
||||
return false
|
||||
end
|
||||
|
||||
function pull(name, slot)
|
||||
slot = slot or turtle.getSelectedSlot()
|
||||
turtle.select(slot)
|
||||
i = 1
|
||||
item = turtle.getItemDetail(slot)
|
||||
while item and item.name~=name and i <=16 do
|
||||
turtle.transferTo(i)
|
||||
item = turtle.getItemDetail(slot)
|
||||
i = i+1
|
||||
end
|
||||
local flag = false
|
||||
for i = 1,16 do
|
||||
item = turtle.getItemDetail(i)
|
||||
if item and item.name == name then
|
||||
turtle.select(i)
|
||||
turtle.transferTo(slot)
|
||||
flag = true
|
||||
end
|
||||
end
|
||||
turtle.select(slot)
|
||||
if flag then
|
||||
return turtle.getItemCount(slot)
|
||||
end
|
||||
return error("there is no '"..name.."' in my inventory")
|
||||
end
|
||||
|
||||
return {pull=pull,count=count,select=select,countinventory = countinventory}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
home = vector.new(-250, 96, 108)
|
||||
home = vector.new(-2, 186, 126)
|
||||
up = vector.new(0,1,0)
|
||||
south = vector.new(0,0,1)
|
||||
east = vector.new(1,0,0)
|
||||
|
|
6
computer/3/recievefile.lua
Normal file
6
computer/3/recievefile.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
file = fs.open(arg[1],"w")
|
||||
repeat
|
||||
id,mess = rednet.receive()
|
||||
file.writeLine(mess)
|
||||
until not mess
|
||||
file.close()
|
|
@ -1,84 +0,0 @@
|
|||
_G.position = vector.new(-250,96,106)
|
||||
_G.facing = vector.new(-1,0,0)
|
||||
rednet.open("left")
|
||||
--old_print = _G.print
|
||||
--[[new_print = function(...)
|
||||
x = ""
|
||||
for i,v in ipairs(arg) do
|
||||
x = x..tostring(v).." "
|
||||
end
|
||||
old_print(x)
|
||||
rednet.broadcast(x)
|
||||
end]]
|
||||
--_G.print = new_print
|
||||
--rednet.host("tomfoolery",os.computerLabel())
|
||||
--while true do
|
||||
function append(tbl,value)
|
||||
table.insert(tbl,value)
|
||||
return tbl
|
||||
end
|
||||
rednet.host("tomfoolery",os.getComputerLabel())
|
||||
queue = {}
|
||||
history = {}
|
||||
if true then
|
||||
parallel.waitForAll(
|
||||
function()
|
||||
while true do
|
||||
--print("reading")
|
||||
while running do
|
||||
coroutine.yield()
|
||||
end
|
||||
write(
|
||||
shell.dir().."> "
|
||||
)
|
||||
table.insert(
|
||||
queue,
|
||||
append(
|
||||
history,
|
||||
not running and read(
|
||||
nil,
|
||||
history,
|
||||
shell.complete
|
||||
)
|
||||
)[#history]
|
||||
)
|
||||
sleep(0.05)--coroutine.yield()
|
||||
end
|
||||
end,
|
||||
function()
|
||||
while true do
|
||||
--print("attempting to run shell on :"..(queue[1] or ""))
|
||||
running = true
|
||||
shell.run(
|
||||
table.remove(
|
||||
queue,
|
||||
1
|
||||
)
|
||||
)
|
||||
running = false
|
||||
--term.clear()
|
||||
for i,v in pairs(queue) do
|
||||
--print(v)
|
||||
end
|
||||
sleep(0.05)
|
||||
end
|
||||
end,
|
||||
function()
|
||||
while true do
|
||||
--print("recieving")
|
||||
id,mess,kind = rednet.receive()
|
||||
if kind == "complete" then
|
||||
rednet.send(id,shell.complete(mess),"completed")
|
||||
elseif kind == "run" then
|
||||
print("recieved")
|
||||
print(id, mess, kind)
|
||||
table.insert(queue,mess)
|
||||
sleep(0.05)
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
rednet.receive()
|
|
@ -1,14 +1,85 @@
|
|||
_G.position = vector.new(-250,96,108)
|
||||
_G.position = vector.new(-2,186,126)
|
||||
_G.facing = vector.new(-1,0,0)
|
||||
rednet.open("left")
|
||||
old_print = _G.print
|
||||
new_print = function(...)
|
||||
--old_print = _G.print
|
||||
--[[new_print = function(...)
|
||||
x = ""
|
||||
for i,v in ipairs(arg) do
|
||||
x = x..tostring(v).." "
|
||||
end
|
||||
old_print(x)
|
||||
rednet.broadcast(x)
|
||||
end]]
|
||||
--_G.print = new_print
|
||||
--rednet.host("tomfoolery",os.computerLabel())
|
||||
--while true do
|
||||
function append(tbl,value)
|
||||
table.insert(tbl,value)
|
||||
return tbl
|
||||
end
|
||||
_G.print = new_print
|
||||
rednet.host("tomfoolery",os.computerLabel())
|
||||
rednet.host("tomfoolery",os.getComputerLabel())
|
||||
queue = {}
|
||||
history = {}
|
||||
if true then
|
||||
parallel.waitForAll(
|
||||
function()
|
||||
while true do
|
||||
--print("reading")
|
||||
while running do
|
||||
coroutine.yield()
|
||||
end
|
||||
write(
|
||||
shell.dir().."> "
|
||||
)
|
||||
table.insert(
|
||||
queue,
|
||||
append(
|
||||
history,
|
||||
not running and read(
|
||||
nil,
|
||||
history,
|
||||
shell.complete
|
||||
)
|
||||
)[#history]
|
||||
)
|
||||
sleep(0.05)--coroutine.yield()
|
||||
end
|
||||
end,
|
||||
function()
|
||||
while true do
|
||||
--print("attempting to run shell on :"..(queue[1] or ""))
|
||||
running = true
|
||||
shell.run(
|
||||
table.remove(
|
||||
queue,
|
||||
1
|
||||
)
|
||||
)
|
||||
running = false
|
||||
--term.clear()
|
||||
for i,v in pairs(queue) do
|
||||
--print(v)
|
||||
end
|
||||
sleep(0.05)
|
||||
end
|
||||
end,
|
||||
function()
|
||||
while true do
|
||||
--print("recieving")
|
||||
id,mess,kind = rednet.receive()
|
||||
if kind == "complete" then
|
||||
rednet.send(id,shell.complete(mess),"completed")
|
||||
elseif kind == "run" then
|
||||
print("recieved")
|
||||
print(id, mess, kind)
|
||||
table.insert(queue,mess)
|
||||
sleep(0.05)
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
rednet.receive()
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,20 +1,26 @@
|
|||
trees = {
|
||||
vector.new(-261, 95, 119),
|
||||
vector.new(-258, 95, 124),
|
||||
vector.new(-264, 95, 124),
|
||||
vector.new(-265, 95, 121),
|
||||
vector.new(-263, 94, 116),
|
||||
vector.new(-265, 94, 107),
|
||||
vector.new(-263, 94, 104),
|
||||
vector.new(-261,94,94),
|
||||
vector.new(-259,94,100),
|
||||
vector.new(-257,94,103)
|
||||
vector.new(-12,193,174),
|
||||
vector.new(-6,191,165),
|
||||
vector.new(-5,194,172),
|
||||
vector.new(-11,189,162),
|
||||
vector.new(-16,187,161),
|
||||
vector.new(-9,188,156),
|
||||
vector.new(-17,185,154),
|
||||
vector.new(-9,186,149),
|
||||
vector.new(-13,183,146),
|
||||
vector.new(-7,183,143),
|
||||
vector.new(0,186,144),
|
||||
vector.new(-3,189,153),
|
||||
vector.new(0,191,161),
|
||||
vector.new(3,193,168),
|
||||
vector.new(4,190,155),
|
||||
vector.new(4,189,150)
|
||||
}
|
||||
pf = require("pathfinding")
|
||||
im = require("inventorymanager")
|
||||
function fell(index)
|
||||
im.select("techreborn:rubber_sapling")
|
||||
print("going towards tree")
|
||||
|
||||
pf.lookat(trees[index or math.random(#trees)])
|
||||
has, data = turtle.inspect()
|
||||
--print(has,data)
|
||||
|
@ -40,6 +46,7 @@ end
|
|||
for i = 1,#trees do
|
||||
fell(i)
|
||||
end
|
||||
pf.to(pf.home+vector.new(0,10,0))
|
||||
pf.returnHome()
|
||||
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ function returnhome()
|
|||
_G.position = position
|
||||
end
|
||||
function lookat(target)
|
||||
print("lookat")
|
||||
print("lookat"..target:tostring())
|
||||
while (position+facing).x ~= target.x
|
||||
or (position+facing).z ~= target.z do
|
||||
greedystep(target)
|
||||
|
|
|
@ -2,8 +2,8 @@ file = fs.open(arg[1],"r")
|
|||
line = file.readLine()
|
||||
while line do
|
||||
print(line)
|
||||
rednet.send(1,line)
|
||||
rednet.broadcast(line)
|
||||
line = file.readLine()
|
||||
end
|
||||
rednet.send(1,nil)
|
||||
rednet.broadcast(nil)
|
||||
file.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue