network sniffer
This commit is contained in:
@@ -31,7 +31,7 @@ local page = UI.Page {
|
|||||||
{ heading = 'Status', key = 'status' },
|
{ heading = 'Status', key = 'status' },
|
||||||
{ heading = 'Fuel', key = 'fuel' },
|
{ heading = 'Fuel', key = 'fuel' },
|
||||||
},
|
},
|
||||||
sortColumn = 'label',
|
sortColumn = 'distance',
|
||||||
autospace = true,
|
autospace = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ local function hijackTurtle(remoteId)
|
|||||||
local hijack = { }
|
local hijack = { }
|
||||||
for _,method in pairs(methods) do
|
for _,method in pairs(methods) do
|
||||||
hijack[method] = function(...)
|
hijack[method] = function(...)
|
||||||
socket:write({ fn = method, args = { ... } })
|
socket:write({ method, ... })
|
||||||
local resp = socket:read()
|
local resp = socket:read()
|
||||||
if not resp then
|
if not resp then
|
||||||
error('timed out: ' .. method)
|
error('timed out: ' .. method)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ local function hijackTurtle(remoteId)
|
|||||||
local hijack = { }
|
local hijack = { }
|
||||||
for _,method in pairs(methods) do
|
for _,method in pairs(methods) do
|
||||||
hijack[method] = function(...)
|
hijack[method] = function(...)
|
||||||
socket:write({ fn = method, args = { ... } })
|
socket:write({ method, ... })
|
||||||
local resp = socket:read()
|
local resp = socket:read()
|
||||||
if not resp then
|
if not resp then
|
||||||
error('timed out: ' .. method)
|
error('timed out: ' .. method)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ if not turtle.select('minecraft:bucket') then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local s, m = turtle.run(function()
|
local s, m = turtle.run(function()
|
||||||
|
turtle.set({ 'status', 'refueling' })
|
||||||
turtle.setMovementStrategy('goto')
|
turtle.setMovementStrategy('goto')
|
||||||
|
|
||||||
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
|
local facing = scanner.getBlockMeta(0, 0, 0).state.facing
|
||||||
@@ -58,6 +59,7 @@ end)
|
|||||||
turtle.gotoY(0)
|
turtle.gotoY(0)
|
||||||
turtle.go({ x = 0, y = 0, z = 0 })
|
turtle.go({ x = 0, y = 0, z = 0 })
|
||||||
|
|
||||||
|
turtle.set({ 'status', 'idle' })
|
||||||
turtle.unequip('left')
|
turtle.unequip('left')
|
||||||
print('Fuel: ' .. turtle.getFuelLevel())
|
print('Fuel: ' .. turtle.getFuelLevel())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user