|
Post by alfred32 on Jun 8, 2018 5:46:30 GMT
Thx. That seems doable ;-)
Moving on to a *more interesting* question (as I am getting deeper into AnkuLua):
How do I override setImagePath from within a luar?
Goal: I would like to chain together pre-recorded (and modified) .luar files. In this example, I'll use script "anotherluar.luar" with "anotherluarImage" as the image subfolder.
I tried to simply make another .luar (so that I can launch it from within snap and play) and tried to override the setImagePath().
But it does not work.
I lifted the following variables from the main snap and play script and modified them....
localPath = scriptPath() luarPath = localPath .. "luar/" luarImagePath = luarPath .. "anotherluarImage" setImagePath(luarImagePath) luarImagePath = luarImagePath .."/"
but no matter where how I set the image path, it keeps bringing in the default values. I just can't overwrite it.
luarImagePath = scriptPath() .. "luar/anotherluarImage/
no matter where I stuff this, the scripts keeps searching in the wrong image folder.
I tried so many approaches I can't think anymore. Hints appreciated!
|
|
|
Post by lotzenfimbo on Jun 8, 2018 10:11:18 GMT
Hi all...
i write an simple script for MMEG but i have some problems... iam very newbie but i want to know if there is any possibility to:
-to do script path three times? like do script 1...change to script 2 and then to script 3 and maybe back to script 1 or 2. okay this "problem i solve by myself (learning by doing) -to check an image and press another one. if "this one exist" -to get to another script at a spezific line / or jump to a specific line in the same script if there is an specific image -to click or do something else like wait or open another script when the image I saved is NOT found in the area to search
sry for this noob questions
THX
|
|
|
Post by AnkuLua on Jun 8, 2018 16:02:21 GMT
Thx. That seems doable ;-) Moving on to a *more interesting* question (as I am getting deeper into AnkuLua): How do I override setImagePath from within a luar? Goal: I would like to chain together pre-recorded (and modified) .luar files. In this example, I'll use script "anotherluar.luar" with "anotherluarImage" as the image subfolder. I tried to simply make another .luar (so that I can launch it from within snap and play) and tried to override the setImagePath(). But it does not work. I lifted the following variables from the main snap and play script and modified them.... localPath = scriptPath() luarPath = localPath .. "luar/" luarImagePath = luarPath .. "anotherluarImage" setImagePath(luarImagePath) luarImagePath = luarImagePath .."/"
but no matter where how I set the image path, it keeps bringing in the default values. I just can't overwrite it. luarImagePath = scriptPath() .. "luar/anotherluarImage/no matter where I stuff this, the scripts keeps searching in the wrong image folder. I tried so many approaches I can't think anymore. Hints appreciated! This is not tested yet. But, you could modify the generated luar. Change to action to what you want. Please share more real example, it helps more.
|
|
|
Post by alfred32 on Jun 9, 2018 16:57:50 GMT
> Please share more real example, it helps more. The example above is 100% real :-) , but I guess you'd appreciate more data. Here it is: To get a simple use case, I'm not even using doFile, but rather just combining code snippets from different .luar files. - There's a main luar called "chain.luar" - "house" is another luar, recorded separately, which clicks on a house. - "house" has images saves in "houseImage" - which is automatically generated by Snap and Play - I copy paste a part of "house" into "chain". I want to run "chain", but I want the script to look for the images in the houseImage folder (and NOT chainImage folder, which would be the default S&P behavior). experiments belowchain.luar embed in action, try overwriting luarImagePath touchList[index] = {target = "1.png", region = Region(336, -20, 80, 80), id = "1", action = 'luarImagePath = scriptPath() .. "luar/houseImage/"; click(matchResult)'}
error: keeps looking in chainImage chain.luar embed in action, sidestap luarImagePath touchList[index] = {target = "1.png", region = Region(336, -20, 80, 80), id = "1", action = 'setImagePath(scriptPath() .. "luar/houseImage/"; click(matchResult)'}
error: same. keeps looking in chainImage chain.luar trying to overwrite luarImagePath localPath = scriptPath() luarPath = localPath .. "luar/" luarImagePath = luarPath .. "houseImage"
touchList[index] = {target = "1.png", region = Region(336, -20, 80, 80), id = "1", action = 'click(matchResult)'}
error: same. keeps looking in chainImage chain.luar sidestepping luarImagePath setImagePath(scriptPath() .. "luar/moneyImage/")
touchList[index] = {target = "1.png", region = Region(336, -20, 80, 80), id = "1", action = 'click(matchResult)'}
error: same. keeps looking in chainImage
|
|
|
Post by alfred32 on Jun 9, 2018 17:00:30 GMT
PS: It would be better to use a doFile() eventually, but I felt it was easier to get it working like this first.
|
|
|
Post by wyhay97 on Jun 18, 2018 18:25:18 GMT
After I record a script..I select play and i get this error :
|
|
|
Post by AnkuLua on Jun 19, 2018 0:02:24 GMT
After I record a script..I select play and i get this error : Please use the latest version of AnkuLua.
|
|
|
Post by wyhay97 on Jun 21, 2018 8:51:58 GMT
After I record a script..I select play and i get this error : Please use the latest version of AnkuLua. I have ,but I receive the same error...
|
|
|
Post by kaligraf on Jun 25, 2018 16:43:08 GMT
Hello, is this program able to write a bot for Summoners War? after entering Nick character, the bot itself passes the tutorial then goes scenario to Faimon to get LD Scroll?
|
|
|
Post by AnkuLua on Jun 26, 2018 0:55:32 GMT
Hello, is this program able to write a bot for Summoners War? after entering Nick character, the bot itself passes the tutorial then goes scenario to Faimon to get LD Scroll? You can try. It could at least do some basic automation.
|
|
draly
New Member
Posts: 11
|
Post by draly on Jun 28, 2018 17:57:12 GMT
Hi there, first of all, thanks for the app, i'm used to use some macro recording and replay app like repetitouch, but i really like the idea behind Ankulua, it's awesome. Beside that, i'm total newbie with this tool and i tried to record a script thanks to snapandreplay, and it works great, but i have a little question. Is there a way to set some kind of scan timer interval because in my case, it's too quick, well, not that it doesn't work, but it doesn't need to switch that quick between the tasks. I would be happy if i could add a wait time between each search like 10 seconds. I've search around and found some "setScanInterval" or "wait" commands but i can't find how to use these here's my recorded script if it helps ----- created by AnkuLua snap and play script ------ immersive = true setImmersiveMode(immersive) scriptDimension = 1440 Settings:setScriptDimension(true, scriptDimension) Settings:setCompareDimension(true, scriptDimension) local index = 1 touchList = {} waitList = {}
------ 1 ----- touchList[index] = {target = "1.png", region = Region(632, 513, 150, 150), id = "1", action = 'click'} index = index + 1
------ 2 ----- touchList[index] = {target = "2.png", region = Region(771, 701, 150, 150), id = "2", action = 'click'} index = index + 1
------ 3 ----- touchList[index] = {target = "3.png", region = Region(464, 706, 150, 150), id = "3", action = 'click'} index = index + 1
------ 4 ----- touchList[index] = {target = "4.png", region = Region(655, 450, 150, 150), id = "4", action = 'click'} index = index + 1
Any help would be very appreciated, have a nice day all !
|
|
|
Post by AnkuLua on Jun 28, 2018 23:09:14 GMT
change all the action = 'click' to action = 'click(matchResult); wait(10)'
Or you can modify the snapAndPlay.lua. For line around 1050
wait(2) if (continueScan) then index = choice + 1 end
Change the wait(2) to the desired waiting seconds.
|
|
draly
New Member
Posts: 11
|
Post by draly on Jun 29, 2018 5:27:16 GMT
change all the action = 'click' to action = 'click(matchResult); wait(10)' Or you can modify the snapAndPlay.lua. For line around 1050 wait(2) if (continueScan) then index = choice + 1 end
Change the wait(2) to the desired waiting seconds. Thanks ! I'll try that, i already bought 1 month subscription to pro, but i'll buy lifetime soon if it suits my needs Another last question, i saw that it's possible to set the screen brightness,i think i'll have to take the time to learn lua but any advice to where to put the command would really help
|
|
|
Post by AnkuLua on Jun 29, 2018 6:15:10 GMT
To set brightness, action = 'click(matchResult); setBrightness(1);wait(10)'
|
|
draly
New Member
Posts: 11
|
Post by draly on Jun 29, 2018 20:35:32 GMT
To set brightness, action = 'click(matchResult); setBrightness(1);wait(10)' Hi Ankulua, thanks for your help, i've managed to wait after each found and clicked events, same for the brightness, eventhough it doesn't black out my screen with setBrightness(0) (if you know about the app repetitouch, it turns my screen completly black when dim the screen to 0 is activated, so maybe it's possible with your app ?). I've read almost 20 pages of this forum and learning something in each of them, it's brilliant, i'll buy lifetime pro soon. My last question is: Is there a way to slow down the checks because it slows down my device and probably eat more battery as i don't need to check my captured png so quick (5s between each check would be perfect). I've read somewhere about scanInterval() but didn't manage to get it working, do i need to put in place of the wait(10) ? like this insert code here------ 1 ----- touchList[index] = {target = "Auto.png", region = Region(272, 879, 200, 200), id = "Auto", action = 'click(matchResult); wait(10)'} index = index + 1
------ 2 ----- touchList[index] = {target = "Victoire.png", region = Region(914, 871, 200, 200), id = "Victoire", action = 'click(matchResult); wait(10)'} index = index + 1
would become ------ 1 ----- touchList[index] = {target = "Auto.png", region = Region(272, 879, 200, 200), id = "Auto", action = 'click(matchResult); setScanInterval(5)'} index = index + 1
------ 2 ----- touchList[index] = {target = "Victoire.png", region = Region(914, 871, 200, 200), id = "Victoire", action = 'click(matchResult); setScanInterval(5)'} index = index + 1
Edit: Well it doen't seem to work, maybe a change to the snapandreplay.luar is needed ?
|
|