bonktools 3.2.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/old/examplebot.js DELETED
@@ -1,64 +0,0 @@
1
- const BonkBot = require("./bonkbot.js");
2
-
3
- let bot = BonkBot.createBot({
4
- account: {
5
- username: "me",
6
- password: "K3FmWyDhqCz4kycj",
7
- guest: false,
8
- },
9
- // skin: "{skin_object_here}"
10
- });
11
-
12
- bot.events.on("ready", async () => {
13
- console.log("Bot is ready");
14
- console.log(bot);
15
-
16
- // let fromurl = await bot.getAddressFromLink("https://bonk.io/710561")
17
- // let fromroomname = await bot.getAddressFromRoomName("test")
18
- let addr = await bot.createRoom(bot);
19
-
20
- bot.setAddress(addr);
21
- bot.connect();
22
- });
23
-
24
- bot.events.on("connect", () => {
25
- console.log("Bot connected to room!");
26
-
27
- bot.events.on("packet", async (packet) => {
28
- bot.autoHandlePacket(packet);
29
- // ignore spammy packets
30
- if (packet.type == "timesync") return;
31
- if (packet.type == "ping") return;
32
- console.log(packet);
33
- });
34
-
35
- bot.events.on("banned", async () => {
36
- console.log("Bot was banned from the room!");
37
- });
38
-
39
- bot.events.on("disconnected", async () => {
40
- console.log("Bot disconnected from the room!");
41
- });
42
-
43
- bot.events.on("chatmessage", async (playerchatevent) => {
44
- let pce = playerchatevent;
45
- console.log(`${pce.username}: ${pce.message}`);
46
-
47
- // commands!
48
- if (pce.message == "!ping") {
49
- bot.chat("Pong!");
50
- }
51
- });
52
-
53
- bot.events.on("join", async (playerjoinevent) => {
54
- let joiningPlayer = bot.getPlayerByID(playerjoinevent.id);
55
- console.log(`${joiningPlayer.username} joined the room!`);
56
- });
57
-
58
- bot.events.on("leave", async (playerleaveevent) => {
59
- let leavingPlayer = bot.getPlayerByID(playerleaveevent.id);
60
- console.log(`${leavingPlayer.username} left the room!`);
61
- });
62
- });
63
-
64
- bot.init();
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Extract certificate chain directly from bonk.io server
4
- * This avoids curl, HTTP downloads, proxies, and firewall blocks
5
- */
6
-
7
- const { execSync } = require('child_process');
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- const OUTPUT_FILE = path.join(__dirname, '..', 'bonk_fullchain.pem');
12
- const BONK_HOST = 'b2ny1.bonk.io';
13
- const BONK_PORT = 443;
14
-
15
- function main() {
16
- console.log('Extracting certificate chain directly from bonk.io server...');
17
-
18
- try {
19
- // Windows não suporta < /dev/null
20
- // Usamos echo. para encerrar a conexão corretamente
21
- const cmd = `echo.|openssl s_client -showcerts -connect ${BONK_HOST}:${BONK_PORT}`;
22
-
23
- const output = execSync(cmd, {
24
- encoding: 'utf8',
25
- maxBuffer: 20 * 1024 * 1024
26
- });
27
-
28
- const certs = output.match(/-----BEGIN CERTIFICATE-----[\s\S]+?-----END CERTIFICATE-----/g);
29
-
30
- if (!certs || certs.length === 0) {
31
- throw new Error('No certificates found in server response');
32
- }
33
-
34
- const uniqueCerts = [...new Set(certs)];
35
-
36
- fs.writeFileSync(OUTPUT_FILE, uniqueCerts.join('\n\n'), 'utf8');
37
-
38
- console.log(`✓ Extracted ${uniqueCerts.length} certificate(s)`);
39
- console.log(`✓ Full chain saved to: ${OUTPUT_FILE}`);
40
- console.log('✓ Chain captured directly from the server 🔥');
41
- } catch (err) {
42
- console.error('Failed to extract certificates:', err.message);
43
- process.exit(1);
44
- }
45
- }
46
-
47
-
48
- if (require.main === module) {
49
- main();
50
- }
51
-
52
- module.exports = { main };