-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
143 lines (122 loc) · 4.3 KB
/
index.js
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
import settings from "./settings"
import axios from "../axios"
import { clientChat, clientWarning } from "./utils/utils"
import { data } from "./data/pog"
import { Colour, Format } from "./utils/constants"
// BIG TODO: osu! in minecraft pog
// another TODO: docstrings for functions
// another TODO: dragged register all in one
import "./data/location"
import "./utils/slayer"
import "./utils/triggers"
import "./utils/forgeevents"
import "./utils/render"
import "./utils/osu"
import "./features/update/updatecheck"
import "./features/debug/sound"
import "./features/dungeons/starmobs"
import "./features/dungeons/croesus"
import "./features/dungeons/salvage"
import "./features/general/logo"
import "./features/general/spam"
import "./features/kuudra/tokens"
import "./features/kuudra/kuudrapf"
import "./features/qol/coords"
import "./features/qol/deathanim"
import "./features/qol/entityrenders"
import "./features/rift/berberis"
import "./features/rift/odonata"
import "./features/rift/sound"
import "./features/slayer/warps"
import "./features/slayer/miniboss"
import "./features/slayer/eman"
import "./features/slayer/slayerxp"
import "./features/slayer/alert"
import "./features/slayer/summons"
import "./features/osu/commands"
import "./features/combat/ghost"
register("command", (...args) => {
if (args == null || !args.length) settings.openGUI()
else {
switch (args[0]) {
case "help":
case "commands":
let helpStr = " \n- /aq setkey <api key> - sets the api key for the mod\n"
helpStr += "- /aq testkey - tests the api key\n"
helpStr += "- /aq (help|commands) - shows this message\n"
clientChat(helpStr)
break
case "setkey":
if (args[1]) {
const akey = args[1]
const testurl = `https://api.hypixel.net/skyblock/news?key=${akey}`
// test key
axios.get(testurl, {
headers: {
"User-Agent": "Mozilla/5.0 (ChatTriggers)"
}
})
.then(res => {
clientChat(`${Colour.GREEN}${Format.BOLD}Successfully set API key!`)
data.apikey = akey
data.save()
})
.catch(err => {
if (err.code == 403) clientWarning(`${Colour.RED}${Format.BOLD}Invalid API key!`)
else clientWarning(`${Colour.RED}${Format.BOLD}Error setting API key! Code: ${err.code}`)
})
}
break
case "testkey":
const testurl = `https://api.hypixel.net/skyblock/news?key=${data.apikey}`
axios.get(testurl, {
headers: {
"User-Agent": "Mozilla/5.0 (ChatTriggers)"
}
})
.then(res => {
clientChat(`${Colour.GREEN}API key is valid!`)
})
.catch(err => {
clientWarning(`${Colour.RED}API key is invalid!`)
})
break
case "getkey":
ChatLib.command(`ct copy ${data.apikey}`, true)
clientChat(`${Colour.GREEN}API key copied to clipboard!`)
break
case "col":
case "color":
case "colour":
ChatLib.chat(colourMsg())
break
}
}
}).setName("aquila").setAliases("aq")
const colourMsg = () => {
return `
§0BLACK
§1DARK_BLUE
§2DARK_GREEN
§3DARK_AQUA
§4DARK_RED
§5DARK_PURPLE
§6GOLD
§7GRAY
§8DARK_GRAY
§9BLUE
§aGREEN
§bAQUA
§cRED
§dLIGHT_PURPLE
§eYELLOW
§fWHITE`
}
register("gameLoad", () => {
data.last_load = new Date().getTime()
if (data.apikey == "none") clientWarning(`NO API KEY! SET USING: ${Format.RESET}${Colour.RED}/aq setkey <key>${Format.RESET}${Colour.RED}${Format.BOLD}`)
})
register("worldLoad", () => {
data.last_unload = new Date().getTime()
if (data.apikey == "none") clientWarning(`NO API KEY! SET USING: ${Format.RESET}${Colour.RED}/aq setkey <key>${Format.RESET}${Colour.RED}${Format.BOLD}`)
})