kkris
New Member
Posts: 2
|
kkris 發表於 Jul 12, 2019 8:13:50 GMT
我是純粹截圖錄製的, 所以想請教一下有方法加插getcolor指令令到第8項的點擊如果看見圖8drop.png不是灰色就不用再自動點擊嗎? 謝謝了
------ 8 ----- touchList[index] = {target = "8.png", region = Region(388, 344, 22, 22), id = "8", action = 'existsClick("8drop.png")',
target2 = "8drop.png", region2 = Region(604, 320, 22, 22)} index = index + 1
|
|
|
AnkuLua 發表於 Jul 12, 2019 22:33:27 GMT
action = 'R, G, B = getColor("8drop.png"); if (R ~= G or R ~=B or G ~= B) then existsClick("8drop.png") end'
|
|
|
hong0o0 發表於 Sept 6, 2019 9:45:58 GMT
為什麼我弄不到? 要怎麼才可以弄到截圖彩色的? 還有同一個位置要怎麼才能設灰色才按彩色不按?
----- created by AnkuLua snap and play script ------
immersive = true
setImmersiveMode(immersive)
genVersion = "8.5.2-pro2"
setAutoGameArea = true
pcall (autoGameArea, setAutoGameArea)
scriptDimension = 2220
Settings:setScriptDimension(true, scriptDimension)
Settings:setCompareDimension(true, scriptDimension)
local index = 1
touchList = {}
waitList = {}
------ 1 -----
touchList[index] = {target = "9.png"), region = Region(1756, 889, 300, 300), id = "1", action = 'R, G, B = getColor("9.png"); if (R == G or R ==B or G == B) then 'Click("9.png")'}
index = index + 1
|
|
|
AnkuLua 發表於 Sept 6, 2019 10:24:16 GMT
建議您將R, G, B 印出來看看 有時只是看來像灰階,未必真的是灰階 action = 'R, G, B = getColor("9.png"); print("R = " + R + ", G = " + ", B = " + B); if (R == G or R ==B or G == B) then 'Click("9.png")'
|
|
|
hong0o0 發表於 Sept 12, 2019 5:39:18 GMT
----- created by AnkuLua snap and play script ------
immersive = true
setImmersiveMode(immersive)
genVersion = "8.5.2-pro2"
setAutoGameArea = true
pcall (autoGameArea, setAutoGameArea)
scriptDimension = 2220
Settings:setScriptDimension(true, scriptDimension)
Settings:setCompareDimension(true, scriptDimension)
local index = 1
touchList = {}
waitList = {}
------ 1 -----
touchList[index] = {target = "1.png", region = nil, id = "1", action = 'click'}
index = index + 1
------ 2 -----
touchList[index] = {target = "2.png", region = Region(1551, 446, 180, 180), id = "2", action = 'click'}
index = index + 1
------ 3 -----
touchList[index] = {target = "8.png", region = Region(1633, 800, 300, 300), id = "3", action = 'click'}
index = index + 1
------ 4 -----
touchList[index] = {target = "9.png"), region = Region(1756, 889, 300, 300), id = "4", action = 'R, G, B = getColor("9.png"); print("R = " + R + ", G = " + ", B = " + B); if (R == G or R ==B or G == B) then 'Click("9.png")'}
index = index + 1
Runtime error:XXXXX/snapandplay/luar/XXX.luar:27: '}' expected near ')' in function 'dofile' XXXX/snapandplay.lua:1097: in function 'playback' XXXXX/snapandplay.lua:1277: in main chunk
請問是什麼問題呢? 直接是打開不了
還有想請問一下要怎麼設dragdrop timing?
|
|
|
AnkuLua 發表於 Sept 12, 2019 7:48:58 GMT
您的編輯有錯,應該是 touchList[index] = {target = "9.png", region = Region(1756, 889, 300, 300), id = "4", action = 'R, G, B = getColor("9.png"); print("R = " + R + ", G = " + ", B = " + B); if (R == G or R ==B or G == B) then Click("9.png")'}
要設dragdrop timing 直接在開頭加下列即可 setDragDropTiming(500, 600) -- 500, 600 改成您需要的數字即可
|
|
|
hong0o0 發表於 Sept 12, 2019 17:42:49 GMT
那大大請問下要怎麼可以在指定Target跑某個腳本..腳本完成後跳回原腳本繼續進行下一個動作? 還有要用什麼指令來代表完成跳回原腳本?
|
|
|
hong0o0 發表於 Sept 12, 2019 19:14:41 GMT
請教一下Getcolor還是卡住了為什麼?
------ autofight ----- touchList[index] = {target = "auto.png", region = Region(1787, 854, 160, 160), id = "4", action = 'R, G, B = getColor("auto.png"); print("R = " + R + ", G = " + ", B = " + B); if (R == G or R == B or G == B) then click("auto.png")'} index = index + 1
Runtime error:XXXXX/snapandplay/luar:1225: [string "R, G, B = getColor("auto.png"); print("R = " + R + ", G = " + ", B = " + B..."]:1: 'end' expected near '<eof>'
in function 'assert' XXXX/snapandplay.lua:1225: in function 'playback' XXXXX/snapandplay.lua:1277:
|
|
|
AnkuLua 發表於 Sept 13, 2019 0:07:15 GMT
少了一個end
touchList[index] = {target = "auto.png", region = Region(1787, 854, 160, 160), id = "4", action = 'R, G, B = getColor("auto.png"); print("R = " + R + ", G = " + ", B = " + B); if (R == G or R == B or G == B) then click("auto.png") end'}
|
|