-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtt2.lua
92 lines (77 loc) · 3.13 KB
/
tt2.lua
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
-- Main Script for TT2
-- Flags
local premiumAccount = {type = CONTROLLER_TYPE.SWITCH, title = "Do you have a Premium Account?", key = "premium", value = 1}
local clickFairies = {type = CONTROLLER_TYPE.SWITCH, title = "Tap Fairies?", key = "fairies", value = 1}
local clickFlashZip = {type = CONTROLLER_TYPE.SWITCH, title = "Chase Flash Zip?", key = "flashzip", value = 1}
local clanQuestRounds = {type = CONTROLLER_TYPE.INPUT, title = "Number of CQ/Titan", key = "cqrounds", value = "1"}
local tapAttack = {type = CONTROLLER_TYPE.SWITCH, title = "Attack with Sword Master?", key = "attack", value = 1}
local prestigeTimer = {type = CONTROLLER_TYPE.INPUT, title = "Prestige Timer (in minutes)", key = "pTimer", value = "60"}
local primaryHero = {type = CONTROLLER_TYPE.PICKER, title = "Primary Hero", key = "hero", value = "Finn", options = {"Damon", "Finn", "Nohni"}}
local controls = {premiumAccount, clickFairies, clickFlashZip, tapAttack, clanQuestRounds, prestigeTimer, primaryHero}
local enableRemember = true
dialog(controls, enableRemember)
require "TT2.tt2config"
require "TT2.tt2utils"
if not fileExists("prestige") then writeTime("prestige") end
prestigeTime = readTime("prestige")
while appState("com.gamehivecorp.taptitans2") == "ACTIVATED" do
while hasPixel(Stage.main) do
-- Prestige Routine
if checkForPrestige(prestigeTimer.value) then
prestige()
levelSwordMaster()
learnSkills(1)
hireHeroes()
prestigeTime = readTime("prestige")
end
-- Clan Quest Routine
if tonumber(clanQuestRounds.value) > 0 then fightClanQuest(clanQuestRounds.value) end
-- Collection Routine
checkForGold()
checkForNewPet()
checkForDaily()
-- Find and Click
if clickFairies.value == 1 then chaseFairies() end
if clickFlashZip.value == 1 then chaseFlashZip() end
if mainStageBossAvailable() then tapButton(Menu.fightBoss) end
-- Use Skills
useSkill()
-- Level Hereos
if checkCounter then levelHeroes(primaryHero.value) end
-- Attack with Sword Master
if tapAttack.value == 1 then
ttap(0, 110, 680);
ttap(1, 220, 680);
ttap(2, 330, 620);
ttap(1, 380, 290);
ttap(0, 400, 620);
ttap(1, 550, 400);
ttap(2, 680, 660);
end
end
while not hasPixel(Stage.main) do
checkCounter = true
-- Fairy Ad
if premiumAccount.value == 1 and hasPixel(Stage.fairyAd) then
ttap(1, 566, 1040)
elseif hasPixel(Stage.fairyAd) then
tap(1, 200, 1040);
usleep(Delay.menu);
end
-- Item Splash, Egg Splash, or Pet Splash
if hasPixel(Stage.splash) then
usleep(Delay.animation)
ttap(1, 357, 350)
usleep(Delay.menu)
end
if hasPixel(Stage.splashDark) then
usleep(Delay.animation)
ttap(1, 357, 350)
usleep(Delay.menu)
end
-- Transition
if hasPixel(Stage.transition) then
usleep(2e6)
end
end
end