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