[心得] MushClient - 練技能
請複製兩段======中間的代碼
Alias部份
==============================================================================
<aliases>
<alias
match="^pr1\s(\S+)$"
enabled="y"
expand_variables="y"
group="practice"
regexp="y"
send_to="12"
keep_evaluating="y"
sequence="100"
>
<send>practice_skill = "%1"
enable_skill = "%1"
require "wait"
wait.make(function()
Execute("tg+ practice;practice XXX 5000;skills ".."%1".."")
wait.time(1.5)
Execute("tig+ practice;t- skill_list")
end)</send>
</alias>
</aliases>
==============================================================================
Timers部分
==============================================================================
<timers>
<timer second="1.50" offset_second="0.00" send_to="12"
group="practice" >
<send>Execute("title 6;h2;practice "..enable_skill.." "..GetVariable
("times_practice").."")</send>
</timer>
</timers>
==============================================================================
Triggers部份
==============================================================================
<triggers>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="\s\((.+)\)\s+\-\s+(\d+)\/\s+(\w+)\%$"
name="skill_list"
regexp="y"
send_to="12"
sequence="10"
>
<send>table.insert(table_practice,"%1")</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*\S+,無法簡單的通過練習進步。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*\S+只有日月神教的人\S+。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你.+領.+高深的.+。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你的.+火候不夠,難以繼續提升你.+的水平。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你的吸星大法還未大成,不能學習.+。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你的混天氣功\火候太淺。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你的圓月刀法大成之前必須有圓月彎刀配合么~能學習。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你的聖火神功\火候太淺。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你研究\S+段氏皇族的根本無法理解其中奧妙$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你紫徽心法修為不夠,這樣下去恐怕.+!$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你試著練習月踏蒼穹渡凌虛├神,但是並沒有任何進步。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*你覺得.+,依照自己武學修養難以理解。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
<trigger
expand_variables="y"
group="practice"
keep_evaluating="y"
match="^[> ]*獨孤九劍只能通過「總訣式」來演練。$"
regexp="y"
send_to="12"
sequence="100"
>
<send>practice_num = practice_num + 1
if tonumber(practice_num) < tonumber(table.getn(table_practice)) then
Execute("enable "..enable_skill.." "..table_practice[practice_num].."")
else Execute("stop")
end --if
</send>
</trigger>
</triggers>
==============================================================================
要複製的部分,實在太多,做個簡單的網址給有需要的朋友
http://0rz.tw/RbCgd
h2是回精氣神
practice XXX 5000是用來顯示可以practice的最大次數
因為次數是顯示中文字,所以需要轉成數字,google找到XDDD
http://pkuxkx.net/forum/viewthread.php?tid=34840
http://pkuxkx.net/forum/viewthread.php?tid=24365
==============================================================================
function chs2num(s)----------------數字轉換
local cur = 0
local yi = 0
local sgl = 0
local len = string.len(s)
local tt = {}
tt["零"] = function() end
tt["一"] = function() sgl = 1 end
tt["二"] = function() sgl = 2 end
tt["三"] = function() sgl = 3 end
tt["四"] = function() sgl = 4 end
tt["五"] = function() sgl = 5 end
tt["六"] = function() sgl = 6 end
tt["七"] = function() sgl = 7 end
tt["八"] = function() sgl = 8 end
tt["九"] = function() sgl = 9 end
tt["十"] = function()
if sgl == 0 then sgl = 1 end
cur = cur + sgl * 10
sgl = 0
end
tt["百"] = function()
cur = cur + sgl * 100
sgl = 0
end
tt["千"] = function()
cur = cur + sgl * 1000
sgl = 0
end
tt["萬"] = function()
cur = (cur +sgl) * 10000
sgl = 0
end
tt["億"] = function()
yi = (cur + sgl) * 100000000
cur = 0
sgl = 0
end
for i = 1,len,2 do
k = string.sub(s,i,i+1)
tt[k]()
end
num = yi + cur +sgl
-- print(num)
return num
end
==============================================================================
看不懂的話,請問我
謝謝大家
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.223.99.155
※ 編輯: pssjim 來自: 61.223.99.155 (01/14 08:13)
推
01/14 10:24, , 1F
01/14 10:24, 1F
推
01/14 10:25, , 2F
01/14 10:25, 2F
推
01/14 12:37, , 3F
01/14 12:37, 3F
推
01/14 12:49, , 4F
01/14 12:49, 4F
推
01/15 08:24, , 5F
01/15 08:24, 5F
推
04/26 18:16, , 6F
04/26 18:16, 6F
→
04/26 18:17, , 7F
04/26 18:17, 7F
mud_jy 近期熱門文章
PTT遊戲區 即時熱門文章
16
32
10
14