kill-switch-mcp 1.1.4 → 1.1.6
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/dist/server.js +42 -4
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1299,6 +1299,15 @@ class BotActions {
|
|
|
1299
1299
|
const state = this.sdk.getState();
|
|
1300
1300
|
if (!state)
|
|
1301
1301
|
break;
|
|
1302
|
+
if (state.modalOpen) {
|
|
1303
|
+
if (state.modalInterface === 3559) {
|
|
1304
|
+
await this.sdk.sendAcceptCharacterDesign();
|
|
1305
|
+
} else {
|
|
1306
|
+
await this.sdk.sendCloseModal();
|
|
1307
|
+
}
|
|
1308
|
+
await this.sdk.waitForStateChange(2000).catch(() => {});
|
|
1309
|
+
continue;
|
|
1310
|
+
}
|
|
1302
1311
|
if (state.dialog.isOpen) {
|
|
1303
1312
|
await this.sdk.sendClickDialog(0);
|
|
1304
1313
|
await this.sdk.waitForStateChange(2000).catch(() => {});
|
|
@@ -4513,6 +4522,34 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
4513
4522
|
console.error(`[Kill Switch] Warning: initial state not received within 20s`);
|
|
4514
4523
|
}
|
|
4515
4524
|
activeBotName = botName;
|
|
4525
|
+
const initialState = connection.sdk.getState();
|
|
4526
|
+
if (initialState?.player) {
|
|
4527
|
+
const x = initialState.player.worldX;
|
|
4528
|
+
const z = initialState.player.worldZ;
|
|
4529
|
+
const isOnTutorialIsland = x >= 3050 && x <= 3160 && z >= 3050 && z <= 3140;
|
|
4530
|
+
if (isOnTutorialIsland) {
|
|
4531
|
+
console.error(`[Kill Switch] New player detected on Tutorial Island at (${x}, ${z}), auto-skipping...`);
|
|
4532
|
+
const tutorialStart = Date.now();
|
|
4533
|
+
const TUTORIAL_TIMEOUT = 30000;
|
|
4534
|
+
while (Date.now() - tutorialStart < TUTORIAL_TIMEOUT) {
|
|
4535
|
+
try {
|
|
4536
|
+
await connection.bot.skipTutorial({ randomizeAppearance: true });
|
|
4537
|
+
} catch (e) {
|
|
4538
|
+
console.error(`[Kill Switch] skipTutorial call: ${e.message}`);
|
|
4539
|
+
}
|
|
4540
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
4541
|
+
const currentState = connection.sdk.getState();
|
|
4542
|
+
if (currentState?.player) {
|
|
4543
|
+
const cx = currentState.player.worldX;
|
|
4544
|
+
const cz = currentState.player.worldZ;
|
|
4545
|
+
if (cx < 3050 || cx > 3160 || cz < 3050 || cz > 3140) {
|
|
4546
|
+
console.error(`[Kill Switch] Tutorial complete! Now at (${cx}, ${cz})`);
|
|
4547
|
+
break;
|
|
4548
|
+
}
|
|
4549
|
+
}
|
|
4550
|
+
}
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4516
4553
|
const { actions, descriptions } = await loadActions(botName, connection.bot, connection.sdk);
|
|
4517
4554
|
activeActions = actions;
|
|
4518
4555
|
activeActionDescriptions = descriptions;
|
|
@@ -4629,6 +4666,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
4629
4666
|
return value;
|
|
4630
4667
|
}
|
|
4631
4668
|
});
|
|
4669
|
+
await connection.bot.dismissBlockingUI();
|
|
4632
4670
|
let result;
|
|
4633
4671
|
try {
|
|
4634
4672
|
result = await Promise.race([fn(cancellable(connection.bot), cancellable(connection.sdk), activeActions), timeoutPromise, cancelPromise]);
|
|
@@ -4674,10 +4712,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
4674
4712
|
return errorResponse("Not connected. Call login first.");
|
|
4675
4713
|
}
|
|
4676
4714
|
const timeoutSecs = Math.min(Math.max(args?.timeout || 300, 10), 600);
|
|
4677
|
-
const ARENA_MIN_X =
|
|
4678
|
-
const ARENA_MAX_X =
|
|
4679
|
-
const ARENA_MIN_Z =
|
|
4680
|
-
const ARENA_MAX_Z =
|
|
4715
|
+
const ARENA_MIN_X = 3070;
|
|
4716
|
+
const ARENA_MAX_X = 3141;
|
|
4717
|
+
const ARENA_MIN_Z = 3317;
|
|
4718
|
+
const ARENA_MAX_Z = 3402;
|
|
4681
4719
|
console.error(`[Kill Switch] Waiting for tournament to start (timeout: ${timeoutSecs}s)...`);
|
|
4682
4720
|
const startTime = Date.now();
|
|
4683
4721
|
const deadline = startTime + timeoutSecs * 1000;
|