|
Post by AnkuLua on Oct 11, 2015 4:08:08 GMT
Please follow the following instruction and make your first script work Then ask us if still having problems Step by step guide
|
|
|
Post by Badilla on Oct 11, 2015 8:02:35 GMT
Please follow the following instruction and make your first script work Then ask us if still having problems Step by step guideit just gave me 1 click because the skill have cooldown .. I want unlimited any ways ?
|
|
|
Post by AnkuLua on Oct 11, 2015 8:07:23 GMT
Change the code to
-- ========== Settings ================ Settings:setCompareDimension(true, theWidthNumberFromYourMWSnap) Settings:setScriptDimension(true, theWidthNumberFromYourMWSnap) -- ========== main program =========== p = find("9.png") continueClick(p:getX(), p:getY(), 1, 1, 100)
It will give you 100 clicks.
|
|
|
Post by Kako on Oct 11, 2015 10:59:59 GMT
Some code like following local p = find("target.png") continueClick(p:getX(), p:getY(), 1, 1, 100) i dont understand xD Badilla, please send a screenshot of what you want to click.
|
|
|
Post by Badilla on Oct 11, 2015 22:06:34 GMT
Badilla, please send a screenshot of what you want to click.
|
|
|
Post by Badilla on Oct 11, 2015 22:08:42 GMT
I want click that skill 2 of them it have cooldown so the image is changed and ankulua its over,
|
|
|
Post by Badilla on Oct 11, 2015 22:55:19 GMT
-- ========== Settings ================ Settings:setCompareDimension(true, 587) Settings:setScriptDimension(true, 587)
-- ========== main program =========== while (true) do continueClick(485, 252, 150, 180, 100) end I got one! I want one more click on script how do i add ? And how i reduce speed for clicking ? Its too dang fast .-.
|
|
|
Post by AnkuLua on Oct 12, 2015 4:41:52 GMT
-- ========== Settings ================ Settings:setCompareDimension(true, 587) Settings:setScriptDimension(true, 587)
-- ========== main program =========== while (true) do continueClick(485, 252, 150, 180, n1) sleep(n2) end
To speed up, increase n1 (the number of continuous clicks) To slow down, increase n2 (sleep how many seconds)
|
|
|
Post by Badilla on Oct 12, 2015 12:39:40 GMT
-- ========== Settings ================ Settings:setCompareDimension(true, 587) Settings:setScriptDimension(true, 587)
-- ========== main program =========== while (true) do continueClick(485, 252, 150, 180, n1) sleep(n2) end To speed up, increase n1 (the number of continuous clicks) To slow down, increase n2 (sleep how many seconds) thanks for ur support im going to buy pro version i like this app
|
|
|
Post by AnkuLua on Oct 12, 2015 12:41:30 GMT
Thank you. Please also tell your friends. Don't forget to give AnkuLua five stars in google play.
|
|
|
Post by Kako on Oct 12, 2015 14:52:24 GMT
Thanks. Kako. Just found a way to provide the method you want. Will call it longClickBG(PSMRL, seconds). Will release in next version. Stay tuned. You're great! What will the function return? Maybe you can make it so that the return value can be used to stop when necessary? longClickVar = longClickBG(PSMRL, sec) -- Start longClick someRegion:wait(PSMRL, sec) -- Wait till something is found stopLongClickBG(longClickVar) -- Stop longClick now that something is found
Thanks for all the effort!
|
|
|
Post by AnkuLua on Oct 12, 2015 15:32:53 GMT
I have a better idea. longClick will trigger click as long as user want. The click will last until next touch related commands or stopLongClick called. longClick(PSMRL) -- long click on PSMRL -- -- do anything not related with long click click(PSMRL) -- this will stop the long click automatically or longClick(PSMRL) -- long click on PSMRL -- -- do anything not related with long click stopLongClick() -- this will stop the long click Then we don't need longClickBG
|
|
|
Post by Kako on Oct 12, 2015 16:27:29 GMT
Fine by me!
|
|
|
Post by cryzed on Jan 15, 2016 20:45:09 GMT
I feel that the "throw an exception if something goes wrong" is more suitable within the Python world, with actual try: ... except: ... semantics. How would I use for example "findAll" with Lua safely -- without crashing my entire script? Do I use Lua's pcall? Wouldn't it make more sense in many cases to slightly adapt the functions that currently throw exceptions, and simply return some none-type value or an empty list? For example "findAll": If I ask you to find all apples within an image, and you find none, I expect you to say "I found 0 apples", not blow up in my face. I know that this wasn't your design decision, since the SikuliX docs describe that nonsensical behavior -- but you would have the opportunity to make the scripting API more user-friendly (although with backwards-incompatible changes). Maybe I am simply missing something obvious? Currently I'm doing something like this now. Any advice on how exceptions should best be handled when using functions that potentially throw exceptions? pcall after all?
|
|
|
Post by AnkuLua on Jan 16, 2016 1:31:09 GMT
I feel that the "throw an exception if something goes wrong" is more suitable within the Python world, with actual try: ... except: ... semantics. How would I use for example "findAll" with Lua safely -- without crashing my entire script? Do I use Lua's pcall? Wouldn't it make more sense in many cases to slightly adapt the functions that currently throw exceptions, and simply return some none-type value or an empty list? For example "findAll": If I ask you to find all apples within an image, and you find none, I expect you to say "I found 0 apples", not blow up in my face. I know that this wasn't your design decision, since the SikuliX docs describe that nonsensical behavior -- but you would have the opportunity to make the scripting API more user-friendly (although with backwards-incompatible changes). Maybe I am simply missing something obvious? Currently I'm doing something like this now. Any advice on how exceptions should best be handled when using functions that potentially throw exceptions? pcall after all? Wow! You are expert. Compatibility with SikuliX is the main reason Here are some alternatives for exceptions. findAll is used as example. - Even the method return something except exception. Users need to handle it after calling method. You may need to check the result after findAll, such as
local allApples = findAll("apple.png") if (table.getn(allApples) == 0) then -- error handling else -- normal handling end Users can handle it in advance.
if (exists("apple.png") then allApples = findAll("apple.png") -- normal handling all apples end
- Use pcall. You can use following findAllNoException() function
function findAllNoException(target, timeout) local success, all = pcall(findAll, target, timeout) if (success) then return all end return {} end
And, findAllNoFindException() will be added in next release. Any other suggestion except findAll. Don't see any problem on your code. What kind of advice do you need? existsClick is always a good way for no exception.
|
|