seliware-api-npm 1.0.0

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.
Binary file
Binary file
package/core/core.zip ADDED
Binary file
Binary file
Binary file
package/index.js ADDED
@@ -0,0 +1,100 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const AdmZip = require('adm-zip');
4
+ const { execFile } = require('child_process');
5
+ const WebSocket = require('ws');
6
+
7
+ const CORE_URL = 'https://github.com/dummdogggg/Better-seliwareAPI-core/releases/download/main/core.zip';
8
+ const CORE_DIR = path.join(__dirname, 'core');
9
+ const CORE_ZIP = path.join(CORE_DIR, 'core.zip');
10
+ const EXECUTABLE_PATH = path.join(CORE_DIR, 'seli-ws-inject.exe');
11
+
12
+ async function downloadCore() {
13
+ const fetch = (await import('node-fetch')).default;
14
+
15
+ if (fs.existsSync(EXECUTABLE_PATH)) {
16
+ console.log('Core already exists.');
17
+ return;
18
+ }
19
+
20
+ if (!fs.existsSync(CORE_DIR)) {
21
+ fs.mkdirSync(CORE_DIR, { recursive: true });
22
+ }
23
+
24
+ console.log('Downloading core...');
25
+ const response = await fetch(CORE_URL);
26
+ const buffer = await response.buffer();
27
+ fs.writeFileSync(CORE_ZIP, buffer);
28
+
29
+ console.log('Extracting core...');
30
+ const zip = new AdmZip(CORE_ZIP);
31
+ zip.extractAllTo(CORE_DIR, true);
32
+
33
+ console.log('Core downloaded and extracted.');
34
+ }
35
+
36
+ async function inject() {
37
+ await downloadCore();
38
+
39
+ return new Promise((resolve, reject) => {
40
+ if (!fs.existsSync(EXECUTABLE_PATH)) {
41
+ reject(`seli-ws-inject.exe not found at path: ${EXECUTABLE_PATH}`);
42
+ return;
43
+ }
44
+
45
+ console.log('Injecting into Roblox...');
46
+ console.log('Executable path:', EXECUTABLE_PATH);
47
+
48
+ const vbsScript = `
49
+ Set UAC = CreateObject("Shell.Application")
50
+ UAC.ShellExecute "${EXECUTABLE_PATH}", "", "", "runas", 1
51
+ `;
52
+ const vbsPath = path.join(CORE_DIR, 'elevate.vbs');
53
+ fs.writeFileSync(vbsPath, vbsScript);
54
+
55
+ execFile('cscript', ['/nologo', vbsPath], (error, stdout, stderr) => {
56
+ fs.unlinkSync(vbsPath);
57
+
58
+ if (error) {
59
+ console.error(`Execution error: ${error}`);
60
+ reject(`Injection failed: ${error.message}`);
61
+ return;
62
+ }
63
+ if (stderr) {
64
+ console.error(`Stderr: ${stderr}`);
65
+ reject(`Injection encountered an error: ${stderr}`);
66
+ return;
67
+ }
68
+ console.log(`Stdout: ${stdout}`);
69
+ resolve('Injection process started. Check Roblox for confirmation.');
70
+ });
71
+ });
72
+ }
73
+
74
+ function execute(script) {
75
+ return new Promise((resolve, reject) => {
76
+ const ws = new WebSocket('ws://localhost:5588');
77
+
78
+ ws.on('open', function open() {
79
+ ws.send(script);
80
+ });
81
+
82
+ ws.on('message', function incoming(data) {
83
+ resolve(data.toString());
84
+ });
85
+
86
+ ws.on('error', function error(err) {
87
+ reject(`WebSocket error: ${err.message}`);
88
+ });
89
+
90
+ setTimeout(() => {
91
+ ws.close();
92
+ reject('WebSocket connection timed out');
93
+ }, 10000);
94
+ });
95
+ }
96
+
97
+ module.exports = {
98
+ inject,
99
+ execute
100
+ };
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "seliware-api-npm",
3
+ "version": "1.0.0",
4
+ "description": "A library to inject into Roblox and execute scripts via WebSocket.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": ["roblox", "inject", "websocket"],
10
+ "author": "dumm_dogg",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "adm-zip": "^0.5.16",
14
+ "node-fetch": "^3.3.2",
15
+ "ws": "^8.18.0"
16
+ }
17
+ }