bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 9, 2017 23:57:54 GMT
here are 2 type I have tried
function Check() if Tap then if (not exists("Stop.png", 1)) then sleep(0.2) Check() else stopLongClick() sleep(0.6) Tap = False Check() end else longClick("Attack.png") Tap = True end end
function Check() if (exists("Fighting.png", 1)) then longClick("Attack.png") Tap = True waitClick("Stop.png") stopLongClick() wait(0.3) Check() else wait(1) Check() end end both script didn't stopLongClick when Stop.png appears because it checked very long interval. and second one couldn't wait until Stop.png appears because it appears too late.
What I should do? Do I must use one of setScanInterval(seconds), setScanRate(frequency), getScanInterval(), getScanRate() ? If so, could you make example? After test, I will pay license.
|
|
|
Post by zenkrye on Dec 11, 2017 14:37:46 GMT
Have you tried it with removing your sleep and wait commands. You are are looking at 1.1 seconds in waiting time right there. That is over the .3 time you are looking for.
|
|
|
Post by Exilereven on Dec 11, 2017 17:29:45 GMT
Have tried using manual touch?
As far as I know using click calls the command each time you use it.
Using something like manual touch you can setup your touches to be exactly spaced. And it only has to call touch 1 time, less overhead.
function screenRight() local loc_left = Location(237, 600) local loc_right = Location(1644, 535) local move = { { action = "touchDown", target = loc_right }, { action = "wait", target = 0.2 }, { action = "touchMove", target = loc_left }, { action = "touchUp", target = loc_left }, }
setManualTouchParameter(5, 1) manualTouch(move) end
Something like this would swipe your screen left.
I'm not professional yet, but maybe this will help lead to what your wanting.
|
|
bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 12, 2017 19:56:31 GMT
Have you tried it with removing your sleep and wait commands. You are are looking at 1.1 seconds in waiting time right there. That is over the .3 time you are looking for. I already did it but it repeated 1 second.
|
|
bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 12, 2017 20:03:09 GMT
Have tried using manual touch? As far as I know using click calls the command each time you use it. Using something like manual touch you can setup your touches to be exactly spaced. And it only has to call touch 1 time, less overhead. function screenRight() local loc_left = Location(237, 600) local loc_right = Location(1644, 535) local move = { { action = "touchDown", target = loc_right }, { action = "wait", target = 0.2 }, { action = "touchMove", target = loc_left }, { action = "touchUp", target = loc_left }, } setManualTouchParameter(5, 1) manualTouch(move) end Something like this would swipe your screen left. I'm not professional yet, but maybe this will help lead to what your wanting. Oh, I didn't use it. It looks difficult but I will try. thanks. It looks like difining ACTION to touch and wait and touch. When screenRight(), ACTION will be active. right?
|
|
|
Post by Exilereven on Dec 12, 2017 20:04:46 GMT
If you run that function, it would swipe the screen left and then stop.
Try adding your own stuff, and adjusting the wait times see what you come up with.
|
|
|
Post by Exilereven on Dec 12, 2017 20:11:02 GMT
As soon as you fire the manualTouch(move)
It would fire off everything within the move table.
Move = {
}
Anything inside of those brackets will get fired in the order they are in.
|
|
bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 12, 2017 20:19:42 GMT
If you run that function, it would swipe the screen left and then stop. Try adding your own stuff, and adjusting the wait times see what you come up with. Oh it works. but how I can do it repeat? function Check() screenRight() -- I modify this to only touch one location. Check() -- I want to make check agaion and touch again. end It didn't loop.
|
|
bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 12, 2017 20:23:40 GMT
As soon as you fire the manualTouch(move) It would fire off everything within the move table. Move = { } Anything inside of those brackets will get fired in the order they are in. I did it. but I want to go to Check() again. function Check()
if (exists("Fighting.png", 1)) then
screenRight() Check()
else
Check()
end
end
function screenRight() -- I will change name later.
local locCenter = Location(237, 600)
local move = {
{ action = "touchDown", target = locCenter },
{ action = "wait", target = taptime },
{ action = "touchUp", target = locCenter },
}
setManualTouchParameter(1, 1)
manualTouch(move)
end Oh finished... but.. nevertheless.. Check() is active by 1 second.
|
|
|
Post by Exilereven on Dec 12, 2017 22:45:57 GMT
How to loop something try using:
While true do ---whatever you want to repeat over and over. End
Use break to get out of it
While true do --some random stuff
--but if this stuff happens while we're in loop then break If (picture not found) then break End -- end if --otherwise continue with your loop code End --end while
|
|
bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 14, 2017 19:38:17 GMT
How to loop something try using: While true do ---whatever you want to repeat over and over. End Use break to get out of it While true do --some random stuff --but if this stuff happens while we're in loop then break If (picture not found) then break End -- end if --otherwise continue with your loop code End --end while Thank you for your big help. but I'm still in stucking. Whenever I call Check(), that parts are never works! Check() is always call Check2(). It seems there is a problem in while action. Could you tell me how to fix it? function Check() while (Fighting) do -this part never works! click(Location(243, 704)) -this part never works! if (exists("STOP.png", 1)) then -this part never works! Fighting = False -this part never works! end -this part never works! end -this part never works! Check2() end
function Check2() if (exists("FIGHTING.png", 1)) then Fighting = True Check() else Result() end end
|
|
|
Post by Exilereven on Dec 14, 2017 20:15:36 GMT
function Check() while true do if Check2() then --check for fighting image click(Location(243, 704)) end if exists("STOP.png", 1) then --do whatever you want if stop image found end end end
function Check2() if exists("FIGHTING.png", 1) then return true end end
Didn't have much time, I'm on break but hope it help.
|
|
bdbd
New Member
Posts: 24
|
Post by bdbd on Dec 14, 2017 21:07:05 GMT
function Check() while true do if Check2() then --check for fighting image click(Location(243, 704)) end if exists("STOP.png", 1) then --do whatever you want if stop image found end end end function Check2() if exists("FIGHTING.png", 1) then return true end end Didn't have much time, I'm on break but hope it help. I finally got the base. I changed so many part but it works!! Thank you so much!!!!
|
|
|
Post by Exilereven on Dec 14, 2017 22:50:06 GMT
Congratz!!!
|
|