I dont see any reason why your code should bug out like that hmmmQuote:
Code:var #enableFairies 0 var #enablePremiumCollect 1 var #agree 1 var #decline 0 var #enableClanShip 1 var #PHoM 1 var #manaTournament 0 var #enableTapping 0 var #equipStack 1 // ---------- Actions ---------- [ Prestige ] var #enableAutoprestige 1 var #lateRun 0 var #prestigeStartTime 27 // ---------- Actions ---------- [ General ] var #runActionsEveryXSeconds 170 var #runActionsOnStart 1 // ---------- Actions ---------- [ ClanQuest ] var #enableClanQuest 1 var #clanQuestRunsPerReadyUp 1 // ---------- Actions ---------- [ Heroes ] var #enableHeroes 1 var #heroIntensity 2 var #topHeroes 0 // ---------- Actions ---------- [ Skills ] var #enableSkills 1 var #fullManaSkill 0 //press given skills every X seconds var #intervalHS 0 var #intervalDS 5 var #intervalFS 5 var #intervalHoM 5 var #intervalWC 5 var #intervalSC 5 var #unlocked 0 if #lateRun > 0 #intervalHS = 0 #intervalDS = 5 #intervalFS = 5 #intervalHoM = 5 #intervalWC = 5 #intervalSC = 5 if #lateRun > #maxSkillsAtXMinutes #unlocked = 8 else #unlocked = 4 endif endif var #justUnlockSkills 1 var #maxSkillsAtXMinutes 999 var #stopLevelSkillMins 1 calc #maxSkillsAtXMinutesA #maxSkillsAtXMinutes - 1 calc #maxSkillsAtXMinutesB #maxSkillsAtXMinutes + 2 var #startSkillCheckNow 1 // ---------- Actions ---------- [ Boss ] var #startBossSkill 0 var #startBossSecondarySkill 0 // ---------- Developer / Expert var #maxHitCount 9999999 var #showCurrentTime 1 var #timeScaleAddition 17 // ---------- Dec var #randomX 0 var #randomY 0 var #color1 0 var #color2 0 var #loopCount 0 var #clanQuestLoopCount 0 var #pressLevelUpLoopCount 0 var #skillCheckStepper 0 var #actionStepper 0 var #levelHeroesStepper 0 var #skillActive 0 var #colorRed 0 var #colorBlue 0 var #colorGreen 0 var #loopDetectionCount 0 var #skillsUnlocked 0 var #tryWithDelay 0 var #checkRunning 0 var #clanQuestCount 0 var #recheckClanQuest 0 var #count 0 var #hitCount 0 var #skillAvailable 0 var #loopBreak 0 set #rAEXS #runActionsEveryXSeconds set #iHS #intervalHS set #iDS #intervalDS set #iFS #intervalFS set #iHoM #intervalHoM set #iWC #intervalWC set #iSC #intervalSC calc #minz #lateRun * 60000 var #prestigeAfterXMinutes 0 calc #prestigeEndTime #prestigeStartTime + 10 rand #prestigeAfterXMinutes #prestigeStartTime #prestigeEndTime var #maxedOutSkills 0 if #lateRun > 0 #maxedOutSkills = 2 #startSkillCheckNow = 0 endif var #prestigeSlide 0 // ---------- Delays var #btnDelay 150 var #hitDelay 40 var #menuSlideDelay 200 var #menuPopUpDelay 500 var #loadingClanQuestDelay 3000 var #shipDelay 200 // ---------- Menu Coords var #menuY 780 var #menuStats 15 var #menuHeroes 120 var #menuCloseY 455 var #menuCloseX 466 // ---------- Colors var #colorWhite -65793 var #colorSkillActivated -20993 var #colorInfoNumber 475629 var #colorDia -7970303 var #colorLevelUpAvailable 1338350 var #skillGray 7829367 var #skillBlue -3693762 var #colorBlack 397861 var #colorStatsButton 3695603 var #colorGray 2695200 // ---------- TimeSets var #timeLastActionRun 0 var #timeDiff 0 var #time 0 var #seconds 0 var #secondsTotal 0 var #minutes 0 var #lastPressHS 0 var #lastPressDS 0 var #lastPressFS 0 var #lastPressHoM 0 var #lastPressSC 0 var #lastPressWC 0 var #lastTopHeroes 0 var #resultManaPool 0 var #resultCheckBoss 0 var #resultUpdateTime 0 var #resultClanQuest 0 // ---------- MAIN :start #loopCount = #loopCount + 1 #resultManaPool = #loopCount % 901 #resultCheckBoss = #loopCount % 302 #resultClanQuest = #loopCount % 101 #resultUpdateTime = #loopCount % 75 #timeDiff = #secondsTotal - #timeLastActionRun #time = #time + #timeScaleAddition if #resultClanQuest == 0 and #enableClanQuest == 1 goto :checkClanQuest endif if #resultUpdateTime == 0 #seconds = (#time/1000)%60 #secondsTotal = #time/1000 #minutes = (#time/1000)/60 if #minutes > 15 #runActionsEveryXSeconds = 50 endif endif if #showCurrentTime == 1 and #resultUpdateTime == 0 toast #minutes:#seconds endif if #resultUpdateTime == 0 and #enablePremiumCollect == 1 and #agree == 1 touchDown 0 350 630 sleep 25 touchUp 0 sleep 25 #time = #time + 50 endif if #resultUpdateTime == 0 and #enablePremiumCollect == 1 and #decline == 1 touchDown 0 195 630 sleep 25 touchUp 0 sleep 25 #time = #time + 50 endif if #resultUpdateTime == 0 and #timeDiff < #runActionsEveryXSeconds goto :pressSkills endif if #loopCount == 1 and #enableClanQuest == 1 goto :checkClanQuest elseif #loopCount == 2 goto :init elseif #minutes >= #prestigeAfterXMinutes and #enableAutoprestige == 1 goto :checkPrestige elseif #timeDiff >= #runActionsEveryXSeconds goto :runActions elseif #resultCheckBoss == 0 goto :checkBoss elseif #resultManaPool == 0 goto :checkMana elseif #loopCount == #maxHitCount #loopCount = 0 goto :randomTouch else goto :randomTouch endif :end :afterPrestige #count = 0 #skillsUnlocked = 0 #time = 0 #seconds = 0 #secondsTotal = 0 #minutes = 0 #unlocked = 0 #lateRun = 0 #runActionsEveryXSeconds = 170 #maxedOutSkills = 0 #prestigeSlide = 0 #intervalHS = 0 #intervalDS = 5 #intervalFS = 5 #intervalHoM = 5 #intervalWC = 5 #intervalSC = 5 rand #prestigeAfterXMinutes #prestigeStartTime #prestigeEndTime goto :init // ---------- INIT :init if #enablePremiumCollect == 1 if #agree == 1 touchDown 0 350 630 sleep 50 touchUp 0 sleep 50 #time = #time + 100 endif if #decline == 1 touchDown 0 195 630 sleep 50 touchUp 0 sleep 50 #time = #time + 100 endif endif #lastPressHS = 0 #lastPressDS = 0 #lastPressFS = 0 #lastPressHoM = 0 #lastPressSC = 0 #lastPressWC = 0 #timeLastActionRun = 0 touchDown 0 #menuCloseX #menuCloseY sleep #btnDelay #time = #time + #btnDelay touchUp 0 sleep #menuSlideDelay #time = #time + #menuSlideDelay if #runActionsOnStart == 1 #actionStepper = 0 goto :runActions endif goto :start :loopDetected #loopCount = 0 #loopDetectionCount = 0 goto :runActions // ---------- PRESS SKILLS :pressSkills getColor #color 372 24 if #color == 1076975 touchPress 0 390 36 sleep 40 touchUp sleep 40 #time = #time + 80 goto :pressSkills endif touchDown 0 #menuCloseX #menuCloseY sleep 25 touchUp 0 sleep #menuSlideDelay #time = #time + #menuSlideDelay + 25 if #enableClanShip == 1 touchPress 0 65 100 sleep #shipDelay touchPress 0 65 100 sleep #shipDelay touchPress 0 65 100 sleep #shipDelay touchPress 0 65 100 sleep #shipDelay touchPress 0 65 100 sleep #shipDelay #time = #time + 5 * #shipDelay endif #timeDiff = #secondsTotal - #lastPressSC if #timeDiff >= #intervalSC and #intervalSC > 0 #lastPressSC = #secondsTotal touchPress 0 430 710 sleep 15 touchUp 0 sleep 10 touchPress 0 430 710 sleep 15 touchUp 0 sleep 10 #time = #time + 50 endif if #manaTournament == 1 #colorRed = -1 #colorBlue = 0 else if #minutes < 16 #colorRed = -1 #colorBlue = 0 else getRGB #colorRed #colorGreen #colorBlue 410 705 #time = #time + 100 endif endif #timeDiff = #secondsTotal - #lastPressHoM if #timeDiff >= #intervalHoM and #intervalHoM > 0 and #colorRed == -1 and #colorBlue == 0 #lastPressHoM = #secondsTotal touchPress 0 200 710 sleep 15 touchUp 0 sleep 10 touchPress 0 200 710 sleep 15 touchUp 0 sleep 10 #time = #time + 50 endif #timeDiff = #secondsTotal - #lastPressDS if #timeDiff >= #intervalDS and #intervalDS > 0 and #colorRed == -1 and #colorBlue == 0 #lastPressDS = #secondsTotal touchPress 0 120 710 sleep 15 touchUp 0 sleep 10 touchPress 0 120 710 sleep 15 touchUp 0 sleep 10 #time = #time + 50 endif #timeDiff = #secondsTotal - #lastPressWC if #timeDiff >= #intervalWC and #intervalWC > 0 and #colorRed == -1 and #colorBlue == 0 #lastPressWC = #secondsTotal touchPress 0 360 710 sleep 15 touchUp 0 sleep 10 touchPress 0 360 710 sleep 15 touchUp 0 sleep 10 #time = #time + 50 endif #timeDiff = #secondsTotal - #lastPressFS if #timeDiff >= #intervalFS and #intervalFS > 0 and #colorRed == -1 and #colorBlue == 0 #lastPressFS = #secondsTotal touchPress 0 280 710 sleep 15 touchUp 0 sleep 10 touchPress 0 280 710 sleep 15 touchUp 0 sleep 10 #time = #time + 50 endif #timeDiff = #secondsTotal - #lastPressHS if #timeDiff >= #intervalHS and #intervalHS > 0 and #colorRed == -1 and #colorBlue == 0 #lastPressHS = #secondsTotal touchPress 0 40 710 sleep 15 touchUp 0 sleep 10 touchPress 0 40 710 sleep 15 touchUp 0 sleep 10 #time = #time + 50 endif if #topHeroes > 0 #timeDiff = #secondsTotal - #lastTopHeroes if #timeDiff >= #topHeroes #lastTopHeroes = #secondsTotal sleep 100 sleep #btnDelay #time = #time + #btnDelay + 100 touchDown 0 #menuHeroes #menuY sleep #btnDelay touchUp 0 sleep 1000 #time = #time + 1000 + #btnDelay sleep #menuSlideDelay #time = #time + #menuSlideDelay touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 sleep 50 touchUp 0 sleep 750 sleep #btnDelay #time = #time + #btnDelay + 1150 touchPress 0 410 580 sleep #btnDelay touchPress 0 410 650 sleep #btnDelay touchPress 0 410 730 sleep #btnDelay #time = #time + #btnDelay * 3 sleep #btnDelay #time = #time + #btnDelay touchPress 0 #menuCloseX #menuCloseY touchPress 0 #menuCloseX #menuCloseY touchPress 0 #menuCloseX #menuCloseY sleep #menuSlideDelay #time = #time + #menuSlideDelay endif endif goto :start // ---------- CHECK MANA :checkMana getColor #color1 208 638 if #color1 == #colorWhite goto :startSkill endif goto :start :startSkill if #fullManaSkill == 1 touchPress 0 40 710 elseif #fullManaSkill == 2 touchPress 0 120 710 elseif #fullManaSkill == 3 touchPress 0 200 710 elseif #fullManaSkill == 4 touchPress 0 280 710 elseif #fullManaSkill == 5 touchPress 0 360 710 elseif #fullManaSkill == 6 touchPress 0 430 710 endif #time = #time + 150 goto :start :runActions #timeLastActionRun = #secondsTotal #actionStepper = #actionStepper + 1 if #actionStepper == 2 and #enableSkills == 1 and #skillsUnlocked < 6 #skillsUnlocked = 0 goto :openSwordMasterTab elseif #actionStepper == 1 and #enableHeroes == 1 goto :levelHeroes elseif #actionStepper == 5 and #enableClanQuest == 1 #actionStepper = 0 goto :checkClanQuest else #actionStepper = 0 goto :checkBoss endif goto :runActions // ---------- CHECK PRESTIGE :checkPrestige if #prestigeSlide == 0 sleep 1000 #time = #time + 1000 sleep 100 //open stats sleep #btnDelay touchDown 0 #menuStats #menuY sleep #btnDelay touchUp 0 sleep 25 #time = #time + #btnDelay + #btnDelay + 125 //wait for slide sleep #menuSlideDelay #time = #time + #menuSlideDelay //slide top touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 sleep 50 touchUp 0 sleep 800 sleep #btnDelay #time = #time + #btnDelay + 1200 //lvl up sleep #btnDelay sleep 50 #time = #time + #btnDelay + 50 touchDown 0 466 580 sleep 50 touchUp 0 sleep 200 touchDown 0 466 580 sleep 50 touchUp 0 sleep 200 touchDown 0 466 580 sleep 50 touchUp 0 sleep 200 #time = #time + 750 sleep 400 endif if #prestigeSlide < 5 //slide down touchDown 1 280 740 sleep 200 touchMove 1 280 710 sleep 50 touchMove 1 280 500 sleep 50 touchMove 1 280 410 sleep 50 touchMove 1 280 400 sleep 50 touchUp 1 sleep 300 #time = #time + 700 #prestigeSlide = #prestigeSlide + 1 goto :checkPrestige endif touchDown 0 400 720 sleep 25 touchUp 0 sleep 25 sleep #menuPopUpDelay #time = #time + #menuPopUpDelay + 50 touchDown 0 240 640 sleep #btnDelay touchUp 0 sleep #menuPopUpDelay getColor #color1 430 540 if #color1 == 6384245 touchDown 0 330 535 sleep #btnDelay touchUp 0 sleep 16000 goto :afterPrestige else touchPress 470 450 touchPress 470 450 touchPress 470 450 touchPress 470 450 goto :checkPrestige endif goto :start // ---------- CHECK CLAN QUEST :checkClanQuest sleep 300 if #agree == 1 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 endif if #decline == 1 touchDown 0 200 630 sleep 25 touchUp 0 sleep 25 touchDown 0 200 630 sleep 25 touchUp 0 sleep 25 endif getRGB #colorRed #colorGreen #colorBlue 72 21 getColor #color1 65 795 if #colorRed < 190 and #colorRed > 120 and #color1 == #colorStatsButton #recheckClanQuest = 1 goto :checkClanQuestReady endif goto :start :checkClanQuestReady //open menu sleep #btnDelay touchDown 0 80 25 sleep #btnDelay touchUp 0 sleep #btnDelay + 250 getRGB #colorRed #colorGreen #colorBlue 428 639 if #colorRed == -217 or #colorGreen == -97 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 endif //touch clan icon bottom touchDown 0 100 730 sleep #btnDelay touchUp 0 sleep #loadingClanQuestDelay getColor #color1 420 725 if #color1 == -1785765 and #clanQuestCount == 0 #recheckClanQuest = 0 goto :clanQuestClose endif //boss progress color getColor #color1 175 335 #clanQuestLoopCount = 0 if #color1 == 2055160 //boss up touchDown 0 310 740 sleep #btnDelay touchUp 0 sleep #menuPopUpDelay goto :clanQuestCheckDias elseif #color1 == 0 //boss down #recheckClanQuest = 0 endif //close (and recheck) goto :clanQuestClose :clanQuestCheckDias getColor #color1 40 215 if #color1 == -7775689 //no dias left #recheckClanQuest = 0 goto :clanQuestClose else touchDown 0 325 450 sleep #btnDelay touchUp 0 sleep 3000 getColor #color1 20 770 goto :clanQuestHit endif :clanQuestHit if #color1 == -28929 and #clanQuestLoopCount == 0 //add quest #clanQuestCount = #clanQuestCount + 1 endif #clanQuestLoopCount = #clanQuestLoopCount + 1 if #color1 == -28929 and #clanQuestLoopCount < 1000 //hit the boss touchDown 0 180 730 touchUp 0 sleep 28 goto :clanQuestHit elseif #clanQuestLoopCount > 950 goto :clanQuestClose endif :clanQuestClose getColor #color1 65 788 if #color1 == #colorStatsButton goto :clanQuestCloseCheck else touchDown 0 415 45 sleep 35 touchUp 0 sleep 200 touchDown 0 420 210 sleep 35 touchUp 0 sleep 200 goto :clanQuestClose endif :clanQuestCloseCheck if #recheckClanQuest == 1 and #clanQuestCount < #clanQuestRunsPerReadyUp goto :checkClanQuestReady else #clanQuestCount = 0 goto :start endif // ----------- LEVEL SKILLS :openSwordMasterTab //open sword master tab sleep #btnDelay #time = #time + #btnDelay touchDown 0 #menuStats #menuY sleep #btnDelay #time = #time + #btnDelay touchUp 0 //wait for slide sleep #menuSlideDelay #time = #time + #menuSlideDelay //slide top touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 600 #time = #time + 1100 if #enableSkills == 1 or #enableHeroes == 1 goto :checkSkills endif goto :closeMenu :checkSkills if #prestige == 0 and #startSkillCheckNow == 0 goto :checkSkillsFinish endif if #skillsUnlocked == 6 and #justUnlockSkills == 1 goto :checkSkillsFinish endif // there! if #minutes >= 1 toast minutes >= 1, stop now goto :checkSkillsFinish endif #skillCheckStepper = #skillCheckStepper + 1 if #skillCheckStepper == 1 sleep #btnDelay #time = #time + #btnDelay touchDown 0 466 670 sleep #btnDelay #time = #time + #btnDelay touchUp 0 goto :maxHS elseif #skillCheckStepper <= 6 goto :checkSkillsUnlock endif //slide back touchDown 1 280 650 sleep 200 touchMove 1 280 600 sleep 50 touchMove 1 280 700 sleep 50 touchMove 1 280 750 sleep 50 touchMove 1 280 780 touchUp 1 #time = #time + 350 goto :checkSkillsFinish :lvlSkill #time = #time + 100 if #justUnlockSkills == 0 getRGB #colorRed #colorGreen #colorBlue 459 755 if #colorBlue <= -45 sleep 10 #time = #time + 10 goto :endLvlSkill else touchPress 0 459 755 sleep 50 touchPress 0 459 755 sleep 50 #time = #time + 300 endif goto :endLvlSkill else if #skillCheckStepper >= 2 and #unlocked >= 5 goto :endLvlSkill else touchPress 0 459 755 sleep 50 #time = #time + 50 if #unlocked < 5 #unlocked = #unlocked + 1 endif goto :endLvlSkill endif endif :endLvlSkill if #skillCheckStepper == 6 goto :checkSkills else goto :checkSkillsSlideDown endif :maxHS #loopBreak = #loopBreak + 1 if #loopBreak > 16 #loopBreak = 0 //slide top touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 750 #time = #time + 1100 goto :checkSkills endif getColor #skillAvailable 460 700 if #skillAvailable >= -7963574 and #skillAvailable <= -7034609 #loopBreak = 0 goto :checkSkills else touchPress 0 466 700 sleep 40 #time = #time + 50 goto :maxHS endif :checkSkillsUnlock sleep 200 #time = #time + 250 getRGB #colorRed #colorGreen #colorBlue 450 660 if #colorBlue == 2 or #colorBlue == 5 #skillsUnlocked = #skillsUnlocked + 1 endif if #colorBlue == 2 sleep 100 touchDown 0 466 660 sleep 250 touchUp 0 sleep 200 #time = #time + 550 endif if #justUnlockSkills == 0 getColor #skillAvailable 466 730 if #skillAvailable == #skillBlue goto :checkSkillsSlideDown else sleep 50 #time = #time + 50 endif getColor #skillAvailable 466 730 if #skillAvailable == #skillBlue else goto :lvlSkill endif endif if #skillCheckStepper == 6 goto :checkSkills endif goto :checkSkillsSlideDown :checkSkillsFinish #skillCheckStepper = 0 if #enableHeroes == 1 goto :runActions endif goto :closeMenu :checkSkillsSlideDown //slide touchDown 1 280 750 sleep 200 touchMove 1 280 725 sleep 50 touchMove 1 280 660 sleep 50 touchMove 1 280 655 sleep 50 touchMove 1 280 649 sleep 200 touchUp 1 #time = #time + 550 goto :checkSkills :closeMenu sleep #btnDelay #time = #time + #btnDelay touchDown 0 #menuCloseX #menuCloseY sleep #btnDelay #time = #time + #btnDelay touchUp 0 sleep #menuSlideDelay #time = #time + #menuSlideDelay goto :runActions // ---------- LEVEL HEROES :levelHeroes if #count < 2 if #lateRun < 1 and #count < 2 if #count == 0 sleep 100 //open stats sleep #btnDelay #time = #time + #btnDelay + 100 touchDown 0 #menuStats #menuY sleep #btnDelay #time = #time + #btnDelay touchUp 0 sleep 20 //wait for slide sleep #menuSlideDelay #time = #time + #menuSlideDelay endif //slide top touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 sleep 50 touchUp 0 sleep 750 //slide top touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 sleep 50 touchUp 0 sleep 750 //slide top touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 sleep 50 touchUp 0 sleep 750 sleep #btnDelay #time = #time + #btnDelay + 3450 touchDown 0 466 580 sleep 50 touchUp 0 sleep 200 touchDown 0 466 580 sleep 50 touchUp 0 sleep 200 touchDown 0 466 580 sleep 50 touchUp 0 sleep 200 #time = #time + 750 endif if #lateRun > 0 and #count < 1 #time = #time + #minz #seconds = (#time/1000)%60 #secondsTotal = #time/1000 #minutes = (#time/1000)/60 #lateRun = 0 endif if #count < 2 #count = #count + 1 endif if #count < 2 goto :levelHeroes endif //close stats sleep #btnDelay #time = #time + #btnDelay touchPress 0 #menuCloseX #menuCloseY touchPress 0 #menuCloseX #menuCloseY touchPress 0 #menuCloseX #menuCloseY sleep #menuSlideDelay #time = #time + #menuSlideDelay endif //collect gold touchDown 0 30 230 sleep 50 touchUp 0 sleep 50 #time = #time + 100 if #agree == 1 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 touchDown 0 300 630 sleep 25 touchUp 0 sleep 25 #time = #time + 150 endif if #decline == 1 touchDown 0 200 630 sleep 25 touchUp 0 sleep 25 touchDown 0 200 630 sleep 25 touchUp 0 sleep 25 #time = #time + 100 endif //open menu sleep #btnDelay #time = #time + #btnDelay touchDown 0 #menuHeroes #menuY sleep #btnDelay #time = #time + #btnDelay touchUp 0 sleep 1000 #time = #time + 1000 if #tryWithDelay == 1 sleep 3000 endif #loopDetectionCount = #loopDetectionCount + 1 if #loopDetectionCount > 4 #loopDetectionCount = 0 goto :loopDetected endif getColor #color1 95 764 if #color1 == #colorWhite #loopDetectionCount = 0 #tryWithDelay = 0 #time = #time + 2000 //scroll up touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 200 touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 200 #time = #time + 1100 goto :scrollTop endif #tryWithDelay = 1 goto :levelHeroes :scrollTop #loopDetectionCount = #loopDetectionCount + 1 if #loopDetectionCount > 20 goto :loopDetected endif getColor #color1 300 510 if #color1 == #colorGray #loopDetectionCount = 0 sleep 400 #time = #time + 400 touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 600 #time = #time + 950 goto :lvlTopHero endif touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 200 touchDown 0 280 650 sleep 200 touchMove 0 280 600 sleep 50 touchMove 0 280 700 sleep 50 touchMove 0 280 750 sleep 50 touchMove 0 280 780 touchUp 0 sleep 200 #time = #time + 2 * 550 goto :scrollTop :lvlTopHero touchPress 0 460 670 sleep #btnDelay touchPress 0 460 670 sleep #btnDelay touchPress 0 460 670 sleep #btnDelay touchPress 0 460 670 sleep #btnDelay #time = #time + #btnDelay * 4 //since skills should have been maxed, it wont go to openSwordMasterTab after if #unlocked >= 8 or #maxedOutSkills > 1 #actionStepper = #actionStepper + 1 endif if #minutes >= #stopLevelSkillMins and #justUnlockSkills == 0 #actionStepper = #actionStepper + 1 endif //level only top hero at this time if #minutes >= 999 goto :levelHeroesPressLevelUp endif //lvl up only nearby heroes at this time onwards //edit as you see fit if #minutes >= 15 or #lateRun > 0 //slide down touchDown 1 280 740 sleep 200 touchMove 1 280 710 sleep 50 touchMove 1 280 500 sleep 50 touchMove 1 280 410 sleep 50 touchMove 1 280 400 touchUp 1 sleep 300 #time = #time + 650 goto :levelHeroesPressLevelUp endif goto :levelHeroesScrollDown :levelHeroesScrollDown #loopDetectionCount = #loopDetectionCount + 1 if #loopDetectionCount == 25 goto :loopDetected endif getColor #color1 440 760 if #color1 == #colorGray #loopDetectionCount = 0 touchDown 1 280 750 touchMove 1 280 745 sleep 100 touchMove 1 280 740 touchMove 1 280 735 sleep 50 touchMove 1 280 700 touchMove 1 280 690 sleep 50 touchMove 1 280 500 touchMove 1 280 450 sleep 20 touchMove 1 280 420 touchMove 1 280 410 sleep 50 touchMove 1 280 400 touchUp 1 sleep 300 touchDown 1 280 750 touchMove 1 280 745 sleep 100 touchMove 1 280 740 touchMove 1 280 735 sleep 50 touchMove 1 280 700 touchMove 1 280 690 sleep 50 touchMove 1 280 500 touchMove 1 280 450 sleep 20 touchMove 1 280 420 touchMove 1 280 410 sleep 50 touchMove 1 280 400 touchUp 1 sleep 300 #time = #time + 1140 goto :lvlBottomHero endif touchDown 1 280 750 touchMove 1 280 745 sleep 100 touchMove 1 280 740 touchMove 1 280 735 sleep 50 touchMove 1 280 700 touchMove 1 280 690 sleep 50 touchMove 1 280 500 touchMove 1 280 450 sleep 20 touchMove 1 280 420 touchMove 1 280 410 sleep 50 touchMove 1 280 400 touchUp 1 sleep 270 #time = #time + 540 goto :levelHeroesScrollDown :lvlBottomHero // for legacy coordinates: // 1 = Finn (Ranged) 466 570 // 2 = Nohni (Melee) 466 645 // 3 = Damon (Mage) 466 720 touchPress 0 466 720 sleep #btnDelay touchPress 0 466 720 sleep #btnDelay #time = #time + #btnDelay * 2 #seconds = (#time/1000)%60 #secondsTotal = #time/1000 #minutes = (#time/1000)/60 goto :levelHeroesPressLevelUp :levelHeroesSlideUpCollection #loopDetectionCount = #loopDetectionCount + 1 if #loopDetectionCount == 25 goto :loopDetected endif getColor #color1 300 510 if #color1 == #colorGray #loopDetectionCount = 0 goto :closeMenu endif touchDown 1 280 510 sleep 20 touchMove 1 280 512 touchMove 1 280 514 touchMove 1 280 516 sleep 20 touchMove 1 280 520 touchMove 1 280 540 sleep 20 touchMove 1 280 580 touchMove 1 280 600 sleep 20 touchMove 1 280 630 touchMove 1 280 670 sleep 20 touchMove 1 280 690 touchMove 1 280 700 sleep 20 touchMove 1 280 736 touchMove 1 280 738 sleep 20 touchMove 1 280 740 touchMove 1 280 742 sleep 200 touchUp 1 touchPress 1 280 750 #time = #time + 620 goto :levelHeroesPressLevelUp :levelHeroesPressLevelUp #pressLevelUpLoopCount = #pressLevelUpLoopCount + 1 touchDown 1 466 720 sleep 30 touchUp 1 sleep 30 touchDown 1 466 700 sleep 30 touchUp 1 sleep 30 touchDown 1 466 680 sleep 30 touchUp 1 sleep 30 touchDown 1 466 660 sleep 30 touchUp 1 sleep 30 touchDown 1 466 640 sleep 30 touchUp 1 sleep 30 touchDown 1 466 620 sleep 30 touchUp 1 sleep 30 touchDown 1 466 600 sleep 30 touchUp 1 sleep 30 touchDown 1 466 580 sleep 30 touchUp 1 sleep 30 touchDown 1 466 560 sleep 30 touchUp 1 sleep 30 touchDown 1 466 540 sleep 30 touchUp 1 sleep 30 #time = #time + 600 if #pressLevelUpLoopCount < #heroIntensity goto :levelHeroesPressLevelUp endif #pressLevelUpLoopCount = 0 goto :levelHeroesSlideUpCollection :closeMenu //close stats sleep #btnDelay #time = #time + #btnDelay touchPress 0 #menuCloseX #menuCloseY touchPress 0 #menuCloseX #menuCloseY touchPress 0 #menuCloseX #menuCloseY sleep #menuSlideDelay #time = #time + #menuSlideDelay goto :runActions // ---------- CHECK BOSS :checkBoss getColor #color1 139 85 if #color1 == #colorWhite goto :pressSkills endif getColor #color2 459 29 if #startBossSkill == 2 getColor #color1 108 685 elseif #startBossSkill == 4 getColor #color1 268 685 elseif #startBossSkill == 3 getColor #color1 189 685 elseif #startBossSkill == 5 getColor #color1 348 685 elseif #startBossSkill == 6 getColor #color1 428 685 endif if #color1 == #colorWhite and #color2 == #colorBlack goto :startBossWithSkills elseif #color2 == #colorBlack and #startBossSkill == 0 touchDown 0 390 36 sleep #btnDelay touchUp 0 sleep #btnDelay touchDown 0 390 36 sleep #btnDelay touchUp 0 sleep #btnDelay #time = #time + 4* #btnDelay endif //hatchEggs touchPress 0 30 285 sleep 25 touchUp 0 sleep #btnDelay #time = #time + #btnDelay goto :pressSkills :startBossWithSkills getColor #color 372 24 if #color == 1204718 touchPress 0 390 36 sleep 300 #time = #time + 300 goto :startBossWithSkills endif #time = #time + 400 if #startBossSkill == 2 touchPress 0 120 710 sleep 200 goto :startBossWithSecondarySkill elseif #startBossSkill == 3 touchPress 0 200 710 sleep 200 goto :startBossWithSecondarySkill elseif #startBossSkill == 4 touchPress 0 280 710 sleep 200 goto :startBossWithSecondarySkill elseif #startBossSkill == 5 touchPress 0 360 710 sleep 200 goto :startBossWithSecondarySkill elseif #startBossSkill == 6 touchPress 0 430 710 sleep 200 goto :startBossWithSecondarySkill endif :startBossWithSecondarySkill if #startBossSecondarySkill == 2 touchPress 0 120 710 elseif #startBossSecondarySkill == 3 touchPress 0 200 710 elseif #startBossSecondarySkill == 4 touchPress 0 280 710 elseif #startBossSecondarySkill == 5 touchPress 0 360 710 elseif #startBossSecondarySkill == 6 touchPress 0 430 710 endif #time = #time + 400 goto :pressSkills // ---------- RANDOM ATTACK :randomTouch rand #randomX 60 415 if #enableFairies == 1 rand #randomY 160 420 else rand #randomY 270 420 endif //equipment stacking if #equipStack == 1 if #randomX > 280 and #randomX < 430 and #randomY > 300 goto :randomTouch endif endif //prevent hero story window if #randomY > 184 and #randomY < 233 and #randomX > 403 goto :randomTouch endif if #enableTapping == 1 touchDown 0 #randomX #randomY touchUp 0 endif sleep 35 #time = #time + #hitDelay goto :start
There you go. Sorry it took me so long to respond
what i did notice was that you still have the double :closeMenu (and another section i forgot) which was overlooked at the base Tune code and something I fixed(removed) maybe 2 big patches ago. Maybe you'd want to start from a new copy of the script and redo your changes?
-----
to everyone,
a new development code [Only registered and activated users can see links. Click Here To Register...] is in the works. just better integration. again, read the patch notes. this is in the temporary development branch btw
Mention bugs you experience. i am currently looking at instances when you get stuck in a fairy ad. Tell me at what instance this is (e.g. trying to prestige, trying to do CQ, etc.) so I can do a quick fix. currently fixed are the mentioned examples plus hero leveling fairy ad stuck (not as instant in the case of the hero leveling anti-fairy ad stuck)
EDIT 1: if you got the scipt as soon as I posted this reply, please re-get the script again. i made a mistake placing one condition oops haha