feat(statemachine): 🚧 first draft of new xstate based statemachine implementation

Replaces the old statemachine.
Done so far:
- Basic command interface
- Machine saving and loading
- Sample dummy machine
This commit is contained in:
jay
2021-03-22 14:32:08 +05:00
parent 3f3ebbae10
commit 33c4233223
4 changed files with 488 additions and 116 deletions
+10
View File
@@ -404,6 +404,16 @@ function command(username, message) {
break
}
break;
case "sm":
case "step":
cfg.plugins.statemachine?.command?.(
message_parts[0] == "sm" ? message_parts.slice(1) : message_parts, player
)
// TODO refactor into plugin detection and command exec function
// safecommand(plugin_name, message_parts, player)
// message_parts includes command?
|| bot.chat("statemachine plugin not loaded")
break
case "location":
// TODO put in /lib/location
switch (message_parts[1]) {