📄 mush.vtc
字号:
if (!depend_loaded) Load("depend");register_file("mush");MUSH ?:= alloc(5, Twtype);MUSH->name = "Mush";MUSH->init = .mud_init;nospoof_reg = regcomp("^\[([^](]*)\([^])]*\)({([^}]*)})?[^]]*\] (From afar, |You sense )?(.*)$");func mush_netread(line) [a, name, owner, match, rest] { if (regexec(nospoof_reg, line)) { name = regmatch(nospoof_reg, 1); owner = regmatch(nospoof_reg, 3); match = regmatch(nospoof_reg, 5); rest = (regmatch(nospoof_reg, 4) ? : "") + match; if (strcmp(name, match, strlen(name)) && (!owner || strcmp(owner, match, strlen(owner)))) line_netread(line); else line_netread(rest); } else line_netread(line);}MUSH->netread = .mush_netread;MUSH->save = .std_mud_save;MUSH->list = .std_mud_list;MUSH->print = .std_mud_print;wh_reg = regcomp("^wh? (.*) *= *([^:].*|)$");wh_fmt = "@switch [locate(me,%s,*)]=#-1,{@pemit me=Whisper to whom?},{@pemit"\+ " %s=[name(me)] whispers, \"%s\";@pemit me=You whisper, \"%s\" "\+ "to [name(%s)].}";func mush_outbound(r, line) [rec] { if (regexec(wh_reg, line) && mush_redo_wh) { rec = regmatch(wh_reg, 1); line = mush_quote(regmatch(wh_reg, 2)); normal_outbound(r, bprintf(wh_fmt, rec, rec, line, line, rec)); return; } if (*line == '"' && mush_redo_say) line = ":says, \"" + (line + 1) + "\""; if (strchr("\":", *line) && !mush_meddle || mush_nomeddle) normal_outbound(r, mush_quote(line)); else normal_outbound(r, line);}MUSH->outbound = .mush_outbound;func mush_quote(s) [r, n] { r = ""; while (*s) { n = strcspn(s, "\\[]%{}();"); strcat(r, s, n); s += n; if (*s) { strcat(r, "\\"); r[strlen(r)] = *s++; } }; return r;}func add_mush(name, addr, port, char, pwd) { add_world(new_mud(MUSH, name, addr, port, char, pwd));}MUSH->add = .add_mush;func Add_mush(name, addr, port, char, pwd) { add_mush(name, addr, atoi(port), char, pwd);}add_cmd("add_mush", 5, .Add_mush, \ "/add_mush <name> <addr> <port> <char> <pwd>");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -