aboutsummaryrefslogtreecommitdiff
path: root/features/fragBot/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-17 19:39:05 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-17 19:39:05 +0800
commit431e4fc9d1657a50ebc34b8ac24f9bfaea06417f (patch)
tree5987bb14f38d2999c682970429f34b41eb3e5826 /features/fragBot/index.js
parente73f2efdf0f50aa775c540317394d46428e9704f (diff)
downloadSoopyV2-431e4fc9d1657a50ebc34b8ac24f9bfaea06417f.tar.gz
SoopyV2-431e4fc9d1657a50ebc34b8ac24f9bfaea06417f.tar.bz2
SoopyV2-431e4fc9d1657a50ebc34b8ac24f9bfaea06417f.zip
Initial move to babel + change fetch to use async/await
Diffstat (limited to 'features/fragBot/index.js')
-rw-r--r--features/fragBot/index.js84
1 files changed, 0 insertions, 84 deletions
diff --git a/features/fragBot/index.js b/features/fragBot/index.js
deleted file mode 100644
index c6a2fd9..0000000
--- a/features/fragBot/index.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/// <reference types="../../../CTAutocomplete" />
-/// <reference lib="es2015" />
-import Feature from "../../featureClass/class";
-import SettingBase from "../settings/settingThings/settingBase";
-import ToggleSetting from "../settings/settingThings/toggle";
-
-class FragBot extends Feature {
- constructor() {
- super()
- }
-
- onEnable() {
- this.initVariables()
-
- this.hostingFragBot = false
- this.fragBotQueue = []
- this.commandQueue = []
-
- new SettingBase("To host a fragbot use /fragbot", "", undefined, "host_fragbot_info", this)
- new SettingBase("NOTE: All this does atm is accept party invites", "More features for this coming soon", true, "stat_next_to_name_description", this)
-
- // this.uploadToWebsite = new ToggleSetting("Advertise fragbot status", "Will show up as a fragbot in other peoples fragbot lists", true, "advertise_fragbot", this)
-
- this.registerCommand("fragbot", this.fragbotCommand)
-
- this.registerStep(false, 5, this.step).registeredWhen(() => this.hostingFragBot)
- this.registerStep(true, 2, this.step2).registeredWhen(() => this.hostingFragBot)
-
- this.registerChat("&9&m---------------------------${*}&r&9\n&r${player} &r&ehas invited you to join their party!\n&r&eYou have &r&c60 &r&eseconds to accept. &r&6Click here to join!&r&9\n&r&9&m----------------------------${*}&r", this.recievedPartyInvite)
- }
-
- step() {
- if (!this.hostingFragBot) return
-
- if (this.fragBotQueue.length > 0) {
- let player = this.fragBotQueue.shift()
- if (player) {
- this.commandQueue.push("/party leave")
-
- this.commandQueue.push("/party accept " + player)
- }
- }
- }
- step2() {
- if (!this.hostingFragBot) return
-
- if (this.commandQueue.length > 0) {
- let command = this.commandQueue.shift()
- if (command) {
- ChatLib.say(command)
- }
- }
- }
- recievedPartyInvite(player) {
- if (!this.hostingFragBot) return
- player = ChatLib.removeFormatting(player).split(" ").pop()
-
- this.fragBotQueue.push(player)
- }
-
- fragbotCommand(...args) {
- if (this.hostingFragBot) {
- this.hostingFragBot = false
- ChatLib.chat(this.FeatureManager.messagePrefix + "Fragbot has been disabled")
- } else {
- this.hostingFragBot = true
- ChatLib.chat(this.FeatureManager.messagePrefix + "Now acting as a fragbot, run /fragbot again to disable")
- }
- }
-
- initVariables() {
- this.hostingFragBot = undefined
- this.fragBotQueue = undefined
- this.commandQueue = undefined
- }
-
- onDisable() {
- this.initVariables()
- }
-}
-
-module.exports = {
- class: new FragBot()
-} \ No newline at end of file