Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carince authored Nov 12, 2023
1 parent c79f8b4 commit 35acc2c
Show file tree
Hide file tree
Showing 45 changed files with 2,238 additions and 2,266 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"env": {
"es2022": true,
"node": true
"node": true,
"browser": true
},
"extends": [
"eslint:recommended",
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules
config.json5
error.png
logs
dist

*.json5
*.json
tsconfig.tsbuildinfo
.vscode
121 changes: 121 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import { copyFile, readdir, mkdir, unlink, lstat, rmdir } from "fs/promises";
import { existsSync as exists } from "fs";
import { execSync } from "child_process";

import { rollup } from "rollup";
import ts from "@rollup/plugin-typescript";
import swc from "@rollup/plugin-swc";
import esbuild from "rollup-plugin-esbuild";

const plugins = [
ts(),
swc(),
esbuild({
minify: false,
treeShaking: false,
format: "esm"
})
];

// Clear and make paths
async function delDirRecursively(path) {
if (!exists(path)) return;

for (const file of await readdir(path)) {
const filePath = `${path}/${file}`;
if ((await lstat(filePath)).isDirectory()) {
await delDirRecursively(filePath);
} else {
console.log(`Deleting file: ${filePath}`);
await unlink(filePath);
}
}

console.log(`Deleting folder: ${path}`);
await rmdir(path);
}
await delDirRecursively("./dist");

await mkdir("./dist");
await mkdir("./dist/pages");
await mkdir("./dist/pages/public");

// Copy static files for analytics page.
await copyFile("./src/analytics/index.html", "./dist/pages/index.html");
await copyFile("./node_modules/socket.io/client-dist/socket.io.js", "./dist/pages/public/socket.io.js");

if (exists("./src/analytics/public")) {
for (const file of await readdir("./src/analytics/public")) {
copyFile(`./src/analytics/public/${file}`, `./dist/pages/public/${file}`);
}
}

// Backend
console.log("Building Backend...");
try {
const backend = await rollup({
input: "./src/backend/index.ts",
onwarn: () => { return; },
plugins
});

await backend.write({
file: "./dist/index.js",
format: "esm",
compact: true
});
await backend.close();

console.log("Successfully built Backend!");
} catch (err) {
console.error(`Failed to build Backend:\n ${err}`);
process.exit(1);
}

// UserScript
console.log("Building UserScript...");
try {
const userScript = await rollup({
input: "./src/userscript/index.ts",
onwarn: () => { return; },
plugins
});

await userScript.write({
file: "./dist/userscript.js",
format: "cjs",
compact: true
});
await userScript.close();

console.log("Successfully built UserScript!");
} catch (err) {
console.error(`Failed to build UserScript:\n ${err}`);
}

// Analytics Page
console.log("Building Analytics...");
try {
const analytics = await rollup({
input: "./src/analytics/index.ts",
onwarn: () => { return; },
plugins
});

await analytics.write({
file: "./dist/pages/public/index.js",
format: "cjs",
compact: true
});
await analytics.close();

console.log("Successfully built Analytics!");
} catch (err) {
console.error(`Failed to build Analytics:\n ${err}`);
process.exit(1);
}

if (process.argv.includes("--run")) {
console.log("Running bloxflip-autocrash...");
execSync("node .", { stdio: "inherit" });
}
44 changes: 17 additions & 27 deletions config.example.json5
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
{
"auth": "",
"bet": {
"tries": 13,
"custom": 0,
"multiplier": 2
"tries": 12,
"startingBet": 0,
"autoCashout": 2
},
"webhook": {
"enabled": true,
"link": ""
},
"modules": {
"rain": {
"enabled": true,
"minimum": 0,
"notifications": {
"os_notifs": true,
"webhook": {
"enabled": true,
"ping_id": 0
}
}
},
"analytics": {
"enabled": false,
"notifications": {
"webhook": false
"rain": {
"enabled": true,
"minimum": 0,
"notifications": {
"os_notifs": false,
"webhook": {
"enabled": false,
"link": "",
"ping_id": 0
}
},
"updater": {
"enabled": true
}
},
"updater": {
"enabled": false,
"autoUpdate": false
},
// For debugging purposes only, dont touch if you dont know what you are doing
"debugging": {
"headless": true,
"verbose": false
"verbose": true
}
}
2 changes: 1 addition & 1 deletion docs/1_INSTALLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ npm i

- Run the bot! 🚀
```bash
npm run start
npm start
```

### 🆕 Updating
Expand Down
49 changes: 19 additions & 30 deletions docs/2_CONFIG.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,33 @@
# Config Documentation

auth: Your Bloxflip token

bet: {
tries: How many times your balance will be divided to 2
custom: Custom starting bet, tries will be ignored if this is set.
multiplier: At what multiplier you want to cashout
}

webhook: {
enabled: Toggle webhook
link: Your Discord webhook URL
startingBet: Custom starting bet tries will be ignored if this is set
autoCashout: At what multiplier you want to cashout
}

modules: {
rain: {
enabled: Toggle rain notifications
minimum: Minimum robux to notify
notifications: {
os_notifs: Toggle sending OS notifications
webhook {
enabled: Toggle rain notifications in webhook
ping_id: UserID to ping
}
}
}

analytics: {
enabled: Toggle analytics notifications
notifications: {
webhook: Toggle analytic notifications in webhook
rain: {
enabled: Toggle rain notifications
minimum: Minimum robux to notify
notifications: {
os_notifs: Toggle sending OS notifications
webhook: {
enabled: Toggle sending webhook embeds
link: Discord Webhook link
ping_id: User/Role ID to ping.
}
}
}

updater: {
enabled: Toggle checking for updates
}
updater: {
enabled: Toggle update notifier
autoUpdate: Toggle auto updating
}

// For debugging purposes only dont touch if you dont know what you are doing
debugging: {
headless: Toggle chrome headless mode
verbose: Show more verbose logs in console
headless: Toggle chrome headless mode.
verbose: Toggle info logs.
}
Loading

0 comments on commit 35acc2c

Please sign in to comment.