Re: [心得] MushClient 聖殿技能排還原度較好的寫法
看板mud_sanc (Sanctuary - 聖殿)作者hmml (hmml)時間12年前 (2013/06/08 23:54)推噓0(0推 0噓 5→)留言5則, 1人參與討論串2/4 (看更多)
同場加映:
1.組隊狀態:順便請教一下紅字部份直接寫在if判斷的方法。
桃色字自行依角色中文名的長度去調整。
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="(Lv.\d+|\[隊長\])(.*) HP:(\**※|\**○|\**☆|\**★)(\**) SP:(\**※|\**
○|\**☆|\**★)(\**) PP:(\**※|\**○|\**☆|\**★)(\**)"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>
for k,v in pairs(GetStyleInfo (GetLinesInBufferCount())) do
if string.find('%2',v.text) then
_,j= string.find('%2',v.text)
if string.len('%2')-j == 0 then
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
string.format("%%-"..30-(GetLineInfo
(GetLinesInBufferCount(),2)).."s",v.text))
else
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end --j
else
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end --find
end -- for
Note ("")</send>
</trigger>
</triggers>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
排版前:
*兩儀 式wWw拔刀隊*戰隊中共有 10 個成員。
[隊長]兩儀 式 HP:*********※* SP:*********☆* PP:**********※
Lv.120羽衣狐 HP:*********※* SP:**********※ PP:**********※
Lv.120齊格飛 HP:*********※* SP:**********※ PP:**********※
Lv.120庫夫林 HP:*********※* SP:**********※ PP:**********※
Lv.120卡蓮.奧爾黛西亞 HP:*********※* SP:*********※* PP:**********※
Lv.120乙橘槙繪 HP:*********※* SP:**********※ PP:**********※
Lv.120雷提雅.雅雷提雅 HP:*********※* SP:**********※ PP:**********※
Lv.120羿雲身上的愛睏無尾熊 HP:*********※* SP:**********※ PP:**********※
Lv.120紫苑‧亞特拉希亞 HP:*********※* SP:**********※ PP:**********※
Lv.120潔克蒂.安 HP:*********※* SP:**********※ PP:**********※
排版後:
*兩儀 式wWw拔刀隊*戰隊中共有 10 個成員。
[隊長]兩儀 式 HP:****※****** SP:**********☆ PP:*********※*
Lv.120羽衣狐 HP:**********※ SP:**********※ PP:**********※
Lv.120齊格飛 HP:**********※ SP:**********※ PP:**********※
Lv.120庫夫林 HP:********※** SP:**********※ PP:**********※
Lv.120卡蓮.奧爾黛西亞 HP:*********※* SP:********※** PP:**********※
Lv.120乙橘槙繪 HP:**********※ SP:**********※ PP:**********※
Lv.120雷提雅.雅雷提雅 HP:**********※ SP:**********※ PP:**********※
Lv.120羿雲身上的愛睏無尾熊 HP:**********※ SP:**********※ PP:**********※
Lv.120紫苑‧亞特拉希亞 HP:**********※ SP:**********※ PP:**********※
Lv.120潔克蒂.安 HP:**********※ SP:**********※ PP:**********※
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2.公會技能表,有三條:
a.下指令list時,會打開觸發b和c,至結尾會關閉b和c。
b.不能學或未學的技能顯示重排。
c.已經學會的技能顯示編排。
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<triggers>
<trigger
enabled="y"
group="TypeFix"
match="^(你是第.+你能學的技能如下(:)|你還有.+點的學習點數可供鍛練用(!))$"
name="GuildSkTypeControl"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%2" == ":" then
SetTriggerOption ("GuildSkList", "enabled", "y")
SetTriggerOption ("GuildSkList2", "enabled", "y")
elseif "%3" == "!" then
SetTriggerOption ("GuildSkList", "enabled", "n")
SetTriggerOption ("GuildSkList2", "enabled", "n")
end--if</send>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^(\S+\([a-z0-9 -_]+\)) (<要\d+級\S+能學唷!>|<主公會\S+能學喔>)$"
omit_from_output="y"
name="GuildSkList2"
regexp="y"
send_to="12"
sequence="100"
>
<send>for k,v in pairs(GetStyleInfo (GetLinesInBufferCount())) do
if string.find(v.text,'<') then
text2 = string.sub(v.text,string.find(v.text,'<'),-1)
text1 = string.gsub(v.text,text2,"")
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
string.format("%%-"..28-v.column.."s",text1)..text2)
else
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end --if
end -- for
Note ("")</send>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^.+\(.+\) 第.+\/.+級.*int.+\(.+\)$"
omit_from_output="y"
name="GuildSkList1"
regexp="y"
send_to="12"
sequence="100"
>
<send>for k,v in pairs(GetStyleInfo (GetLinesInBufferCount())) do
if string.find(v.text,'第') then
text2 = '第 '
text1 = string.sub(v.text,1,-3)
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
string.format("%%-"..28-v.column.."s",text1)..text2)
elseif string.find(v.text,'級') then
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
' 級'..string.format("%%12s",string.sub(v.text,3,-1)))
elseif string.find(v.text,'%d+') then
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
string.format("%%4s",v.text))
else
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end --if
end -- for
Note ("")</send>
</trigger>
</triggers>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
排版前:
你是第 16 級的劍士(slasher)你能學的技能如下:
------------------------------------------------------------
技能名稱 訓練費用 學習點數
------------------------------------------------------------
劍士之心(slasher heart) 第900/384級 350 int (2)
基本劍法(sword) 第9900/384級2000 int (182)
彩虹七色劍(rainbow slash) 第9900/240級5000 int (182)
身體平衡(body control) 第1000/240級 550 int (4)
劍訣(swordmaster) 第2000/50級2100 int (24)
四時劍法(4-season slash) 第2000/50級2100 int (24)
舞鳳訣(phoenix-recipe) <要21級劍士一-能學唷!>
潛能激發(talent-arouse) <要22級劍士一-能學唷!>
阿邦劍法(avan slash) <要23級劍士一-能學唷!>
獨孤九劍(nine-sword) <要24級劍士一-能學唷!>
靈力武器(spiriten) <要25級劍士一-能學唷!>
大!劍!技!(crack slash) <主公會劍士一-能學喔>
-----------------------------------------------------------
你還有 37589541 的存款跟 3001 點的學習點數可供鍛練用!
排版後:
你是第 16 級的劍士(slasher)你能學的技能如下:
------------------------------------------------------------
技能名稱 訓練費用 學習點數
------------------------------------------------------------
劍士之心(slasher heart) 第 900/ 384 級 350 int ( 2)
基本劍法(sword) 第 9900/ 384 級 2000 int ( 182)
彩虹七色劍(rainbow slash) 第 9900/ 240 級 5000 int ( 182)
身體平衡(body control) 第 1000/ 240 級 550 int ( 4)
劍訣(swordmaster) 第 2000/ 50 級 2100 int ( 24)
四時劍法(4-season slash) 第 2000/ 50 級 2100 int ( 24)
舞鳳訣(phoenix-recipe) <要21級劍士一-能學唷!>
潛能激發(talent-arouse) <要22級劍士一-能學唷!>
阿邦劍法(avan slash) <要23級劍士一-能學唷!>
獨孤九劍(nine-sword) <要24級劍士一-能學唷!>
靈力武器(spiriten) <要25級劍士一-能學唷!>
大!劍!技!(crack slash) <主公會劍士一-能學喔>
-----------------------------------------------------------
你還有 37589541 的存款跟 3001 點的學習點數可供鍛練用!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3.天空城家裡物品列表,有三條:
a.回家會打開b和c,回recall處則關閉b和c。
b.表頭欄位移動。其實只要一行ColourNote取代原行就可以了!(avert)
c.物品欄位調整,其實也就把數量欄位對齊,如果物品名稱很長,還是會偏移。
這條難度僅次於技能表而以。
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<triggers>
<trigger
enabled="y"
group="TypeFix"
match="^(你....了自己位於天空城的家(\.)|這裡是羅德斯鎮的巨型高塔(,)是人們與
神最為接近的地方,每天)$"
name="HomeItemTypeControl"
regexp="y"
send_to="12"
sequence="100"
>
<send>
if "%2" == "." then
SetTriggerOption ("HomeItemOne", "enabled", "y")
SetTriggerOption ("HomeItemList", "enabled", "y")
elseif "%3" == "," then
SetTriggerOption ("HomeItemOne", "enabled", "n")
SetTriggerOption ("HomeItemList", "enabled", "n")
end--if
</send>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^(序號 lv 物..名稱) (數量)$"
omit_from_output="y"
name="HomeItemOne"
regexp="y"
send_to="12"
sequence="100"
>
<send>for k,v in pairs(GetStyleInfo (GetLinesInBufferCount())) do
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
"%1"..string.format("%%"..70-string.len("%1").."s","%2"))
end --for
Note("")</send>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^( +\d+\. +\d+ )(.*) +(\(\d\))$"
omit_from_output="y"
name="HomeItemList"
regexp="y"
send_to="12"
sequence="100"
>
<send>for k,v in pairs(GetStyleInfo (GetLinesInBufferCount())) do
if string.find(v.text,"%(%d%)") and string.len(Trim(v.text)) == 3 then
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
string.format("%%"..70-GetLineInfo (GetLinesInBufferCount(),2).."s",v.text))
elseif string.find(v.text,"%(%d%)") and string.len(Trim(v.text)) > 3 then
text2 = Trim(string.sub(v.text,-3))
text1 = Trim(string.sub(v.text,1,-4))
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
text1..string.format("%%"..70-GetLineInfo
(GetLinesInBufferCount(),2)-string.len(text1).."s",text2))
else
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end --if
end -- for
Note ("")</send>
</trigger>
</triggers>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
排版前:
序號 lv 物品名稱 數量
1. 120 天譴(The Warth Of Heaven) (1)
2. 110 狐鳴岐(Foxy Fork) (1)
3. 120 誓約法願(Vow Wish) (1)
4. 125 石神之戒(Stone God Ring) (1)
5. 200 幻月劍(Moonsword) (1)
6. 120 【月神】月神微笑(Smile Of Artemis) (1)
7. 1 中秋月餅(Moon Cake) (6)
8. 125 魔法漩渦(Magic Swirl) (1)
9. 110 玉板指(Jade Finger) (1)
10. 120 翾風迴雪抄(Flutter Keith Gyrate Snowy) (1)
11. 120 歐西里斯の天空盔(Slifer the Sky Helmet) (1)
12. 110 巫婆帽(Wizer hat) (1)
13. 180 紫綬羽衣(Purple Feather) (2)
14. 130 星光腰帶(Star Belt) (1)
15. 150 榮光之鑽(Diamond of Glory) (1)
16. 130 雪夜星天鐲(Snow-Night Bracelet) (1)
17. 110 艾麗絲的圍裙(Alice's Apron) (1)
18. 115 銀河之左戒(Leftring Of Galaxy) (1)
19. 120 九陽濼(Fall Sun Bracelet) (1)
20. 1 許願卡(Votive Card) (1)
21. 130 痞子の記憶褲(Ruffian's Pants) (1)
排版後:
序號 lv 物品名稱 數量
1. 120 天譴(The Warth Of Heaven) (1)
2. 110 狐鳴岐(Foxy Fork) (1)
3. 120 誓約法願(Vow Wish) (1)
4. 125 石神之戒(Stone God Ring) (1)
5. 200 幻月劍(Moonsword) (1)
6. 120 【月神】月神微笑(Smile Of Artemis) (1)
7. 1 中秋月餅(Moon Cake) (6)
8. 125 魔法漩渦(Magic Swirl) (1)
9. 110 玉板指(Jade Finger) (1)
10. 120 翾風迴雪抄(Flutter Keith Gyrate Snowy) (1)
11. 120 歐西里斯の天空盔(Slifer the Sky Helmet) (1)
12. 110 巫婆帽(Wizer hat) (1)
13. 180 紫綬羽衣(Purple Feather) (2)
14. 130 星光腰帶(Star Belt) (1)
15. 150 榮光之鑽(Diamond of Glory) (1)
16. 130 雪夜星天鐲(Snow-Night Bracelet) (1)
17. 110 艾麗絲的圍裙(Alice's Apron) (1)
18. 115 銀河之左戒(Leftring Of Galaxy) (1)
19. 120 九陽濼(Fall Sun Bracelet) (1)
20. 1 許願卡(Votive Card) (1)
21. 130 痞子の記憶褲(Ruffian's Pants) (1)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
註:在if判斷式常會看到">"及"<",這是當從MushClient裡複製機碼或匯出
出Plugin的時候,將"<"及">"轉換出來的代碼,因為在xml裡,"<"與">"用來
做標籤宣告,所以位階非常高,如果直接用在機碼裡做比大小,會直接當做標
籤符號來用,然後就一直說有bug...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.196.45
→
06/10 07:47, , 1F
06/10 07:47, 1F
→
06/10 07:47, , 2F
06/10 07:47, 2F
→
06/10 07:48, , 3F
06/10 07:48, 3F
→
06/10 07:48, , 4F
06/10 07:48, 4F
→
06/10 07:48, , 5F
06/10 07:48, 5F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 2 之 4 篇):
mud_sanc 近期熱門文章
PTT遊戲區 即時熱門文章