Files
wsmud/world/cmd/dialog/tasks.js
2026-05-26 16:41:20 +08:00

26 lines
640 B
JavaScript

this.inherits(COMMAND);
this.command = "tasks";
this.allow_busy = true;
this.allow_state = true;
this.allow_die = true;
this.allow_faint = true;
this.enter = function (me, arg) {
var obj = {};
obj.type = "dialog";
obj.dialog = "tasks";
obj.items = [];
for (var i = 0; i < WORLD.TASKS.length; i++) {
var task = WORLD.TASKS[i];
var state=task.query_state(me);
if (!state) continue;
obj.items.push({
id:task.id,
title: task.query_title(me),
desc: task.query_desc(me),
state: state,
});
}
me.notify( JSON.stringify(obj));
}