add refuling to rcturtle
This commit is contained in:
parent
6fa0e011d7
commit
f005a9eee8
|
@ -48,6 +48,15 @@ local actions = {
|
|||
[keys.c] = function()
|
||||
send_remote(turtle.suck())
|
||||
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()
|
||||
for i = 1, 16 do
|
||||
turtle.select(i)
|
||||
|
@ -104,22 +113,21 @@ while true do
|
|||
print(msg)
|
||||
end, function()
|
||||
local _, key = os.pullEvent "key"
|
||||
local action = actions[key];
|
||||
local action = actions[key]
|
||||
if action then
|
||||
reset_output()
|
||||
send(action)
|
||||
end
|
||||
end, function()
|
||||
local _, char = os.pullEvent "char"
|
||||
local slots = {
|
||||
["0"] = 10,
|
||||
["/"] = 11,
|
||||
["*"] = 12,
|
||||
["-"] = 13,
|
||||
["+"] = 14,
|
||||
[","] = 15,
|
||||
["."] = 16,
|
||||
}
|
||||
local slots = {
|
||||
["0"] = 10,
|
||||
["/"] = 11,
|
||||
["*"] = 12,
|
||||
["-"] = 13,
|
||||
["+"] = 14,
|
||||
[","] = 15,
|
||||
["."] = 16,
|
||||
}
|
||||
|
||||
if slots[char] then
|
||||
set_slot(slots[char])
|
||||
|
|
Loading…
Reference in a new issue