-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
2,238 additions
and
2,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ npm i | |
|
||
- Run the bot! 🚀 | ||
```bash | ||
npm run start | ||
npm start | ||
``` | ||
|
||
### 🆕 Updating | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} |
Oops, something went wrong.