Need trigger help

Posted by Kaeltsw on Sat 03 Sep 2011 08:19 PM — 9 posts, 37,342 views.

#0
I have a capture trigger that captures the chat done in groups. the trigger line is "* tells the group '*'."
then it is %0 and send to notepad append. This works great, though I also am trying to make a trigger where "(Anyone) tells the group 'enter'." then it is ent sent to world.(Anyone) would be the name of person in group, though when I try to do this it will not work. I am wanting to basically run two triggers, one that is already working, the trigger to capture chat which appends to a notepad, am happy with that, but I also want one that will respond to tells the group 'enter'. want it to ent and I am not sure if I am explaining this properly or not, please help.
#1
If I understand the problem right, checking Keep Evaluating in either both or the first(working) trigger should fix this. This option allows other triggers to parse the same line of text after it's been matched once already.
#2
Yup,that did it, thanks.
Australia Forum Administrator #3
Quite right.

I should point out that for two triggers with the same trigger sequence number the evaluation order is not defined.

Thus you should set them both to "keep evaluating" or, one day, adding a totally different trigger might change the evaluation order.

Or, give one a lower sequence number (eg. the logging one) and only mark that as "keep evaluating" so this problem doesn't bite you again in the future.
#4
Hmm ok, sounds good. I have another question I am wanting to make an alias/trigger thing so that if I type retie in my command line it would retie any spells on everyone in my group normally i have ta type retie *person* and do that per person but I was hoping you know a way to alias or trigger it? the group displays as the following:



>Enguerrand's group:
Edmon hp:100% endur: 99% xp to level: 1040
Raal hp:100% endur: 99% xp to level: 1957
Pauly hp: 96% endur: 99% xp to level: 180
Arcanum hp:100% endur: 99% xp to level: 809
Enguerrand hp:100% endur: 99% xp to level: 1564



thast what I get every time I type group, and I am wanting it so that an alias will make a trigger do the retie work for the whole group, so it might have ta type group, then copy each name and then put it into the retie command but i just cammot make it work. Please help.
Australia Forum Administrator #5
First read up on capturing multiple lines:

Template:faq=37
Please read the MUSHclient FAQ - point 37.


You would need something like that to capture each group member. You could make a table before starting, eg.


group = {}


Then for each trigger add that person's name to the table, eg.


table.insert (group, "%1")  -- where %1 is the name


Now when you get to the end of the group list (whatever you see at that point) you work through the table getting each name out, eg.


for k, v in pairs (group) do
  Send ("retie " .. v)
end -- for


There would be other ways, but this should get you started.
#6
Well, I tried to do it but, for some reason i basically some how managed to make it so my trigger breaks the prog, not litterally but it is an infinite loop of runtime errors. So, um, sadly I will need to look to the brains and ask if you would be willing to write the script for me. I have zero scripting and or programing skills lolz.
#7
I am sorry man, I have kept at it but I just am struggling with the whole lua scripting and such I really could use the help and am struggling to understand the other files and everything i have even gone to the net to learn more of how ta work with lua and well, its not helping. I really can use your help. can you please show me how the coding would look?
Australia Forum Administrator #8
Have you looked at this video about making an inventory alias?

http://www.gammon.com.au/forum/?id=9965

That shows the idea of capturing multiple lines.

If that doesn't help, please post what you have done already.

Forum users don't mind helping people get their scripts to work, but generally don't want to just write them "from scratch".