modify digger script
This commit is contained in:
parent
234e769fe9
commit
42b098cbb7
|
|
@ -72,6 +72,11 @@ local function drawui()
|
||||||
name="btnyinc",
|
name="btnyinc",
|
||||||
label="y+",
|
label="y+",
|
||||||
Y=1.6, X=0.8, H=0.8, W=1.2,
|
Y=1.6, X=0.8, H=0.8, W=1.2,
|
||||||
|
},{
|
||||||
|
command="addbutton",
|
||||||
|
name="btnup",
|
||||||
|
label="^",
|
||||||
|
Y=1.6, X=0, H=0.8, W=0.6,
|
||||||
},{
|
},{
|
||||||
command="addbutton",
|
command="addbutton",
|
||||||
name="btnzinc",
|
name="btnzinc",
|
||||||
|
|
@ -151,17 +156,15 @@ updatepositionui()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function sendmessage(msg)
|
local function sendmessage(msg)
|
||||||
if not mem.orderId then return end
|
digiline_send("q1", msg)
|
||||||
local str = "q" .. tostring(mem.orderId)
|
digiline_send("q2", msg)
|
||||||
digiline_send(str, msg)
|
digiline_send("q3", msg)
|
||||||
-- digiline_send("q2", msg)
|
digiline_send("q4", msg)
|
||||||
-- digiline_send("q3", msg)
|
digiline_send("q5", msg)
|
||||||
-- digiline_send("q4", msg)
|
digiline_send("q6", msg)
|
||||||
-- digiline_send("q5", msg)
|
digiline_send("q7", msg)
|
||||||
-- digiline_send("q6", msg)
|
digiline_send("q8", msg)
|
||||||
-- digiline_send("q7", msg)
|
digiline_send("q9", msg)
|
||||||
-- digiline_send("q8", msg)
|
|
||||||
-- digiline_send("q9", msg)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function displayQuarryStatus(mon, msg, name)
|
local function displayQuarryStatus(mon, msg, name)
|
||||||
|
|
@ -186,6 +189,7 @@ end
|
||||||
if event.type == "program" then
|
if event.type == "program" then
|
||||||
mem.position = {x = 0, y = 0, z=0}
|
mem.position = {x = 0, y = 0, z=0}
|
||||||
mem.target = {x = 0, y = 0, z=0}
|
mem.target = {x = 0, y = 0, z=0}
|
||||||
|
mem.radius = 8
|
||||||
mem.step = 17
|
mem.step = 17
|
||||||
mem.sim = false
|
mem.sim = false
|
||||||
mem.msg = ""
|
mem.msg = ""
|
||||||
|
|
@ -224,7 +228,8 @@ elseif event.type == "digiline" and event.channel == "jumpdrive" then
|
||||||
elseif event.type == "interrupt" then
|
elseif event.type == "interrupt" then
|
||||||
digiline_send("pmhv", "get")
|
digiline_send("pmhv", "get")
|
||||||
digiline_send("nuclear", "get")
|
digiline_send("nuclear", "get")
|
||||||
sendmessage("GET")
|
local str = "q" .. tostring(mem.orderId)
|
||||||
|
digiline_send(str, "get")
|
||||||
mem.orderId = mem.orderId + 1
|
mem.orderId = mem.orderId + 1
|
||||||
if mem.orderId > 9 then mem.orderId = 1 end
|
if mem.orderId > 9 then mem.orderId = 1 end
|
||||||
interrupt(5)
|
interrupt(5)
|
||||||
|
|
@ -238,6 +243,9 @@ elseif event.type == "digiline" and event.channel == "touch" then
|
||||||
if mem.step < 1 then
|
if mem.step < 1 then
|
||||||
mem.step = 1
|
mem.step = 1
|
||||||
end
|
end
|
||||||
|
elseif event.msg.btnup then
|
||||||
|
local y = mem.target.y + mem.radius
|
||||||
|
digiline_send("jumpdrive", { command = "set", key = "y", value = y })
|
||||||
elseif event.msg.btnxinc then
|
elseif event.msg.btnxinc then
|
||||||
local x = mem.target.x + mem.step
|
local x = mem.target.x + mem.step
|
||||||
digiline_send("jumpdrive", { command = "set", key = "x", value = x })
|
digiline_send("jumpdrive", { command = "set", key = "x", value = x })
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user