[心得] MushClient - 練技能

看板mud_jy (金庸修真錄)作者 (lulu)時間11年前 (2014/01/14 08:04), 編輯推噓6(601)
留言7則, 5人參與, 最新討論串1/1
請複製兩段======中間的代碼 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="^[&gt; ]*\S+,無法簡單的通過練習進步。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*\S+只有日月神教的人\S+。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你.+領.+高深的.+。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你的.+火候不夠,難以繼續提升你.+的水平。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你的吸星大法還未大成,不能學習.+。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你的混天氣功\火候太淺。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你的圓月刀法大成之前必須有圓月彎刀配合么~能學習。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你的聖火神功\火候太淺。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你研究\S+段氏皇族的根本無法理解其中奧妙$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你紫徽心法修為不夠,這樣下去恐怕.+!$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你試著練習月踏蒼穹渡凌虛├神,但是並沒有任何進步。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*你覺得.+,依照自己武學修養難以理解。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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="^[&gt; ]*獨孤九劍只能通過「總訣式」來演練。$" regexp="y" send_to="12" sequence="100" > <send>practice_num = practice_num + 1 if tonumber(practice_num) &lt; 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
這篇和上一篇Zmud的 我都把它丟到京華區里囉,
01/14 10:24, 1F

01/14 10:25, , 2F
希望大家踴躍發文,充實這個版啊
01/14 10:25, 2F

01/14 12:37, , 3F
就是這種寫法讓我也不敢靠近 mushclient 啊 XDD 看了就眼花
01/14 12:37, 3F

01/14 12:49, , 4F
大大好強 Orz
01/14 12:49, 4F

01/15 08:24, , 5F
推~這也太難了!
01/15 08:24, 5F

04/26 18:16, , 6F
話說用了mushclient...字常都是亂碼@@
04/26 18:16, 6F

04/26 18:17, , 7F
請問這是正常的嗎?筆zmud還嚴重!但tri好像都沒問題...
04/26 18:17, 7F
文章代碼(AID): #1Ir7xq7E (mud_jy)
文章代碼(AID): #1Ir7xq7E (mud_jy)