tui.log_msg("HELP");
tui.log_msg("");
tui.log_msg("chat mode commands:");
- tui.log_msg("/login USER - register as USER");
- tui.log_msg("/msg USER TEXT - send TEXT to USER");
- tui.log_msg("/help - show this help");
- tui.log_msg("/play or /p - switch to play mode");
- tui.log_msg("/study or /s - switch to study mode");
+ tui.log_msg(":login USER - register as USER");
+ tui.log_msg(":msg USER TEXT - send TEXT to USER");
+ tui.log_msg(":help - show this help");
+ tui.log_msg(":play or :p - switch to play mode");
+ tui.log_msg(":study or :s - switch to study mode");
tui.log_msg("");
tui.log_msg("play mode commands:");
tui.log_msg("w, a, s, d - move avatar");
} else if (event.key == 'Enter') {
let [tokens, token_starts] = parser.tokenize(tui.input_line);
if (tokens.length > 0 && tokens[0].length > 0) {
- if (tokens[0][0] == '/') {
- if (tokens[0] == '/play' || tokens[0] == '/p') {
+ if (tokens[0][0] == ':') {
+ if (tokens[0] == ':play' || tokens[0] == ':p') {
tui.switch_mode('play');
- } else if (tokens[0] == '/study' || tokens[0] == '/s') {
+ } else if (tokens[0] == ':study' || tokens[0] == ':s') {
tui.switch_mode('study');
- } else if (tokens[0] == '/help') {
+ } else if (tokens[0] == ':help') {
tui.log_help();
tui.refresh();
- } else if (tokens[0] == '/login') {
+ } else if (tokens[0] == ':login') {
if (tokens.length > 1) {
websocket.send('LOGIN ' + quote(tokens[1]));
} else {
tui.log_msg('? need login name');
}
- } else if (tokens[0] == '/msg') {
+ } else if (tokens[0] == ':msg') {
if (tokens.length > 2) {
let msg = tui.input_line.slice(token_starts[2]);
websocket.send('QUERY ' + quote(tokens[1]) + ' ' + quote(msg));