rework turtle policies
This commit is contained in:
@@ -49,7 +49,7 @@ equip('right', 'plethora:sensor', 'plethora:module:3')
|
||||
local sensor = device['plethora:sensor']
|
||||
|
||||
turtle.setMovementStrategy('goto')
|
||||
turtle.setPolicy(turtle.policies.attack)
|
||||
turtle.set({ attackPolicy = 'attack' })
|
||||
|
||||
local function findChests()
|
||||
if chest then
|
||||
|
||||
@@ -62,7 +62,7 @@ shell.openForegroundTab('spawner.lua %s')]], table.concat({ ... }, ' ')))
|
||||
end
|
||||
|
||||
turtle.setMovementStrategy('goto')
|
||||
turtle.setPolicy(turtle.policies.attack)
|
||||
turtle.set({ attackPolicy = 'attack' })
|
||||
|
||||
local function dropOff()
|
||||
local inv = turtle.getSummedInventory()
|
||||
|
||||
@@ -759,7 +759,10 @@ local tasks = {
|
||||
local s, m = turtle.run(function()
|
||||
turtle.reset()
|
||||
turtle.addFeatures('crafting')
|
||||
turtle.setPolicy("digAttack")
|
||||
turtle.set({
|
||||
attackPolicy = 'attack',
|
||||
digPolicy = 'dig',
|
||||
})
|
||||
|
||||
while not turtle.isAborted() do
|
||||
print('fuel: ' .. turtle.getFuelLevel())
|
||||
|
||||
@@ -517,7 +517,7 @@ local function fellTree(pt)
|
||||
|
||||
desperateRefuel(FUEL_BASE + 100)
|
||||
turtle.clearMoveCallback()
|
||||
turtle.setPolicy("attack")
|
||||
turtle.set({ attackPolicy = "attack" })
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -752,7 +752,7 @@ local tasks = {
|
||||
local s, m = turtle.run(function()
|
||||
|
||||
turtle.addFeatures('level', 'crafting')
|
||||
turtle.setPolicy("attack")
|
||||
turtle.set({ attackPolicy = "attack" })
|
||||
|
||||
while not turtle.isAborted() do
|
||||
print('fuel: ' .. turtle.getFuelLevel())
|
||||
|
||||
Reference in New Issue
Block a user