I made a trigger as "(@myid)get some money!", and also set the trigger option of "Expand Variables" on. I also set a variable "myid" in mushclient as "jamie|edwin".But the trigger didn't work in mush when the output got the sentence,such as "jamie get some money".Would you please help me find some kind of solution? thanks.
trigger with variable
Posted by Lxhd on Sat 15 Jun 2013 06:30 AM — 7 posts, 33,140 views.
Show actual mud output, please. Copy/paste a page of what the server sends you that includes the line you want to capture.
Also show this trigger:
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
this is the trigger:
</trigger>
<trigger
custom_colour="7"
enabled="y"
expand_variables="y"
group="cap"
make_underline="y"
match="^( |>)*【jmlz】Hua yu\(Hua yu\):@playercn finished the jumi task and get \S+$"
name="jiumi"
regexp="y"
script="cap_log"
sequence="100"
>
this is the variable:
<variable name="playercn">(lxhd|jamie|james|edwin)</variable>
I just want to make a trigger with a variable to math the similar sentence occured with different id's name.But, unfortunately, the trigger didn't work. Thanks in advance.
</trigger>
<trigger
custom_colour="7"
enabled="y"
expand_variables="y"
group="cap"
make_underline="y"
match="^( |>)*【jmlz】Hua yu\(Hua yu\):@playercn finished the jumi task and get \S+$"
name="jiumi"
regexp="y"
script="cap_log"
sequence="100"
>
this is the variable:
<variable name="playercn">(lxhd|jamie|james|edwin)</variable>
I just want to make a trigger with a variable to math the similar sentence occured with different id's name.But, unfortunately, the trigger didn't work. Thanks in advance.
Show the actual mud output, please.
哈哈,楼主是大唐西游记的九迷机器吧?
你的问题
1.首先你确定变量是是lua的variable,还是mushclient的variable.
2.还有的就是你的id的格式是id1|id2|id3是不?也就是说你的变量出来是个正则表达式(id1|id2|id3).这样你想id1 id2 id3 都能用这个触发.
其实你可以这么做.
第一种:你可以用SetVariable("playcn",WorldName()),这种方法要求你world的name要保证使这个角色的name.
第二种我没试过:我觉得因该是
idlist = "id1|id2|id3"
SetVariable("playcn","("..idlist..")")
第三种最简单
Hua yu\(Hua yu\):(.+) finished the jumi task and get \S+$
function xxxx(name,line,wildcards)
local t = {"id1","id2","id3"}
if ismember(wildcards[1],t) then
Execute("what u want do")
end
end
function ismember(name, t) --it can put in global.lua
local ret = nil;
local t1;
if type(t) == "table" then
t1 = t;
else
t1 = utils.split(t,"|");
end
for i=1,#t1 do
if name == t1[i] then
ret = i;
return ret;
end
end
return ret;
end
你的问题
1.首先你确定变量是是lua的variable,还是mushclient的variable.
2.还有的就是你的id的格式是id1|id2|id3是不?也就是说你的变量出来是个正则表达式(id1|id2|id3).这样你想id1 id2 id3 都能用这个触发.
其实你可以这么做.
第一种:你可以用SetVariable("playcn",WorldName()),这种方法要求你world的name要保证使这个角色的name.
第二种我没试过:我觉得因该是
idlist = "id1|id2|id3"
SetVariable("playcn","("..idlist..")")
第三种最简单
Hua yu\(Hua yu\):(.+) finished the jumi task and get \S+$
function xxxx(name,line,wildcards)
local t = {"id1","id2","id3"}
if ismember(wildcards[1],t) then
Execute("what u want do")
end
end
function ismember(name, t) --it can put in global.lua
local ret = nil;
local t1;
if type(t) == "table" then
t1 = t;
else
t1 = utils.split(t,"|");
end
for i=1,#t1 do
if name == t1[i] then
ret = i;
return ret;
end
end
return ret;
end
Lxhd said:
this is the trigger:
</trigger>
<trigger
custom_colour="7"
enabled="y"
expand_variables="y"
group="cap"
make_underline="y"
match="^( |>)*【jmlz】Hua yu\(Hua yu\):@playercn finished the jumi task and get \S+$"
name="jiumi"
regexp="y"
script="cap_log"
sequence="100"
>
this is the variable:
<variable name="playercn">(lxhd|jamie|james|edwin)</variable>.
this is the trigger:
</trigger>
<trigger
custom_colour="7"
enabled="y"
expand_variables="y"
group="cap"
make_underline="y"
match="^( |>)*【jmlz】Hua yu\(Hua yu\):@playercn finished the jumi task and get \S+$"
name="jiumi"
regexp="y"
script="cap_log"
sequence="100"
>
this is the variable:
<variable name="playercn">(lxhd|jamie|james|edwin)</variable>.
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.