|
Post by AnkuLua on May 11, 2018 6:16:44 GMT
Let's study it.
|
|
|
Post by zbel on Jun 21, 2018 16:26:10 GMT
is there a way to relaunch a script after a scriptExit ?
|
|
|
Post by AnkuLua on Jun 21, 2018 23:11:27 GMT
is there a way to relaunch a script after a scriptExit ? No. You can use dofile() to run the script in stead of scriptExit().
|
|
zouna
Contributors  
Posts: 109
|
Post by zouna on Dec 21, 2018 5:35:39 GMT
Hi AnkuLua, is it possible to have an function getActiveUsers() which will return an integer depending on how many users are running the script? This would be an amazing addition to the API. Would love to see that in the future!
|
|
|
Post by AnkuLua on Dec 21, 2018 7:06:28 GMT
Hi AnkuLua, is it possible to have an function getActiveUsers() which will return an integer depending on how many users are running the script? This would be an amazing addition to the API. Would love to see that in the future! Why do you want it?
|
|
|
Post by trybane on Dec 29, 2018 17:10:35 GMT
Is there a way to request whether a notch exists or not? Currently making a script and I've got a simple algorithm to detect aspect ratios other than 16:9 to solve compatibility, but anyone with a Notch ends up needing special attention and it doesn't appear to be the same with all of them. I'd like to be able to detect a Notch preemptively to give the user instructions on how to determine their own changes. Alternatively, knowing that there is indeed a notch can also remove a lot of logic branching reducing computation times for the script while it's running. I may be able to use this detection to branch into an algorithm that can determine values at the start of the script.
Please let there be a way!
|
|
|
Post by AnkuLua on Dec 30, 2018 0:41:43 GMT
Is there a way to request whether a notch exists or not? Currently making a script and I've got a simple algorithm to detect aspect ratios other than 16:9 to solve compatibility, but anyone with a Notch ends up needing special attention and it doesn't appear to be the same with all of them. I'd like to be able to detect a Notch preemptively to give the user instructions on how to determine their own changes. Alternatively, knowing that there is indeed a notch can also remove a lot of logic branching reducing computation times for the script while it's running. I may be able to use this detection to branch into an algorithm that can determine values at the start of the script. Please let there be a way! Will support it. Stay tuned. Edit: Did you try following tips? ankulua.boards.net/thread/1286/skill-write-scripts-wide-screens
|
|
|
Post by trybane on Dec 31, 2018 12:45:16 GMT
I didn't follow that exact style of code. The game I'm doing it for is FGO which doesn't scale it's layout based on the users device but instead inserts bars on the top/bottom or left/right based on how much extra room is available. So, I did the following:
setImmersiveMode(true)
xOffset = 0
yOffset = 0
xDifferential = getRealScreenSize():getX() / 2560
yDifferential = getRealScreenSize():getY() / 1440
if yDifferential > xDifferential then
yOffset = ( getRealScreenSize():getY() - ( xDifferential * 1440 ) ) / xDifferential / 2
Settings:setCompareDimension(true,1280)
Settings:setScriptDimension(true,2560)
elseif yDifferential < xDifferential then
xOffset = ( getRealScreenSize():getX() - ( yDifferential * 2560 ) ) / yDifferential / 2
Settings:setCompareDimension(false,720)
Settings:setScriptDimension(false,1440)
else
Settings:setCompareDimension(true,1280)
Settings:setScriptDimension(true,2560)
end
As you can probably guess, this creates an offset which is then used on all Location and Regions throughout the script. And this works for everything aside from Notches since the Notches create an imbalance between the bars on either side. Normally they are evenly distributed on either side, but with the Notch it can be anywhere from 1/4->3/4 to 1/3->2/3 distributions. And on top of that, rotating the device requires a change in the offset due to the distribution remaining constant based on the position of the Notch.
Now I have a potential solution to this in the case where a Notch is present, I just need to know if that notch is present first. In the case with a Notch present, I need to lock the screen so that Rotation is not possible, and then do image recognition to determine the position of the image. Then I can calculate how far off it is compared to where it SHOULD be, and then change the offset accordingly. This is the solution I've come up with as of this moment anyways, I just don't think I have a way to lock screen rotation.
|
|
|
Post by notpeople on Nov 26, 2020 19:04:49 GMT
Does ankulua have a method to ignore error and restart the script if it exit during runtime ?
|
|
|
Post by AnkuLua on Nov 27, 2020 0:20:47 GMT
Does ankulua have a method to ignore error and restart the script if it exit during runtime ? There is an option in AnkuLua settings "Rerun script after back from killed by Android".
|
|
|
Post by noorxd13 on Dec 8, 2020 12:55:57 GMT
|
|
|
Post by ahmish on Oct 6, 2022 8:40:03 GMT
Hi,
Is it possible to include a colored print in AnkuLua? I tried the print('\27[31mReady!') but it's not working. Also maybe include a timed getTouchEvent() like in some cases bot will wait for touch then after couple of seconds without any input will continue doing something else.
|
|
|
Post by AnkuLua on Oct 6, 2022 10:43:20 GMT
Hi, Is it possible to include a colored print in AnkuLua? I tried the print('\27[31mReady!') but it's not working. Also maybe include a timed getTouchEvent() like in some cases bot will wait for touch then after couple of seconds without any input will continue doing something else. Sorry. Colored print is not supported. And getTouchEvent() don't have timeout feature.
|
|
amati
Contributors  
Clicks stopped working
Posts: 11
|
Post by amati on Jan 19, 2023 16:53:15 GMT
killApp and startApp functions not working without Daemon? What function can replace killApp and startApp?
|
|
|
Post by AnkuLua on Jan 19, 2023 22:59:30 GMT
killApp and startApp functions not working without Daemon? What function can replace killApp and startApp? startApp() works on accessory, daemon and root. killApp() works on daemon and root, but not accessory. You can use keyevent(187) (app switch) and swipe() to kill app on accessory.
|
|