-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#nop GMCP 北侠支持库; | ||
#nop vim: set filetype=tt:; | ||
|
||
/* | ||
本文件属于 PaoTin++ 的一部分。 | ||
PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <[email protected]>) 享有并保留一切法律权利 | ||
你可以在遵照 GPLv3 协议的基础之上使用、修改及重新分发本程序。 | ||
*/ | ||
|
||
load-lib telnet; | ||
load-lib option; | ||
load-lib event; | ||
load-lib gmcp; | ||
|
||
event.Define {GMCP.Move} {无参} {$MODULE} {接收到 GMCP 移动信息,已更新 gGMCP[Move]}; | ||
event.Define {GMCP.Status} {无参} {$MODULE} {接收到 GMCP 角色状态,已更新 gGMCP[Status]}; | ||
event.Define {GMCP.Combat} {无参} {$MODULE} {接收到 GMCP 战斗信息,已更新 gGMCP[Combat]}; | ||
event.Define {GMCP.Buff} {无参} {$MODULE} {接收到 GMCP BUFF状态,已更新 gGMCP[Buff]}; | ||
|
||
#alias {gmcp.pkuxkx.Enable} { | ||
#event {IAC SB GMCP GMCP.Status IAC SE} {gmcp.pkuxkx.OnStatus {%%1} {%%2}}; | ||
#event {IAC SB GMCP GMCP.Move IAC SE} {gmcp.pkuxkx.OnMove {%%1} {%%2}}; | ||
#event {IAC SB GMCP GMCP.Combat IAC SE} {gmcp.pkuxkx.OnCombat {%%1} {%%2}}; | ||
#event {IAC SB GMCP GMCP.Buff IAC SE} {gmcp.pkuxkx.OnBuff {%%1} {%%2}}; | ||
|
||
gmcp status on; | ||
gmcp move on; | ||
gmcp buff on; | ||
gmcp combat on; | ||
}; | ||
|
||
#alias {gmcp.pkuxkx.OnStatus} { | ||
mudLog GMCP.Status: {%2}; | ||
|
||
#line sub escapes #var gGMCP[Status] {%1}; | ||
|
||
#if { @option.IsEnable{GMCPDebug} } { | ||
#var gGMCP[Status]; | ||
}; | ||
|
||
event.Emit GMCP.Status {}; | ||
}; | ||
|
||
#alias {gmcp.pkuxkx.OnMove} { | ||
mudLog GMCP.Move: {%2}; | ||
|
||
#line sub escapes #var gGMCP[Move] {%1}; | ||
#var gGMCP[Move] {$gGMCP[Move][1]}; | ||
|
||
#if { @option.IsEnable{GMCPDebug} } { | ||
#var gGMCP[Move]; | ||
}; | ||
|
||
event.Emit GMCP.Move {}; | ||
}; | ||
|
||
#alias {gmcp.pkuxkx.OnCombat} { | ||
mudLog GMCP.Combat: {%2}; | ||
|
||
#line sub escapes #var gGMCP[Combat] {%1}; | ||
|
||
#if { @option.IsEnable{GMCPDebug} } { | ||
#var gGMCP[Combat]; | ||
}; | ||
|
||
event.Emit GMCP.Combat {}; | ||
}; | ||
|
||
#alias {gmcp.pkuxkx.OnBuff} { | ||
mudLog GMCP.Buff: {%2}; | ||
|
||
#line sub escapes #var gGMCP[Buff] {%1}; | ||
|
||
#if { @option.IsEnable{GMCPDebug} } { | ||
#var gGMCP[Buff]; | ||
}; | ||
|
||
event.Emit GMCP.Buff {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,8 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <[email protected]>) | |
*/ | ||
|
||
load-lib telnet; | ||
load-lib event; | ||
load-lib option; | ||
|
||
event.Define {GMCP.Move} {无参} {$MODULE} {接收到 GMCP 移动信息,已更新 gGMCP[Move]}; | ||
event.Define {GMCP.Status} {无参} {$MODULE} {接收到 GMCP 角色状态,已更新 gGMCP[Status]}; | ||
event.Define {GMCP.Combat} {无参} {$MODULE} {接收到 GMCP 战斗信息,已更新 gGMCP[Combat]}; | ||
event.Define {GMCP.Buff} {无参} {$MODULE} {接收到 GMCP BUFF状态,已更新 gGMCP[Buff]}; | ||
|
||
option.Define {GMCPDebug} {Bool} {是否显示 GMCP 原始数据} {false}; | ||
|
||
#alias {gmcp.Enable} { | ||
|
@@ -24,58 +18,6 @@ option.Define {GMCPDebug} {Bool} {是否显示 GMCP 原始数据} {false}; | |
}; | ||
}; | ||
|
||
#alias {gmcp.Handle} { | ||
#local key {%1}; | ||
#local handler {%2}; | ||
|
||
#line sub var #event {IAC SB GMCP $key IAC SE} {$handler}; | ||
}; | ||
|
||
#var gGMCP {}; | ||
|
||
#alias {gmcp.pkuxkx.Enable} { | ||
gmcp.Handle GMCP.Move { | ||
#line sub escape #var gGMCP[Move] {%%0}; | ||
#var gGMCP[Move] {$gGMCP[Move][1]}; | ||
event.Emit GMCP.Move {}; | ||
}; | ||
|
||
gmcp.Handle GMCP.Status { | ||
#line sub escape #var gGMCP[Status] {%%0}; | ||
event.Emit GMCP.Status {}; | ||
}; | ||
|
||
gmcp.Handle GMCP.Combat { | ||
#line sub escape #var gGMCP[Combat] {%%0}; | ||
event.Emit GMCP.Combat {}; | ||
}; | ||
|
||
gmcp.Handle GMCP.Buff { | ||
#line sub escape #var gGMCP[Buff] {%%0}; | ||
event.Emit GMCP.Buff {}; | ||
}; | ||
|
||
gmcp status on; | ||
gmcp move on; | ||
gmcp buff on; | ||
gmcp combat on; | ||
}; | ||
|
||
#alias {gmcp.ToggleDebug} { | ||
option.Toggle GMCPDebug; | ||
|
||
#if { "$gCurrentMUDLIB" == "pkuxkx" } { | ||
#if { @option.IsEnable{GMCPDebug} } { | ||
event.Handle GMCP.Status {gmcp.Debug} {gmcp} {#var gGMCP[Status]}; | ||
event.Handle GMCP.Move {gmcp.Debug} {gmcp} {#var gGMCP[Move]}; | ||
event.Handle GMCP.Buff {gmcp.Debug} {gmcp} {#var gGMCP[Buff]}; | ||
event.Handle GMCP.Combat {gmcp.Debug} {gmcp} {#var gGMCP[Combat]}; | ||
}; | ||
#else { | ||
event.UnHandle GMCP.Status {gmcp.Debug} {gmcp} {#var gGMCP[Status]}; | ||
event.UnHandle GMCP.Move {gmcp.Debug} {gmcp} {#var gGMCP[Move]}; | ||
event.UnHandle GMCP.Buff {gmcp.Debug} {gmcp} {#var gGMCP[Buff]}; | ||
event.UnHandle GMCP.Combat {gmcp.Debug} {gmcp} {#var gGMCP[Combat]}; | ||
}; | ||
}; | ||
}; | ||
#alias {gmcp.ToggleDebug} {option.Toggle GMCPDebug}; |