|
Post by derricksrs on Aug 17, 2018 3:16:27 GMT
My script is as follows: but i encounter error : syntax error: .......testfarm.lua:2:'then'expected near'=' Why huh? and also I would like to know how to use the timer. Lets say I would like to perfect use skill in every 10minutes. Would it be possible? Timer With object timer, users can know the time consumed in some period. Following methods are provided, set() Reset the timer. Return value: the time (in seconds) from timer constructed or previous set. check() Return value: the time (in seconds) from timer constructed or previous set. Read more: ankulua.boards.net/thread/13/advanced-methods#ixzz5OOxvGkX1while 1 do if x=1,19 do if j=1,2 do longClick("attackskill.png", math.random(15,17)) stopLongClick() end longClick("right.png", math.random(0.1,0.3)) if j=1,2 do longClick("attackskill.png", math.random(15,17)) stopLongClick() end longClick("left.png", math.random(0.1,0.3)) if j=1,2 do longClick("attackskill.png", math.random(15,17)) stopLongClick() end end end existsClick(Pattern("switchskill.png"), 0.1) existsClick(Pattern("skill2.png"), math.random(0.1,0.2)) existsClick(Pattern("skill3.png"), math.random(0.1,0.2)) existsClick(Pattern("skill4.png"), math.random(0.1,0.2)) existsClick(Pattern("skill5.png"), math.random(0.1,0.2)) existsClick(Pattern("skill6.png"), math.random(0.1,0.2)) existsClick(Pattern("switchskill.png"), 0.1) wait(math.random(0.4,0.6)
|
|
|
Post by AnkuLua on Aug 17, 2018 4:04:25 GMT
It seems that you want for loop. It should be
for x = 1,19 do
instead of
if x = 1, 19 do
|
|
|
Post by derricksrs on Aug 17, 2018 6:21:37 GMT
Hi Noted, Tested working fine.
|
|
|
Post by derricksrs on Aug 17, 2018 6:56:03 GMT
I realised that sometimes it click sometimes it doesn't on the picture. i have already set Settings:set("MinSimilarity", 0.40)
How to get target picture coordinate and save it into example local atkskill?
and check whether coordinate save or not if not retry?
|
|
|
Post by derricksrs on Aug 17, 2018 7:21:49 GMT
Hi Ankulua,
Can it be like this?
action,loc,touch=getTouchEvent() locatkskill=Location(loc:getX(), loc:getY())
|
|
|
Post by AnkuLua on Aug 17, 2018 14:39:41 GMT
You can use following to debug
if (exists("target.pnt")) then getLastMatch:highlight(1) -- highlight what's found click(getLastMatch()) print ("target.png") -- for debugging after stopping script end
|
|
|
Post by derricksrs on Aug 17, 2018 23:37:51 GMT
Alright thanks
|
|