cleaned up message sent to AI on death

reduced message length by removing confusing and unnecessary info such as what it had in its inventory. Added more direct and less confusable instruction to use the !goToDeath action.
This commit is contained in:
Lawtro37 2024-10-29 22:41:43 +10:00 committed by GitHub
parent e83f5051ce
commit b8921c3520
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -266,15 +266,8 @@ export class Agent {
if (death_pos) { if (death_pos) {
death_pos_text = `x: ${death_pos.x.toFixed(2)}, y: ${death_pos.y.toFixed(2)}, z: ${death_pos.x.toFixed(2)}`; death_pos_text = `x: ${death_pos.x.toFixed(2)}, y: ${death_pos.y.toFixed(2)}, z: ${death_pos.x.toFixed(2)}`;
} }
let inventory = this.bot.inventory.slots; this.history.add('system', `You died at position ${death_pos_text || "unknown"} with the final message: '${message}'. Previous actions were stopped and you have since respawned.`);
let death_items = ""; this.handleMessage('system', `You died at position ${death_pos_text || "unknown"} with the final message: '${message}'. Previous actions were stopped and you have respawned. Notify the user and perform any necessary actions. use !goToDeath to return to death position. (this will automaticly take you to your death position and pick up your items)`);
for (let i=0; i<inventory.length; i++) {
if (inventory[i]) {
death_items += `${inventory[i].name} x${inventory[i].count}, `;
}
}
this.history.add('system', `You died at position ${death_pos_text || "unknown"} with the final message: '${message}'. Previous actions were stopped and you have respawned. Notify the user and perform any necessary actions.`);
this.handleMessage('system', `You died at position ${death_pos_text || "unknown"} and droped the items ${death_items} at your death position with the final message: '${message}'. Previous actions were stopped and you have respawned. Notify the user and perform any necessary actions. you can retrieve your items by doing the action !goToDeath.`);
} }
}); });
this.bot.on('idle', () => { this.bot.on('idle', () => {