node-leek 1.0.0 → 1.0.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/package.json +13 -3
- package/dist/app.d.ts +0 -1
- package/dist/app.d.ts.map +0 -1
- package/dist/app.js +0 -1
- package/dist/autofighter.d.ts +0 -2
- package/dist/autofighter.d.ts.map +0 -1
- package/dist/autofighter.js +0 -27
- package/dist/boss_farming.d.ts +0 -2
- package/dist/boss_farming.d.ts.map +0 -1
- package/dist/boss_farming.js +0 -33
- package/dist/leeksync.d.ts +0 -2
- package/dist/leeksync.d.ts.map +0 -1
- package/dist/leeksync.js +0 -15
- package/dist/login.d.ts +0 -2
- package/dist/login.d.ts.map +0 -1
- package/dist/login.js +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-leek",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A library for interacting with LeekWars API.",
|
|
5
5
|
"main": "dist/node-leek-client/node-leek-client.js",
|
|
6
6
|
"types": "dist/node-leek-client/node-leek-client.d.ts",
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
"prepublish": "npm run build",
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
11
|
},
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"leekwars",
|
|
14
|
+
"api",
|
|
15
|
+
"client"
|
|
16
|
+
],
|
|
13
17
|
"author": "Portevent",
|
|
14
18
|
"license": "ISC",
|
|
15
19
|
"dependencies": {
|
|
@@ -17,9 +21,15 @@
|
|
|
17
21
|
"request": "^2.88.2",
|
|
18
22
|
"watcher": "^2.3.1"
|
|
19
23
|
},
|
|
20
|
-
"files": [
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
21
27
|
"repository": {
|
|
22
28
|
"type": "git",
|
|
23
29
|
"url": "https://github.com/Portevent/node-leek"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^25.0.8",
|
|
33
|
+
"@types/request": "^2.48.13"
|
|
24
34
|
}
|
|
25
35
|
}
|
package/dist/app.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=app.d.ts.map
|
package/dist/app.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":""}
|
package/dist/app.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/autofighter.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autofighter.d.ts","sourceRoot":"","sources":["../src/autofighter.ts"],"names":[],"mappings":""}
|
package/dist/autofighter.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const credentials_manager_js_1 = require("./credentials/credentials-manager.js");
|
|
4
|
-
const args = require('minimist')(process.argv.slice(2));
|
|
5
|
-
const readonly = (args['readonly'] ?? args['r']) != null;
|
|
6
|
-
async function autoFighter(client, index) {
|
|
7
|
-
await client.buy("50fights", 20);
|
|
8
|
-
var selectedLeek = client.leeks[0];
|
|
9
|
-
// Select lowest level leek to xp
|
|
10
|
-
client.leeks.forEach((leek) => {
|
|
11
|
-
if (leek.xpBlocked)
|
|
12
|
-
return;
|
|
13
|
-
if (leek.level <= selectedLeek.level) {
|
|
14
|
-
selectedLeek = leek;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
console.log("Doing " + client.farmer.fights + " fights with " + selectedLeek.name);
|
|
18
|
-
for (let i = 0; i < client.farmer.fights; i++) {
|
|
19
|
-
console.log("Starting fight " + i);
|
|
20
|
-
await client.sleep(1000);
|
|
21
|
-
await client.startRandomSoloFight(selectedLeek.id);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// LeekSync on each account
|
|
25
|
-
new credentials_manager_js_1.CredentialsManager(args['credentials'] ?? "credentials.json")
|
|
26
|
-
.forEachAccount(autoFighter, readonly)
|
|
27
|
-
.then(() => console.log("AutoFighter closed"));
|
package/dist/boss_farming.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boss_farming.d.ts","sourceRoot":"","sources":["../src/boss_farming.ts"],"names":[],"mappings":""}
|
package/dist/boss_farming.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const credentials_manager_js_1 = require("./credentials/credentials-manager.js");
|
|
4
|
-
const args = require('minimist')(process.argv.slice(2));
|
|
5
|
-
const readonly = (args['readonly'] ?? args['r']) != null;
|
|
6
|
-
async function start() {
|
|
7
|
-
const manager = new credentials_manager_js_1.CredentialsManager(args['credentials'] ?? "credentials.json");
|
|
8
|
-
//
|
|
9
|
-
// // Buy fight on each accounts
|
|
10
|
-
// await manager.forEachAccount(async (client: NodeLeekClient, index: number) =>
|
|
11
|
-
// await client.buy("50fights"));
|
|
12
|
-
for (var i = 0; i < 50; i++) {
|
|
13
|
-
console.log("Fighting Nasu : " + i);
|
|
14
|
-
// First account create room
|
|
15
|
-
await manager.forFirstAccount(async (client, index) => {
|
|
16
|
-
const roomId = await client.createRoom(1);
|
|
17
|
-
if (roomId == "") {
|
|
18
|
-
console.log("No more fights");
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
// Other account join room
|
|
22
|
-
await manager.forOtherAccount(async (client, index) => {
|
|
23
|
-
await client.joinRoom(roomId);
|
|
24
|
-
});
|
|
25
|
-
await client.startRoomFight();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
await manager.forFirstAccount(async (client, index) => {
|
|
29
|
-
await client.sleep(15000);
|
|
30
|
-
});
|
|
31
|
-
await manager.disconnectEachAccount();
|
|
32
|
-
}
|
|
33
|
-
start().then(r => console.log("Login closed"));
|
package/dist/leeksync.d.ts
DELETED
package/dist/leeksync.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leeksync.d.ts","sourceRoot":"","sources":["../src/leeksync.ts"],"names":[],"mappings":""}
|
package/dist/leeksync.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const credentials_manager_js_1 = require("./credentials/credentials-manager.js");
|
|
4
|
-
const args = require('minimist')(process.argv.slice(2));
|
|
5
|
-
const path = args['path'] ?? args['p'] ?? "./leekscripts";
|
|
6
|
-
const watch = (args['watch'] ?? args['w']) != null;
|
|
7
|
-
const choice = args['choice'] ?? args['c'];
|
|
8
|
-
const readonly = (args['readonly'] ?? args['r']) != null;
|
|
9
|
-
async function leekSync(client, index) {
|
|
10
|
-
await client.syncWith(path, watch, choice);
|
|
11
|
-
}
|
|
12
|
-
// LeekSync on each account
|
|
13
|
-
new credentials_manager_js_1.CredentialsManager(args['credentials'] ?? "credentials.json")
|
|
14
|
-
.forEachAccount(leekSync, readonly)
|
|
15
|
-
.then(() => console.log("LeekSync closed"));
|
package/dist/login.d.ts
DELETED
package/dist/login.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":""}
|
package/dist/login.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const credentials_manager_js_1 = require("./credentials/credentials-manager.js");
|
|
4
|
-
const args = require('minimist')(process.argv.slice(2));
|
|
5
|
-
const readonly = (args['readonly'] ?? args['r']) != null;
|
|
6
|
-
async function login(client, index) {
|
|
7
|
-
// await client.buy("50fights", 20);
|
|
8
|
-
}
|
|
9
|
-
// Login on each account
|
|
10
|
-
new credentials_manager_js_1.CredentialsManager(args['credentials'] ?? "credentials.json")
|
|
11
|
-
.forEachAccount(login, readonly)
|
|
12
|
-
.then(() => console.log("LeekSync closed"));
|