[心得] MushClient檢查Trigger資訊的Alias
嗯,越來越沒時間玩mud啦,來把用過的東西整理一下,分享出來。
如標題,因為之前習慣了TinTin++和zmud的介面,所以換到MushClient後超級不習慣的,
很多慣用的指令都沒得用,所以就乾脆土法煉鋼做出來自用囉,如果有bug請告訴我,我
會找時間修改。
用途:啟用或停用觸發,或是列出所有或是指定的觸發資訊(不包含觸發的Option資訊)。
語法範例:#tr+ TriggerName->啟用Label或Group中名稱為TriggerName的觸發。
#tr->列出所有的觸發資訊。
#tr TriggerName->列出Lable或Group中名稱為TriggerName的觸發資訊。
語法說明:
1.#tr為必要字串:可用#trigger、#tri兩種替代。
2.+/-為選用字串:+為啟用;-為停用;不存在則是列出Trigger資訊。
3.TriggerName為選用字串:可以是Label或是Group。若兩者同時存在以Label為
主;若不存在則+/-也不能存在,會列出所有的Trigger資訊。
===============================我是分隔線======================================
<alias
match="^\#tr(igger)?(i)?(\+|\-)?(\s)?(.*)$"
enabled="y"
echo_alias="y"
group="CheckTrigger"
regexp="y"
send_to="12"
sequence="100"
>
<send>
world = GetWorldById(GetWorldID())
varname = "%5"
varact = "%3"
if varname == "" and varact == "" then
for keys, values in pairs(world:GetTriggerList()) do
matchpatern = world:GetTriggerInfo(values, 1)
sendpatern = world:GetTriggerInfo(values, 2)
grouppatern = world:GetTriggerInfo(values, 26)
ColourNote("yellow", "blue", "TriggerName: " .. values .. ". Trigger Group: " .. grouppatern .. ".")
ColourNote("cyan", "black","Match: {" .. matchpatern .. "}")
ColourNote("yellow", "black","Send:")
ColourNote("yellow", "black","{")
ColourNote("yellow", "black","" .. sendpatern)
ColourNote("yellow", "black","}")
end
elseif varname == "" and varact ~= "" then
ColourNote("red", "black","Syntax error: Need trigger name or group!")
elseif varname ~= "" and varact == "" then
for keys, values in pairs(world:GetTriggerList()) do
matchpatern = world:GetTriggerInfo(values, 1)
sendpatern = world:GetTriggerInfo(values, 2)
grouppatern = world:GetTriggerInfo(values, 26)
if varname == grouppatern or varname == values then
if varname == grouppatern then
ColourNote("blue", "gray", "TriggerName: " .. values .. ". Trigger Group: " .. grouppatern .. ".")
elseif varname == values then
ColourNote("yellow", "blue", "TriggerName: " .. values .. ". Trigger Group: " .. grouppatern .. ".")
end
ColourNote("cyan", "black","Match: {" .. matchpatern .. "}")
ColourNote("yellow", "black","Send:")
ColourNote("yellow", "black","{")
ColourNote("yellow", "black","" .. sendpatern)
ColourNote("yellow", "black","}")
end
end
elseif varname ~= "" and varact ~= "" then
if varact == "+" then
triact = true
trinote = "enabled"
else
triact = false
trinote = "disabled"
end
if world.IsTrigger(varname) == 0 then
EnableTrigger(varname , triact)
ColourNote("cyan", "black","Trigger 「" .. varname .. "」 " .. trinote)
else
isgroup = 0
for keys, values in pairs(world:GetTriggerList()) do
grouppatern = world:GetTriggerInfo(values, 26)
if varname == grouppatern then
isgroup = 1
break
end
end
if not isgroup then
ColourNote("red", "gray","No such trigger name or group!")
else
EnableTriggerGroup(varname, triact)
ColourNote("yellow", "gray","Trigger group「" .. varname .. "」 " .. trinote)
end
isgroup = 0
end
end
</send>
</alias>
===============================================================================
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 112.105.167.2
※ 文章網址: https://www.ptt.cc/bbs/mud_jy/M.1440678300.A.C58.html
※ 編輯: rsliang (112.105.167.2), 08/27/2015 21:35:20
※ 編輯: rsliang (112.105.167.2), 08/27/2015 21:36:42
※ 編輯: rsliang (112.105.167.2), 08/27/2015 21:40:21
※ 編輯: rsliang (112.105.167.2), 08/27/2015 21:43:36
※ 編輯: rsliang (112.105.167.2), 08/27/2015 21:44:10
→
08/27 21:46, , 1F
08/27 21:46, 1F
mud_jy 近期熱門文章
PTT遊戲區 即時熱門文章
17
26