|
Post by autoconfig on Feb 23, 2018 5:53:03 GMT
I've made a simple script for a game. The game is played in portrait mode (no other option) and my script cycles through some actions that occasionally force ads.
I'm able to exit the ads just fine, but some of them switch the screen to landscape mode. When this happens the script continues on but it acts as though it's still in landscape mode, clicking in all the wrong locations.
Is there any way to get ankulua back into portrait mode? Or any other solution to work around this?
I feel there must be something simpler than checking locations for images and having the script use a second set of coordinates if the images match landscape locations.
|
|
|
Post by AnkuLua on Feb 23, 2018 8:20:16 GMT
What's your AnkuLua settings in screenshot? AnkuLua takes the screenshot according to the device orientation, not game.
|
|
|
Post by autoconfig on Feb 23, 2018 20:12:56 GMT
There's no screenshot involved, it's a simple click->wait->repeat. The issue is when landscape ads come up, even after the ad exits, Ankulua continues the script as if it were in landscape while the game has gone back to portrait. Essentially, I click a location on the bottom of the screen, an ad comes up that is sometimes landscape. Ad finishes and game comes back up in portrait. When Ankulua goes to click the location that is at the bottom of the screen again, it instead clicks a location on the left of the screen, acting as though it were still in landscape. It seems to me Ankulua is detecting the forced landscape switch when the ad comes up, but not the forced portrait switch when the ad exits. I don't really have the know-how to root cause why that would happen. I found a different way to fix it though. I installed a no-root app called "Rotation Manager". With this I was able to set Ankulua and the game to forced portrait mode. Now the ads that were once in landscape are instead playing in portrait mode and it no longer breaks. Here is the script in it's entirety. "Break me now" lines are to give me an opportunity to stop the script since the continueClick's are averaging 55 taps per second... makes it impossible to stop the script while continueClick is running unless I enable "Stop on volume down" (which I dont want to particularly). Like I said it's very simple. I didn't spend much time it. Didn't set resolution or anything of that nature since I only made it for myself. localPath = scriptPath()
setImagePath(localPath .. "Image")
tps = 55
tint = 10
taps = (tps * (60 * 1))
seaweed = Location(267, 572)
urchin = Location(124, 645)
clam = Location(1178, 603)
event = Location(1072, 2658)
shop = Location(897, 2657)
shop2 = Location(1170, 1490)
stone = Location(142, 2670)
eventitem = Location(1210, 1888)
gems = Location(1196, 2115)
gearRegion = Region(1299, 237, 100, 100)
function getevent()
click(event)
wait(0.5)
click(eventitem)
end
function getgems()
click(shop)
wait(0.5)
click(shop2)
wait(0.5)
click(gems)
end
function closeAd()
--Wait for ad timeout
wait(60)
--Check if ad closed automatically, exit if not
gearRegion:highlight(2)
if gearRegion:exists(Pattern("gear.jpg"):similar(0.5), 0.1) then
wait(0.5)
else
keyevent(4)
wait(10)
end
end
function clickSeaweed()
--Powerclick Seaweed
setContinueClickTiming(1, tint)
continueClick(267, 572, 0, 0, taps)
toast("Break me now")
wait(5)
continueClick(267, 572, 0, 0, taps)
toast("Break me now")
wait(5)
end
function clickUrchin()
--Powerclick Urchin
continueClick(124, 645, 0, 0, taps)
toast("Break me now")
wait(5)
continueClick(124, 645, 0, 0, taps)
toast("Break me now")
wait(5)
end
function clickClams()
--Powerclick Clams
continueClick(1178, 603, 0, 0, taps)
toast("Break me now")
wait(5)
continueClick(1178, 603, 0, 0, taps)
toast("Break me now")
wait(5)
end
while true do
--Start Abyssrium and wait to load
startApp("com.idleif.abyssrium")
wait(30)
--Collect idle earnings and open menu
click(Location(510, 1764))
wait(1)
click(Location(510, 1764))
wait(1)
click(Location(1312, 2667))
wait(1)
--Collect event item (Play Ad)
getevent()
closeAd()
--Collect gems (Play Ad)
getgems()
closeAd()
--Reset skill cooldown(Play Ad)
click(stone)
wait(0.5)
click(Location(1191, 1984))
closeAd()
--Click skills
click(Location(912, 1969))
wait(0.5)
click(Location(579, 1966))
wait(0.5)
click(Location(260, 1991))
wait(0.5)
--Powerclick and collect farm items
clickSeaweed()
clickUrchin()
clickClams()
clickSeaweed()
--Level Coralite
continueClick(1212, 2291, 0, 0, 100)
continueClick(124, 2284, 0, 0, 5)
wait(5)
--Close App for 5 minute break (avoid overheat and lag)
killApp("com.idleif.abyssrium")
wait(300)
end
|
|
|
Post by autoconfig on Feb 23, 2018 20:54:03 GMT
Come to think of it, the script has to take a screenshot while the ad is still up in landscape mode in order to see if the "gear" is there to indicate if the ad exited automatically or not. Its possible doing that image comparison while in landscape is responsible for the switch. So I wonder now if I had it do another image comparison after exiting the ad if that will reset to portrait.
|
|
|
Post by autoconfig on Feb 24, 2018 0:35:24 GMT
Update: The above did fix it. I added in a dummy comparison after the ad closes and the script resumes normal activity in portrait mode.
|
|