add refuling to rcturtle

This commit is contained in:
LordMZTE 2022-03-06 00:31:33 +01:00
parent 6fa0e011d7
commit f005a9eee8
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -48,6 +48,15 @@ local actions = {
[keys.c] = function() [keys.c] = function()
send_remote(turtle.suck()) send_remote(turtle.suck())
end, end,
[keys.f] = function()
sendRemote "Refueling"
for i = 1, 16 do
sendRemote(i)
turtle.select(i)
turtle.refuel()
end
sendRemote "Refueled"
end,
[keys.i] = function() [keys.i] = function()
for i = 1, 16 do for i = 1, 16 do
turtle.select(i) turtle.select(i)
@ -104,9 +113,8 @@ while true do
print(msg) print(msg)
end, function() end, function()
local _, key = os.pullEvent "key" local _, key = os.pullEvent "key"
local action = actions[key]; local action = actions[key]
if action then if action then
reset_output()
send(action) send(action)
end end
end, function() end, function()