Files

35 lines
1.1 KiB
Lua

-- play_keys.lua -- drive the real game through its move, panels and quit
-- paths. play_keys.sh runs one PLAY_MODE per invocation and parses the DIAG
-- loops/events/last/focus/rev/quit line.
local dir = (debug.getinfo(1, "S").source:gsub("^@", ""):match("^(.*)/") or ".")
local H = dofile(dir .. "/harness.lua")
local MODE = os.getenv("PLAY_MODE") or "move"
print("PLAYKEYS: mode=" .. MODE)
H.key(2900, ":tablet:TABLET_X", "Tablet X", 700)
H.key(2900, ":tablet:TABLET_Y", "Tablet Y", 500, "PLAYKEYS: move")
H.key(3000, ":tablet:TABLET_BTN", "P1 Button 1", 1, "PLAYKEYS: click down")
H.key(3020, ":tablet:TABLET_BTN", "P1 Button 1", 0, "PLAYKEYS: click up")
if MODE == "move" then
H.sequence(3100, 20, {
{ ":lk401:K26", "A" },
{ ":lk401:K28", "D" },
{ ":lk401:K27", "S" },
{ ":lk401:K14", "W" },
{ ":lk401:K10", "0 )" },
})
elseif MODE == "panels" then
H.sequence(3100, 20, {
{ ":lk401:K31", "H" },
{ ":lk401:K16", "R" },
})
elseif MODE == "quit" then
H.message(3095, "PLAYKEYS: quit arm")
H.key(3100, ":lk401:K13", "Q", 1, "PLAYKEYS: Q down")
H.key(3110, ":lk401:K13", "Q", 0, "PLAYKEYS: Q up")
end
H.run()