|
s25519 發表於 May 23, 2016 20:48:04 GMT
想問一下,
targetOffset 是不是只可能用在 Pattern 上? 有沒有其他範例?
如果我已經找到一個 match, 我要怎樣才可以 click 一個 offset 的位置?
請 Ankulua 大大幫忙!
|
|
|
AnkuLua 發表於 May 23, 2016 23:05:33 GMT
想問一下, targetOffset 是不是只可能用在 Pattern 上? 有沒有其他範例? 如果我已經找到一個 match, 我要怎樣才可以 click 一個 offset 的位置? 請 Ankulua 大大幫忙! match = find("target.png") click(match:targetOffset(100, 200)) -- 位移 (100, 200)
|
|
|
s25519 發表於 May 24, 2016 3:31:44 GMT
想問一下, targetOffset 是不是只可能用在 Pattern 上? 有沒有其他範例? 如果我已經找到一個 match, 我要怎樣才可以 click 一個 offset 的位置? 請 Ankulua 大大幫忙! match = find("target.png") click(match:targetOffset(100, 200)) -- 位移 (100, 200) 我是使用別人的 function 來做的, 可是不行, 請 Ankulua 大大幫忙看看如何修改. skillList = {
"skill_card1.png",
"skill_card2.png",
"skill_card3.png",
"skill_card3_1.png",
"skill_card4.png",
"skill_card5.png"
}
function waitMulti(target, seconds, reg)
local timer = Timer()
while (true) do
usePreviousSnap(true)
for i, t in ipairs(target) do
match = reg:exists(t, 0)
if (match) then -- check once
--toast("Find i="..i..", t="..t..", score="..match:getScore())
usePreviousSnap(false)
return t, reg:getLastMatch()
end
end
usePreviousSnap(false)
if (timer:check() > seconds) then return -1 end
end
end
choice, listMatch = waitMulti(skillList, 0.1, region8)
if (choice ~= -1) then
region8:getLastMatch():highlight(0.5)
region8:click(listMatch:targetOffset(0, 20))
end
|
|
|
AnkuLua 發表於 May 24, 2016 8:46:45 GMT
資訊不足 無法幫忙
|
|
|
s25519 發表於 May 24, 2016 9:08:38 GMT
Error 是說我這句語法有問題。 region8:click(listMatch:targetOffset(0, 20)) 請問大大須要什麼資訊才足夠? region8 是 define 了畫面的共中一個部份。 而 listMatch 就應該是 choice, listMatch = waitMulti(skillList, 0.1, region8) 這一行找出來的對應位置,是嗎? 抱歉因為我是初學,很多地方都不懂。
|
|