|
gene 發表於 May 28, 2020 7:04:49 GMT
在 snapAndPlay 結束訊息時有發現會列出
1:3 2:1 3:0
find 1 find 2 find 1 find 1
這些 id 的搜尋次數
想問一下,如果在腳本執行中,去取得這些次數
預計是想透過取得次數的多少,來執行某個動作
謝謝
|
|
|
AnkuLua 發表於 May 28, 2020 9:11:36 GMT
pngTimesList[ i ]
|
|
|
gene 發表於 May 28, 2020 10:39:01 GMT
stopMessage = stopMessage .. touchList .id..": "..pngTimesList .."\n"
這段 code 其實我有找到
但我主要是想知道要怎麼用在錄製下來的那邊
------ 5 ----- touchList[index] = {target = "atk_ok.png", region = Region(0, 0, 220, 200), id = "2", action = 'click'} index = index + 1
action 部份要怎麼改 ?
如果要取得 id 2 的次數,是 pngTimesList 的 i 值傳入 2 嗎 ?
|
|
|
AnkuLua 發表於 May 28, 2020 11:41:05 GMT
首先需要把snapAndPlay.lua 中1152行的local 拿掉 local choice, id, match = regionWaitMulti(touchList, 30, debug, nil, index) 成為 choice, id, match = regionWaitMulti(touchList, 30, debug, nil, index)
同樣的1139行原本的 local pngTimesList = {} 改成 pngTimesList = {}
然後action可以改成 action = 'if (pngTimesList[choice] == 5) then ... 您想做的事 ... end'
|
|
|
gene 發表於 May 28, 2020 17:25:52 GMT
首先需要把snapAndPlay.lua 中1152行的local 拿掉 local choice, id, match = regionWaitMulti(touchList, 30, debug, nil, index) 成為 choice, id, match = regionWaitMulti(touchList, 30, debug, nil, index) 同樣的1139行原本的 local pngTimesList = {} 改成 pngTimesList = {} 然後action可以改成 action = 'if (pngTimesList[choice] == 5) then ... 您想做的事 ... end' 感謝回應 原來取得的參數是 choice 已經應用到實際的方面了,謝謝
|
|
|
gene 發表於 May 29, 2020 1:19:00 GMT
另外請教一下,如果要取得其它 id 次數的選擇又該作什麼呢 ?? 是否可以指定 id 名稱,直接取得目前的次數 ?
------ 1 ----- touchList[index] = {target = "map.png", region = Region(174, 562, 200, 200), id = "map", action = 'MapRun()'} index = index + 1
------ 2 ----- touchList[index] = {target = "atk.png", region = Region(1056, 521, 220, 200), id = "attack", action = 'RunFight(); click(matchResult);'}
------ 3 ----- touchList[index] = {target = "atk_ok.png", region = Region(0, 0, 220, 200), id = "combo", action = 'click'} index = index + 1
pngTimesList[choice] 的方式只能讓我取得當下尋找到的 id 次數 如果我在 id attack 的時候,想取得 id combo 的目前的次數又該如何作 ??
|
|
|
AnkuLua 發表於 May 29, 2020 1:26:55 GMT
另外請教一下,如果要取得其它 id 次數的選擇又該作什麼呢 ?? 是否可以指定 id 名稱,直接取得目前的次數 ? 目前無法直接用id 名稱取得次數 簡單一點就是直接看對應id 的index 數字多少
|
|