Skip to content

Commit

Permalink
Merge pull request #86 from earthernsence/earth/the-miscellaneous-update
Browse files Browse the repository at this point in the history
The "add stuff" update
  • Loading branch information
earthernsence authored May 29, 2023
2 parents 5a5ba1d + 80dbca5 commit 673f873
Show file tree
Hide file tree
Showing 67 changed files with 2,045 additions and 671 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ config.json
package-lock.json
.vscode
test.js
/dist
/dist
/glyphapi
Binary file modified database.sqlite
Binary file not shown.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
"@typescript-eslint/parser": "^5.30.5",
"better-sqlite3": "^8.0.1",
"break_infinity.js": "^1.3.0",
"discord.js": "^14.0.2",
"bufferutil": "^4.0.7",
"discord.js": "^14.8.0",
"fs": "*",
"pm2": "^5.2.2",
"sequelize": "^6.6.4",
"sequelize-typescript": "^2.1.3",
"sqlite": "^4.0.21",
"sqlite3": "^5.0.0",
"ts-node": "^10.8.2"
"ts-node": "^10.8.2",
"utf-8-validate": "^5.0.10"
},
"devDependencies": {
"@types/node-fetch": "^2.6.2",
Expand All @@ -25,7 +27,7 @@
"wikijs": "^6.3.3"
},
"name": "adanswersbot",
"version": "4.1.0",
"version": "5.0.0",
"description": "Used to give answers for and about the web/mobile incremental game Antimatter Dimensions.",
"main": "bot.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const client = new Client({
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildMembers
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent
],
partials: [
Partials.Message,
Expand Down
4 changes: 0 additions & 4 deletions src/classes/events/InteractionEvents.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Client, CommandInteraction } from "discord.js";

export class InteractionEvents {
static commandInGeneral(interaction: CommandInteraction): void {
interaction.reply({ content: `hey buddy! can't use commands in general. nice try though. proud of u`, ephemeral: true });
}

static async hasCommand(interaction: CommandInteraction, client: Client): Promise<boolean> {
return await client.application?.commands.fetch().then(commands => commands.some(command => command.name === interaction.commandName)) as boolean;
}
Expand Down
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-unused-vars */
import { ChatInputApplicationCommandData, Client, CommandInteraction } from "discord.js";
import { ChatInputApplicationCommandData, ChatInputCommandInteraction, Client, CommandInteraction } from "discord.js";
import { Model, ModelStatic } from "sequelize/types";

export interface Command extends ChatInputApplicationCommandData {
run: (interaction: CommandInteraction, client: Client, tags?: ModelStatic<Model>) => void;
run: (interaction: ChatInputCommandInteraction, client: Client, tags?: ModelStatic<Model>) => void;
}
35 changes: 18 additions & 17 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { earlyinfinity } from "./commands/1/earlyinfinity";
import { galaxyboost } from "./commands/1/galaxyboost";
import { grindingforbreak } from "./commands/1/grindingforbreak";
import { infinity } from "./commands/1/infinity";
import { iugo } from "./commands/1/iugo";
// Import { iugo } from "./commands/1/iugo";
import { sacrifice } from "./commands/1/sacrifice";
import { swipetrick } from "./commands/1/swipetrick";

Expand All @@ -26,7 +26,7 @@ import { setcrunchauto } from "./commands/2/setcrunchauto";

import { onesixtyoneor162 } from "./commands/3/161or162";
import { earlyeternityprogression } from "./commands/3/earlyeternityprogression";
import { eep } from "./commands/3/eep";
// Import { eep } from "./commands/3/eep";
import { ep } from "./commands/3/ep";
import { eternitygrinding } from "./commands/3/eternitygrinding";
import { firstsplit } from "./commands/3/firstsplit";
Expand Down Expand Up @@ -79,12 +79,13 @@ import { notations } from "./commands/7/notations";
import { fivehours } from "./commands/8/5hours";
import { commands } from "./commands/8/commands";
import { contributors } from "./commands/8/contributors";
import { helperRequest } from "./commands/8/helper";
import { slashcommand } from "./commands/8/slashcommand";
// Import { helperRequest } from "./commands/8/helper";
import { report } from "./commands/8/report";
import { rolerequest } from "./commands/8/rolerequest";
import { slashcommand } from "./commands/8/slashcommand";

import { discordformatting } from "./commands/9/discordformatting";
import { invertedtheme } from "./commands/9/invertedtheme";
// Import { invertedtheme } from "./commands/9/invertedtheme";
import { ipepcolour } from "./commands/9/ipepcolour";
import { justask } from "./commands/9/justask";
import { paperclips } from "./commands/9/paperclips";
Expand All @@ -95,11 +96,11 @@ import { secretachievements } from "./commands/9/secretachievements";
import { site } from "./commands/9/site";
import { xyproblem } from "./commands/9/xyproblem";

import { bushism } from "./commands/69/bushism";
// Import { bushism } from "./commands/69/bushism";
import { deadchat } from "./commands/69/deadchat";
import { pins } from "./commands/69/pins";
import { slightsmile } from "./commands/69/slightsmile";
import { time } from "./commands/69/time";
// Import { time } from "./commands/69/time";
import { user } from "./commands/69/user";
import { wikipedia } from "./commands/69/wikipedia";
import { xkcd } from "./commands/69/xkcd";
Expand All @@ -108,25 +109,25 @@ import { help } from "./commands/misc/help";
import { meta } from "./commands/misc/meta";

export const commandsByPage: { [page: number]: Command[] } = {
1: [oneminuteinf, breakinfinity, bulkbuy, c9, columns, dimboostorgalaxy, earlyinfinity, galaxyboost, grindingforbreak, infinity, iugo, sacrifice, swipetrick],
1: [oneminuteinf, breakinfinity, bulkbuy, c9, columns, dimboostorgalaxy, earlyinfinity, galaxyboost, grindingforbreak, infinity, sacrifice, swipetrick],
2: [bugo, ic4, ic5, infinitydimensions, peakipmin, replicanti, setcrunchauto],
3: [onesixtyoneor162, earlyeternityprogression, eep, ep, eternitygrinding, firstsplit, infinitygrinding, respec, secondsplit, study, studytree, ts, timeshards],
3: [onesixtyoneor162, earlyeternityprogression, ep, eternitygrinding, firstsplit, infinitygrinding, respec, secondsplit, study, studytree, ts, timeshards],
4: [bankedinfinities, changeectree, dilation, dilationgrind, dilationtrees, ec, eco, ecs, ecsattt, eternitychallenge, eternitychallengeorder, failec],
5: [autoachievement, gamevsrealtime, perk, reality, rm],
6: [achievements, adbonus, bottombuttons, challenge, galaxyscaling, importexport, news, offlineticks, oom, upgrade],
7: [abb, androidorweb, antitables, decimal, howtoplay, notations],
8: [fivehours, commands, contributors, helperRequest, report, slashcommand],
9: [discordformatting, invertedtheme, ipepcolour, justask, paperclips, roles, savebank, savesharing, secretachievements, site, xyproblem],
69: [bushism, deadchat, pins, slightsmile, time, user, wikipedia, xkcd],
8: [fivehours, commands, contributors, report, rolerequest, slashcommand],
9: [discordformatting, ipepcolour, justask, paperclips, roles, savebank, savesharing, secretachievements, site, xyproblem],
69: [deadchat, pins, slightsmile, user, wikipedia, xkcd],
};

export const Commands: Command[] = [
// Page 1 - Infinity
oneminuteinf, breakinfinity, bulkbuy, c9, columns, dimboostorgalaxy, earlyinfinity, galaxyboost, grindingforbreak, infinity, iugo, sacrifice, swipetrick,
oneminuteinf, breakinfinity, bulkbuy, c9, columns, dimboostorgalaxy, earlyinfinity, galaxyboost, grindingforbreak, infinity, sacrifice, swipetrick,
// Page 2 - Break Infinity
bugo, ic4, ic5, infinitydimensions, peakipmin, replicanti, setcrunchauto,
// Page 3 - Eternity
onesixtyoneor162, earlyeternityprogression, eep, ep, eternitygrinding, firstsplit, infinitygrinding, respec, secondsplit, study, studytree, ts, timeshards,
onesixtyoneor162, earlyeternityprogression, ep, eternitygrinding, firstsplit, infinitygrinding, respec, secondsplit, study, studytree, ts, timeshards,
// Page 4 - Eternity Challenges / Dilation
bankedinfinities, changeectree, dilation, dilationgrind, dilationtrees, ec, eco, ecs, ecsattt, eternitychallenge, eternitychallengeorder, failec,
// Page 5 - Reality
Expand All @@ -136,11 +137,11 @@ export const Commands: Command[] = [
// Page 7 - Misc
abb, androidorweb, antitables, decimal, howtoplay, notations,
// Page 8 - Misc
fivehours, commands, contributors, helperRequest, report, slashcommand,
fivehours, commands, contributors, report, rolerequest, slashcommand,
// Page 9 - Misc
discordformatting, invertedtheme, ipepcolour, justask, paperclips, roles, savebank, savesharing, secretachievements, site, xyproblem,
discordformatting, ipepcolour, justask, paperclips, roles, savebank, savesharing, secretachievements, site, xyproblem,
// Page 69 - Very misc
bushism, deadchat, pins, slightsmile, time, user, wikipedia, xkcd,
deadchat, pins, slightsmile, user, wikipedia, xkcd,
// No page - bot info
help, meta
];
2 changes: 1 addition & 1 deletion src/commands/1/bulkbuy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const bulkbuy: Command = {
if (!interaction) return;

// eslint-disable-next-line max-len
const content: string = `This allows you to buy more than one set (ONLY on buy 10s) in one interval. This helps speed up runs overall when using autobuyers. At 512 bulk for all autobuyers on mobile and in the upcoming Reality update, bulk buy is maximised.
const content: string = `This allows you to buy more than one set (ONLY on buy 10s) in one interval. This helps speed up runs overall when using autobuyers. At 512 bulk for all autobuyers bulk buy is maximised.
Another explanation, courtesy of the mobile how to play: Once the interval of a Dimension Autobuyer is maxed, all future upgrades will double the amount the autobuyer purchases per tick. This can be disabled.`;

await interaction.reply({ content, ephemeral: !isHelper(interaction) });
Expand Down
2 changes: 1 addition & 1 deletion src/commands/2/bugo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const bugo: Command = {
if (!interaction || !interaction.isChatInputCommand()) return;

// eslint-disable-next-line max-len
const content: string = "https://cdn.discordapp.com/attachments/351479640755404820/1056773877193265172/bugo_v3_because_earth_sucks.png";
const content: string = "https://cdn.discordapp.com/attachments/351479640755404820/1090075280862888046/bugo-v2.png";

await interaction.reply({ content, ephemeral: !isHelper(interaction) });
}
Expand Down
19 changes: 4 additions & 15 deletions src/commands/3/eep.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import { ApplicationCommandType, CommandInteraction } from "discord.js";
import { ApplicationCommandType, ChatInputCommandInteraction, Client } from "discord.js";
import { Command } from "../../command";
import { isHelper } from "../../functions/Misc";
import { earlyeternityprogression } from "./earlyeternityprogression";

export const eep: Command = {
name: "eep",
description: "shorthand for /earlyeternityprogression",
type: ApplicationCommandType.ChatInput,
run: async(interaction: CommandInteraction) => {
if (!interaction) return;

// eslint-disable-next-line max-len
const content: string = `1. First eternity's EP on TD1
2. (Buying TS21 path + RESPEC) Eternity at e426IP for 3EP, spend all on TT
3. (Buy TS42) Eternity at e500IP for 4 EP
(Buy TS51) Eternity at e614IP for 8EP
4. Buy TS61, then get 100 eternities.
Afterwards, check out this flowchart (also pinned in eternity to ec1): https://i.imgur.com/pdmy3bN.png`;

await interaction.reply({ content, ephemeral: !isHelper(interaction) });
run: async(interaction: ChatInputCommandInteraction, client: Client) => {
await earlyeternityprogression.run(interaction, client);
}
};
1 change: 1 addition & 0 deletions src/commands/3/eternitygrinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const eternitygrinding: Command = {

const content = `Eternity buyer to 0, crunch (theoretically best to worst) 2e308, 1e154,1e103, 1e77 (all with "x times last" setting)
Test which works the best for you. You might have to adjust the value a little bit. Use ID+active path.
Experiment with DimBoost and Galaxy intervals a bit. I used 0.3 seconds on DimBoosts and 0.1 seconds on Galaxies, which got me the "Eternities are the new Infinity" achievement for 2x faster eternity grinding.
If you have TS181, do not use your crunch autobuyer (disable it). All other advice remains the same.
If you are back here for TS193 eternity grinding, use your normal production tree, just with ID instead of TD (or both, you lousy TS201 users)`;
Expand Down
14 changes: 7 additions & 7 deletions src/commands/3/infinitygrinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { isHelper } from "../../functions/Misc";

export const infinitygrinding: Command = {
name: "infinitygrinding",
description: "Sends how to grind infinities for requested time period. Early = EC4, late = banked",
description: "Sends how to grind infinities for requested time period. pre = pre r87, post = post r87",
type: ApplicationCommandType.ChatInput,
options: [
{
name: "when",
description: "at what point in the game you are. Early = EC4, late = banked",
description: "at what point in the game you are. pre = pre r87, post = post r87",
type: ApplicationCommandOptionType.String,
required: true,
choices: [
{ name: "2million", value: "2million" },
{ name: "normal", value: "normal" },
{ name: "pre", value: "pre" },
{ name: "post", value: "post" },
]
}
],
Expand All @@ -26,12 +26,12 @@ export const infinitygrinding: Command = {
let content: string;

switch (when) {
case "normal":
content = `Crunch autobuyer on 5.1 seconds (because of the reward from r87 (and for help with attaining this achievement, use \`/infinitygrinding 2million\`)), and make sure you have TS32 for the extra multiplier based on DimBoosts.
case "post":
content = `Crunch autobuyer on 5 seconds (because of the reward from r87 (and for help with attaining this achievement, use \`/infinitygrinding pre\`)), and make sure you have TS32 for the extra multiplier based on DimBoosts.
If grinding for EC4, make **sure** you are using Idle path before wasting time here!
If grinding for banked infinities, make sure to be using TS191!`;
break;
case "2million":
case "pre":
// eslint-disable-next-line max-len
content = `You can use the Time study 32 to gain more Infinities on Crunch based on Dimension Boosts. To take advantage of TS 32 you need to have as many Dimension Boosts when you Crunch as possible. However Antimatter Galaxies reset the amount of Dimboosts so you want to disable the Antimatter Galaxy autobuyer. After that set Dimboost autobuyer to buy max dimboosts every 0 seconds and set Crunch autobuyer to something like 0.1-1.0 seconds between Crunches depending on how long it takes to buy Dimboosts.`;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/3/study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const study: Command = {
// eslint-disable-next-line camelcase
min_value: 1,
// eslint-disable-next-line camelcase
max_value: 234,
max_value: 304,
}
],
run: (interaction: CommandInteraction) => {
Expand Down
37 changes: 5 additions & 32 deletions src/commands/3/studytree.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,13 @@
import { ApplicationCommandOptionType, ApplicationCommandType, CommandInteraction } from "discord.js";
import { ApplicationCommandType, ChatInputCommandInteraction, Client } from "discord.js";
import { Command } from "../../command";
import { Tree } from "../../classes/Tree";
import { isHelper } from "../../functions/Misc";
import { ts } from "./ts";

export const studytree: Command = {
name: "studytree",
description: "Generates a Time Study tree based on your total Time Theorems.",
type: ApplicationCommandType.ChatInput,
options: [
{
name: "theorems",
description: "The number of Time Theorems you have.",
type: ApplicationCommandOptionType.Integer,
required: true,
// eslint-disable-next-line camelcase
min_value: 0,
},
{
name: "path",
description: "The path you want to use; only has effect 54 < x < 123 where x is TT",
type: ApplicationCommandOptionType.String,
required: false,
choices: [
{ name: "Passive", value: "passive" },
{ name: "Active", value: "active" },
{ name: "Idle", value: "idle" },
]
}
],
run: async(interaction: CommandInteraction) => {
if (!interaction || !interaction.isChatInputCommand()) return;

const theorems: number = interaction.options.getInteger("theorems") as number;
const path: string = interaction.options.getString("path") as string;
const tree = new Tree(theorems, path).generateTree();

await interaction.reply({ content: tree, ephemeral: !isHelper(interaction) });
options: ts.options,
run: async(interaction: ChatInputCommandInteraction, client: Client) => {
await ts.run(interaction, client);
}
};
17 changes: 14 additions & 3 deletions src/commands/3/ts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ApplicationCommandOptionType, ApplicationCommandType, CommandInteraction } from "discord.js";
import { isHelper, makeEnumeration } from "../../functions/Misc";
import { Command } from "../../command";
import { Tree } from "../../classes/Tree";
import { isHelper } from "../../functions/Misc";
import { ecsAtTTAmount } from "../../functions/ecs";

export const ts: Command = {
name: "ts",
Expand All @@ -14,7 +15,7 @@ export const ts: Command = {
type: ApplicationCommandOptionType.Integer,
required: true,
// eslint-disable-next-line camelcase
min_value: 0,
min_value: 1,
},
{
name: "path",
Expand All @@ -26,15 +27,25 @@ export const ts: Command = {
{ name: "Active", value: "active" },
{ name: "Idle", value: "idle" },
]
},
{
name: "showecs",
description: "Will show current ECs for that TT amount; x >= 130 where 130 is TT",
type: ApplicationCommandOptionType.Boolean,
required: false
}
],
run: async(interaction: CommandInteraction) => {
if (!interaction || !interaction.isChatInputCommand()) return;

const theorems: number = interaction.options.getInteger("theorems") as number;
const path: string = interaction.options.getString("path") as string;
const showECs: boolean = interaction.options.getBoolean("showecs") as boolean;
const tree = new Tree(theorems, path).generateTree();
const ecs = ecsAtTTAmount(theorems);
const next = typeof ecs === "string" ? "" : `(Next: ${makeEnumeration<string>(ecs.nextECs, ", ", "", "and")} at ${ecs.nextEC.tt} TT)`;
const ecString: string = showECs && theorems >= 130 ? `EC completions for ${theorems} TT: ${typeof ecs === "string" ? ecs : ecs.completions} ${next}` : "";

await interaction.reply({ content: tree, ephemeral: !isHelper(interaction) });
await interaction.reply({ content: `${tree}\n${ecString}`, ephemeral: !isHelper(interaction) });
}
};
2 changes: 1 addition & 1 deletion src/commands/4/bankedinfinities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const bankedinfinities: Command = {

// eslint-disable-next-line max-len
const content: string = `Banked Infinities work like regular Infinities, except they stay on Eternity. To get Banked Infinities, have Time Study 191 or Achievement 131 "No Ethical Consumption" (these two effects stack, meaning if you have both you'll get 10% of your infinities converted), grind infinities (method in spoiler below), and then Eternity.
Method for obtaining: see \`/infinitygrinding normal\`!`;
Method for obtaining: see \`/infinitygrinding post\`!`;

await interaction.reply({ content, ephemeral: !isHelper(interaction) });
}
Expand Down
Loading

0 comments on commit 673f873

Please sign in to comment.