forked from djo5296/Tap-Titans-2-Progress-Bot
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Advanced-Click
2430 lines (2211 loc) · 45.8 KB
/
Advanced-Click
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// May 10, 2019
// - Tap Titans 2 AdvancedClickBot by Tune389 [ v1.3 dev 1]
// edited by djo5296 '17-12-30
// now fully handled by chrisreyn
// thanks to tommy8208 for testing
// code and suggestions from atereshkov, GitGud2018
SCREEN_SIZE: 480x800
// ---------- Click Areas
var #enableFairies 1
var #enablePremiumCollect 1
var #agree 1
var #decline 0
var #enableTapping 1
// 1 = (default) hit the titans with your sword master
// 0 = disable hits (except on CQ)
var #enableCO 1
var #PHoM 1
var #astralAwakening 1
// #astralAwakening is also affected by #equipStack below
var #equipStack 0
// if set to 1, will skip some heroes when tapping for Astral Awakening
// ---------- Actions ---------- [ Prestige ]
var #enableAutoprestige 1
var #lateRun 0
// if 0, no change to run
// if #lateRun > 0, will resume run at #minutes = #lateRun
// 2nd run onwards (aka after prestige) will NOT adjust time
var #prestigeStartTime 40
// input minimum time in minutes before prestige
// prestige time range is ALWAYS +10 more minutes greater than StartTime to prevent teapot
// ---------- Actions ---------- [ General ]
var #runActionsEveryXSeconds 94
// recommended equal to total SC+ED+DShift duration minus ~6 or 7 seconds
// ^esp if you cant level SC in the first run
// ^so that when runActions runs, SC is done and script can level up SC
// also note that displayed run time is not very accurate with real time
// IMPORTANT go to line 248 and edit the settings there
var #runActionsOnStart 1
// 1 = (default) run actions on script start
// 0 = run actions after given run time above
// ---------- Actions ---------- [ Change Helm ]
var #changeHelmVARIABLE 1
var #gear1 2
var #gear2 1
var #timeChangeHelm 35
// ---------- Actions ---------- [ ClanQuest ]
var #enableClanQuest 0
//clan boss with max possible hits
var #clanQuestRunsPerReadyUp 3
// 1 = (default) attack every ready up once for free
// 2-99 = spend dias for more attacks
// ---------- Actions ---------- [ Heroes ]
var #enableHeroes 1
var #heroIntensity 2
var #topHeroes 0
//level top hero every X seconds, leave at 0 to disable
// ---------- Actions ---------- [ Skills ]
var #enableSkills 1
var #skipHS 0
var #fullManaSkill 6
// 1 = HS
// 2 = DS
// 3 = HoM
// 4 = FS
// 5 = WC
// 6 = SC
//press given skills every X seconds
var #intervalHS 0
var #intervalDS 11
var #intervalFS 31
var #intervalHoM 11
var #intervalWC 11
var #intervalSC 6
var #scActiveCheck 1
//used mainly for SC+Mana Siphon procs
//0 = Activate skills every X seconds normally
//1 = Activate skills every X seconds only if SC is active and has 1/4 duration left
// 1/4th duration of SC is usually enough to generate mana from a decent level of Mana Siphon
var #unlocked 0
// ^dont edit unless you know what it's for
//these will be the skill intervals when #lateRun > 0
//time dependent variable changes in :start will still apply, be sure to check :start section
if #lateRun > 0
#intervalHS = 0
#intervalDS = 11
#intervalFS = 31
#intervalHoM = 11
#intervalWC = 11
#intervalSC = 11
if #lateRun > #maxSkillsAtXMinutes
#unlocked = 8
else
#unlocked = 4
endif
endif
//just level each skill once
var #justUnlockSkills 0
// 1 = (default) just unlock
// 0 = level skills much as possible
// will always max HS and SC whether 1 or 0
// see Tune389 Issue 80 if using #justUnlockSkills 1
//only applicable when #justUnlockSkills == 1
// use 0 if you don't like
var #maxSkillsAtXMinutes 34
var #stopLevelSkillMins 3
//run skill check after prestige (0) or now (1)
var #startSkillCheckNow 1
// ---------- Actions ---------- [ Boss ]
//wait for given skill (2-6) then start boss
var #startBossSkill 6
//optional skill which will be clicked on start (not checked)
var #startBossSecondarySkill 2
// ---------- Developer / Expert
var #maxHitCount 9999999
//show current script runtime
var #showCurrentTime 1
//if you wanna sync the script time with real time you can play around with this value
var #timeScaleAddition 20
// ---------- Dec
var #detour 1
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 60
if #prestigeStartTime > 0
rand #prestigeAfterXMinutes #prestigeStartTime #prestigeEndTime
else
set #prestigeStartTime 29
endif
var #maxedOutSkills 0
if #lateRun > 0
#maxedOutSkills = 2
#startSkillCheckNow = 0
endif
var #tournyFirstRunTimer 0
if #tournyFirstRunTimer > 0
#prestigeAfterXMinutes = #tournyFirstRunTimer
#prestigeStartTime = 35
#timeChangeHelm = 30
endif
calc #prestigeEndTime #prestigeStartTime + 10
var #prestigeSlide 0
var #manualMax 0
var #hero 0
var #scAC 0
// ---------- Delays
var #btnDelay 150
var #hitDelay 40
var #hitDelay2 20
var #menuSlideDelay 200
var #menuPopUpDelay 500
var #loadingClanQuestDelay 3000
var #shipDelay 200
var #skillDelay 50
// ---------- Menu Coords
var #menuY 780
var #menuStats 15
var #menuHeroes 120
var #menuCloseY 455
var #menuCloseX 466
var #gearX 395
if #gear1 == 1
set #gear1 590
elseif #gear1 == 2
set #gear1 670
elseif #gear1 == 3
set #gear1 750
endif
if #gear2 == 1
set #gear2 590
elseif #gear2 == 2
set #gear2 670
elseif #gear2 == 3
set #gear2 750
endif
// ---------- 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
//add general execution delays
#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 #enableSkills == 1
//time dynamic skill interval clicks
if #minutes > 10
#runActionsEveryXSeconds = 50
endif
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 30
touchUp 0
sleep 30
#time = #time + 60
endif
if #resultUpdateTime == 0 and #enablePremiumCollect == 1 and #decline == 1
touchDown 0 195 630
sleep 30
touchUp 0
sleep 30
#time = #time + 60
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
toast Prestiging at #prestigeAfterXMinutes minutes
goto :checkBoss
elseif #resultManaPool == 0
goto :checkMana
elseif #loopCount == #maxHitCount
#loopCount = 0
goto :randomTouch
else
goto :randomTouch
endif
:end
:afterPrestige
#detour = 1
#count = 0
#skillsUnlocked = 0
#time = 0
#seconds = 0
#secondsTotal = 0
#minutes = 0
#unlocked = 0
#lateRun = 0
#runActionsEveryXSeconds = #rAEXS
#maxedOutSkills = 0
#prestigeSlide = 0
#startSkillCheckNow = 1
#intervalHS = #iHS
#intervalDS = #iDS
#intervalFS = #iFS
#intervalHoM = #iHoM
#intervalWC = #iWC
#intervalSC = #iSC
rand #prestigeAfterXMinutes #prestigeStartTime #prestigeEndTime
goto :switchHelm2
:switchHelm2
if #changeHelmVARIABLE == 2
sleep 100
//open equipment tab
sleep #btnDelay
touchDown 0 200 780
sleep #btnDelay
touchUp 0
sleep 20
//wait for menu open
sleep #menuSlideDelay
//check if opened right
sleep #menuSlideDelay
getRGB #colorRed #colorGreen #colorBlue 330 480
if #colorRed != 84 or #colorGreen != 76 or #colorBlue != 76 or #loopBreak < 5
sleep 300
#loopBreak = #loopBreak + 1
goto :switchHelm2
endif
//open helm tab
#loopBreak = 0
touchPress 0 130 545
sleep #btnDelay
touchPress 0 130 545
sleep #btnDelay
touchPress 0 130 545
sleep #btnDelay
touchPress 0 130 545
sleep #btnDelay
sleep 500
//equip 2nd gear
touchPress 0 #gearX #gear1
sleep #btnDelay
touchPress 0 #gearX #gear1
sleep #btnDelay
touchPress 0 #gearX #gear1
sleep #btnDelay
touchPress 0 #gearX #gear1
sleep #btnDelay
//close equipment
sleep #btnDelay
touchPress 0 #menuCloseX #menuCloseY
touchPress 0 #menuCloseX #menuCloseY
touchPress 0 #menuCloseX #menuCloseY
sleep #menuSlideDelay
#changeHelmVARIABLE = 1
endif
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
toast loop detected - repeating ...
#loopCount = 0
#loopDetectionCount = 0
goto :start
// ---------- PRESS SKILLS
:pressSkills
//click "Fight Boss"
getColor #color1 372 24
if #color1 == 1076975
toast FightBoss1
touchPress 0 390 36
sleep 40
touchUp
sleep 40
#time = #time + 80
goto :pressSkills
endif
touchDown 0 #menuCloseX #menuCloseY
sleep 40
touchUp 0
sleep #menuSlideDelay
#time = #time + #menuSlideDelay + 40
if #enableCO == 1
touchPress 0 175 410
sleep #shipDelay
touchPress 0 175 410
sleep #shipDelay
touchPress 0 175 410
sleep #shipDelay
touchPress 0 175 410
sleep #shipDelay
#time = #time + 4 * #shipDelay
endif
#timeDiff = #secondsTotal - #lastPressSC
if #timeDiff >= #intervalSC and #intervalSC > 0
#lastPressSC = #secondsTotal
touchPress 0 430 710
sleep #skillDelay
touchPress 0 430 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
#timeDiff = #secondsTotal - #lastPressHoM
if #timeDiff >= #intervalHoM and #intervalHoM > 0
if #scActiveCheck == 1
if #scAC == 0
#scAC = 1
getRGB #colorRed #colorGreen #colorBlue 423 688
#time = #time + 100
endif
if #colorRed == -1 and #colorBlue == 0 and #intervalHoM > 0
#lastPressHoM = #secondsTotal
touchPress 0 200 710
sleep #skillDelay
touchPress 0 200 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
elseif #scActiveCheck == 0
#lastPressHoM = #secondsTotal
touchPress 0 200 710
sleep #skillDelay
touchPress 0 200 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
endif
goto :pressSkillsB
:pressSkillsB
#timeDiff = #secondsTotal - #lastPressDS
if #timeDiff >= #intervalDS and #intervalDS > 0
if #scActiveCheck == 1
if #scAC == 0
#scAC = 1
getRGB #colorRed #colorGreen #colorBlue 423 688
#time = #time + 100
endif
if #colorRed == -1 and #colorBlue == 0 and #intervalDS > 0
#lastPressDS = #secondsTotal
touchPress 0 120 710
sleep #skillDelay
touchPress 0 120 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
elseif #scActiveCheck == 0
#lastPressHoM = #secondsTotal
touchPress 0 120 710
sleep #skillDelay
touchPress 0 120 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
endif
#timeDiff = #secondsTotal - #lastPressWC
if #timeDiff >= #intervalWC and #intervalWC > 0
if #scActiveCheck == 1
if #scAC == 0
#scAC = 1
getRGB #colorRed #colorGreen #colorBlue 423 688
#time = #time + 100
endif
if #colorRed == -1 and #colorBlue == 0 and #intervalWC > 0
#lastPressWC = #secondsTotal
touchPress 0 360 710
sleep #skillDelay
touchPress 0 360 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
elseif #scActiveCheck == 0
#lastPressHoM = #secondsTotal
touchPress 0 360 710
sleep #skillDelay
touchPress 0 360 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
endif
goto :pressSkillsC
:pressSkillsC
#timeDiff = #secondsTotal - #lastPressFS
if #timeDiff >= #intervalFS and #intervalFS > 0
if #scActiveCheck == 1
if #scAC == 0
#scAC = 1
getRGB #colorRed #colorGreen #colorBlue 423 688
#time = #time + 100
endif
if #colorRed == -1 and #colorBlue == 0 and #intervalFS > 0
#lastPressFS = #secondsTotal
touchPress 0 280 710
sleep #skillDelay
touchPress 0 280 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
elseif #scActiveCheck == 0
#lastPressHoM = #secondsTotal
touchPress 0 280 710
sleep #skillDelay
touchPress 0 280 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
endif
#timeDiff = #secondsTotal - #lastPressHS
if #timeDiff >= #intervalHS and #intervalHS > 0
if #scActiveCheck == 1
if #scAC == 0
#scAC = 1
getRGB #colorRed #colorGreen #colorBlue 423 688
#time = #time + 100
endif
if #colorRed == -1 and #colorBlue == 0 and #intervalHS > 0
#lastPressHS = #secondsTotal
touchPress 0 40 710
sleep #skillDelay
touchPress 0 40 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
elseif #scActiveCheck == 0
#lastPressHoM = #secondsTotal
touchPress 0 40 710
sleep #skillDelay
touchPress 0 40 710
sleep #skillDelay
#time = #time + #skillDelay * 2
endif
endif
#scAC = 0
if #detour == 1
#detour = 0
sleep 1200
goto :levelHeroes2
endif
goto :pressSkillsD
:pressSkillsD
if #topHeroes > 0
#timeDiff = #secondsTotal - #lastTopHeroes
if #timeDiff >= #topHeroes
#lastTopHeroes = #secondsTotal
sleep 100
//open stats
sleep #btnDelay
#time = #time + #btnDelay + 100
touchDown 0 #menuHeroes #menuY
sleep #btnDelay
touchUp 0
sleep 1000
#time = #time + 1000 + #btnDelay
//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 750
sleep #btnDelay
#time = #time + #btnDelay + 1150
//level top heroes
touchPress 0 410 580
sleep #btnDelay
touchPress 0 410 650
sleep #btnDelay
touchPress 0 410 730
sleep #btnDelay
#time = #time + #btnDelay * 3
//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
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
//since skills should have been maxed, it wont go to openSwordMasterTab after
if #unlocked >= 8 or #maxedOutSkills > 1 and #actionStepper == 1
#actionStepper = #actionStepper + 1
endif
if #justUnlockSkills == 0 and #minutes >= #stopLevelSkillMins and #actionStepper == 1
#actionStepper = #actionStepper + 1
endif
if #actionStepper == 1 and #enableSkills == 1 and #skillsUnlocked < 6
#skillsUnlocked = 0
goto :openSwordMasterTab
elseif #actionStepper == 2 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
sleep 4000
//#time = #time + 4000
if #agree == 1
touchDown 0 350 630
sleep 30
touchUp 0
sleep 30
touchDown 0 350 630
sleep 30
touchUp 0
sleep 30
touchDown 0 350 630
sleep 30
touchUp 0
sleep 30
endif
sleep 100
//open stats
sleep #btnDelay
touchDown 0 #menuStats #menuY
sleep #btnDelay
touchUp 0
sleep 30
//#time = #time + #btnDelay + #btnDelay + 130
//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
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
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
goto :checkPrestigeB
:checkPrestigeB
if #prestigeSlide < 7
//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 :checkPrestigeB
endif
#loopBreak = #loopBreak + 1
if #loopBreak > 11
#loopBreak = 0
#prestigeSlide = 0
//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 :checkPrestige
endif
touchDown 0 400 720
sleep 30
touchUp 0
sleep 30
sleep #menuPopUpDelay
//#time = #time + #menuPopUpDelay + 60
touchDown 0 240 640
sleep #btnDelay
touchUp 0
sleep #menuPopUpDelay
sleep 120
getColor #color1 430 540
if #color1 == 6384245
touchDown 0 330 535
sleep #btnDelay
touchUp 0
sleep 20000
goto :afterPrestige
else
touchPress 470 450
touchPress 470 450
touchPress 470 450
touchPress 470 450
#prestigeSlide = 0
goto :checkPrestige
endif
goto :start
// ---------- CHECK CLAN QUEST
:checkClanQuest
sleep 300
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
if #agree == 1
sleep 3500
//getRGB #colorRed #colorGreen #colorBlue 428 639
//if #colorRed == -216 or #colorGreen == -96
touchDown 0 300 630
sleep 50
touchUp 0
sleep 50
touchDown 0 300 630
sleep 50
touchUp 0
sleep 50
touchDown 0 300 630
sleep 50
touchUp 0
sleep 1100
//endif
endif
//open CQ menu
sleep #btnDelay
touchDown 0 80 25
sleep #btnDelay
touchUp 0
sleep #btnDelay
sleep 250
sleep 250
//touch clan icon bottom
touchDown 0 110 720
sleep #btnDelay
touchUp 0
sleep #loadingClanQuestDelay
sleep 3000
//check titan progress if still active or basically if you can hit titan
getRGB #colorRed #colorGreen #colorBlue 0 0
//420 725
//420 730
//if #color1 == -1785765 and #clanQuestCount == 0
#recheckClanQuest = 0
goto :clanQuestClose
endif
//check boss HP > 0
getRGB #colorRed #colorGreen #colorBlue 116 145
#clanQuestLoopCount = 0
if #colorRed == 0 or #colorGreen == -77 and #colorBlue == -57
//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
//330 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