|
Post by uplink25 on Apr 15, 2020 23:49:08 GMT
I trying to write my own script for game "Idle Pocket Crafter: Mine Rush" If I use recordAndPlay it's works well
My script working well only about 10 minutes. After some time smartphone go to reboot.
Here is my script:
ins-- ========== Settings ================ setImmersiveMode(true) -- Ankulua TIMEOUT = 1 SIMILAR = 0.8 WIDTH = 1080 HEIGHT = 2248 -- Ankulua settings Settings:setCompareDimension(true, WIDTH) Settings:setScriptDimension(true, WIDTH) Settings:set("AutoWaitTimeout", TIMEOUT) Settings:set("MinSimilarity", SIMILAR) -- MI 8 screen size - 1080x2248 -- center of screen = 540x1124
BI_opened = Region(20,936,100,100):exists("MINERS_BI.png",0)
-- =========== functions ============
function mineOre() if(BI_opened) then click("MINERS_BI.png") wait(0.2) click("BRAIN_IMPLANT.png") else click("BRAIN_IMPLANT.png") wait(0.7) click("MINERS_BI.png") wait(0.2) click("BRAIN_IMPLANT.png") end end function mineLumber() if(BI_opened) then click("LUMBERJACKS_BI.png") wait(0.2) click("BRAIN_IMPLANT.png") else click("BRAIN_IMPLANT.png") wait(0.7) click("LUMBERJACKS_BI.png") wait(0.2) click("BRAIN_IMPLANT.png") end end function mineLether() if(BI_opened) then click("HUNTERS_BI.png") wait(0.2) click("BRAIN_IMPLANT.png") else click("BRAIN_IMPLANT.png") wait(0.7) click("HUNTERS_BI.png") wait(0.2) click("BRAIN_IMPLANT.png") end end
-- ========== main program ===========
while true do mineOre() wait(5) mineLumber() wait(5) mineLether() wait(5) end
|
|
|
Post by AnkuLua on Apr 15, 2020 23:55:32 GMT
If phone reboot, it’s the phones problem.
|
|
|
Post by uplink25 on Apr 16, 2020 0:30:57 GMT
I use recordAndPlay.lua every night and phone work without reboot. It's something in my script.
|
|
|
Post by AnkuLua on Apr 16, 2020 1:43:07 GMT
recordAndPlay doesn’t compare images.
With image comparisons, more CPU are used. And more heat is generated. Then it’s possible to reboot for over heat.
Try “ Image recognition at half comparing dimension" in AnkuLua settings and check if it’s better.
|
|
|
Post by uplink25 on Apr 17, 2020 12:27:13 GMT
Thanks for the advice. I tried different options and noticed that the more image recognition, the faster the phone goes into reboot. But It's not about overheating. I change the script and now image recognition only one time after 2 min
-- =========== functions ============ function btn_back() -- simulate back botton swipe(Location(1078,1900),Location(600,1900),0.5) end function clkExtraAD() -- EXTRA_AD if (Region(9,1405,100,100):exists("EXTRA_AD.png",2)) then click(Location(65,1464)) wait(1) btn_back() wait(1.5) end end
function clkADBust() -- 2xSpeed click(Location(65,1822)) wait(30) btn_back() wait(1) click(Location(76,165)) wait(1) click(Location(76,165)) wait(1) click(Location(996,165)) wait(1.5) end
function mineOre() if(BI_opened) then click(minersBI) wait(0.2) click(BI) else click(BI) wait(0.7) click(minersBI) wait(0.2) click(BI) end end function mineLumber() if(BI_opened) then click(lumberjackBI) wait(0.2) click(BI) else click(BI) wait(0.7) click(lumberjackBI) wait(0.2) click(BI) end end function mineLether() if(BI_opened) then click(huntersBI) wait(0.2) click(BI) else click(BI) wait(0.7) click(huntersBI) wait(0.2) click(BI) end end
function isItHome() if(Region(930,575,150,150):exists("RETURN_HOME.png",1)) then --Home button on screen continueFlag = true else continueFlag = false end end
-- ========== main program =========== continueFlag = true
while continueFlag do isItHome() -- here 1 image recognition if (continueFlag == true) then mineOre() -- here 1 image recognition wait(120) mineLumber() -- here 1 image recognition wait(120) mineLether() -- here 1 image recognition wait(120) clkExtraAD() -- here 1 image recognition end end
It worked for more than 2 hours, and I left it for the night, but at night the phone rebooted. Maybe some buffer overflows? The phone does not heat up from this script. And from the first, too, did not bask at all.
|
|