| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- #var login[session] {};
- #var login[user] {};
- #var login[autoexec] {};
- #alias {login} {
- #var login[session] {%1};
- #var login[user] {%2};
- #var login[autoexec] {%3};
- #session {$session[name]} {$session[host]} {$session[port]};
- };
- #event {SESSION CONNECTED} {
- #if { "%0" !== "$login[session][name]" } {
- #return;
- };
- login.auto-login;
- };
- #alias {login.auto-login} {
- #class login.auto-login open;
- #config {IAC GA} {OFF};
- #nop 如果角色设置了 GMCP 支持,则积极回应服务器的 GMCP 协商请求。;
- #if { "$user[GMCP]" == "true" } {
- load-lib gmcp;
- gmcp.Enable;
- };
- #if { "$session[UTF8]" == "true" } {
- #config {charset} {UTF-8};
- };
- #else {
- #config {charset} {GBK1TOUTF8};
- };
- #line oneshot #action {^北大侠客行已经执行了%*。$} {
- #local uptime {@time.ParseDoC{%%1}};
- };
- #line oneshot #action {^Input 1 for GBK, 2 for UTF8, 3 for BIG5$} {
- #nop;
- };
- #line oneshot #action {^您的英文名字(要注册新人物请输入new。):$} {
- #if { "$session[UTF8]" == "false" } {
- #delay 0 #send {2};
- };
- #config {charset} {UTF-8};
- #if { "$login[user][id]" != "" } {
- xtt.Answer {$login[user][id]};
- };
- #else {
- #line oneshot #macro {\n} {
- #cursor get {login[user][id]};
- #cursor clear;
- #if { "$login[user][id]" == "#%*" } {
- #var login[user][id] {};
- };
- #if { "$login[user][id]" != "" } {
- xtt.Answer {$login[user][id]};
- };
- };
- };
- };
- #line oneshot #action {^此ID档案已存在,请输入密码:$} {
- #if { "$login[user][passwd]" != "" } {
- xtt.Answer {$login[user][passwd]};
- #delay {login.check} {look} 1;
- };
- #else {
- #cursor flag echo on;
- #line oneshot #macro {\n} {
- #cursor get {login[user][passwd]};
- #cursor clear;
- #if { "$login[user][passwd]" != "" } {
- xtt.Answer {$login[user][passwd]};
- };
- };
- };
- };
- #line oneshot #action {^您要将另一个连线中的相同人物赶出去,取而代之吗?(y/n)$} {
- xtt.Answer y;
- };
- #line oneshot #action {^%s欢迎来到北大侠客行!%s$} {
- #delay {login.auto-login.success} {login.auto-login.success 重新登录} 0;
- };
- #line oneshot #action {^%s目前权限:(player)%s$} {
- #delay {login.auto-login.success} {login.auto-login.success} 1;
- };
- #line oneshot #action {^如果同意请用agree %w命令签署确认这些条款。$} {
- #if { @isTrue{$user[AGREE]} } {
- #send {agree %%1};
- };
- #else {
- #undelay {login.auto-login.success};
- #undelay {login.check};
- warnLog 请在十秒内输入 agree %%1 命令以继续游戏。;
- #delay {login.agree.fail} {#zap} 10;
- };
- };
- #line oneshot #action {^感谢您同意北侠玩家要约,现在可以正常进入游戏。$} {
- #undelay {login.agree.fail};
- };
- #line oneshot #action {^重新连线完毕。$} {
- #delay {login.auto-login.success} {login.auto-login.success 断线重连} 0;
- };
- #alias {login.auto-login.success} {
- #local type {%%1};
- #showme 登录成功。;
- #if { @isTrue{$login[user][manual]} } {
- login.write-id-file;
- login.init-game;
- };
- #local handler $login[autoexec];
- #class login.auto-login kill;
- #undelay login.auto-login.success;
- kill-module login;
- $handler;
- #if { "$user[GMCP]" == "true" } {
- #delay 1 {
- load-module gmcp;
- gmcp.pkuxkx.Enable;
- };
- };
- };
- #class login.auto-login close;
- };
- #alias {login.init-game} {
- #if { "$login[user][id]" == "" || "$user[id]" != "" } {
- #return;
- };
- #var user[id] {$login[user][id]};
- #var user[passwd] {$login[user][passwd]};
- #gts #var user[id] {$login[user][id]};
- #gts #var user[passwd] {$login[user][passwd]};
- #local path {$user[id]};
- #if { "$session[log_path]" != "" } {
- #local path {$session[log_path]};
- };
- #if { !@InitLog{$path} } {
- #echo {<119>创建日志目录 $gLog[PATH]/$path 时遇到错误。<299>};
- #echo {<139>请检查你的安装环境,或者参考使用手册重新安装本软件。<299>};
- #return;
- };
- log.Open;
- #screen set title GAME-$user[id];
- NOTE 启动配置文件已生成,下次你可以直接 start $login[user][id] 进入游戏。;
- };
- #alias {login.write-id-file} {
- #if { "$login[user][id]" == "" || "$user[id]" != "" } {
- #return;
- };
- #local id-file {ids/$login[user][id]};
- #local output {};
- #script output {test -d var/ids && echo true || echo false};
- #if { "$output[1]" == "true" } {
- #local id-file {var/$id-file};
- };
- #if { @existsFile{$id-file} } {
- #return;
- };
- #script output {cp ids/pkuxkx $id-file};
- #script output {sed -i.bak 's/^#var user\[id\] {.*};$/#var user[id] {$login[user][id]};/' $id-file};
- #script output {sed -i.bak 's/^#var user\[name\] {.*};$/#var user[name] {};/' $id-file};
- #script output {sed -i.bak 's/^#var user\[passwd\] {.*};$/#var user[passwd] {$login[user][passwd]};/' $id-file};
- #script output {sed -i.bak '/^#nop 上面三处修改完毕之后,请删除下面这行文字:;$/d' $id-file};
- #script output {sed -i.bak '/^#var user\[manual\] {true};$/d' $id-file};
- #script output {rm ${id-file}.bak};
- };
|