Hey I'm new to Mudlet and scripting/Regex for that matter. I play DSL (Dark and Shattered Lands) and I am having a really fun time learning it and I have gotten quite a few things down but I have been trying to get the Multiline match trigger thing to work and I seem to be doing it wrong. I am trying to make a trigger that fires when:
(A|An|The| |) (.*) walks (\w+). <Regex>
has fled! <substring>
appears and sends the following:
send ( "move " .. matches[4] )
send ( "murder " .. matches[3] )
its working for the most part as far as recognizing the variables but will fire every time its sees the first line. I also am not sure if just putting | | will allow the regex to recognize nothing in front. If you could help me out Id really appreciate it.
Need some Help
Re: Need some Help
You need to check the box 'multiline AND trigger', to match one the requirements of BOTH lines.
After that, your matches will be stored in the 'multimatches' table, not 'matches'
Use the function showMultimatches() to see the table of those matches in your trigger script.
After that, your matches will be stored in the 'multimatches' table, not 'matches'
Use the function showMultimatches() to see the table of those matches in your trigger script.
Re: Need some Help
Ah so thats why it wasnt working when I was clicking the multiline matches box it has to be .. multimatches not just .. matches. For the function showMultimatches () can i just use the one thats in the manual?
multimatches {
1 = {
matches[1] of regex 1
matches[2] of regex 1
matches[3] of regex 1
...
matches[n] of regex 1 },
2 = {
matches[1] of regex 2
matches[2] of regex 2
...
matches[n] of regex 2 },
... ...
n = {
matches[1] of regex n
matches[2] of regex n
...
matches[n] of regex n }
}
and final question, that was not very clear from the manual. [1] [2] [3] etc equal the variables [1] being the whole line etc. If i want to use something from the second or third condition does it increase numerically or do i do mutlimatchs[1][3] where [1]= first line [3]= third variable. Thanks so much for the help!
multimatches {
1 = {
matches[1] of regex 1
matches[2] of regex 1
matches[3] of regex 1
...
matches[n] of regex 1 },
2 = {
matches[1] of regex 2
matches[2] of regex 2
...
matches[n] of regex 2 },
... ...
n = {
matches[1] of regex n
matches[2] of regex n
...
matches[n] of regex n }
}
and final question, that was not very clear from the manual. [1] [2] [3] etc equal the variables [1] being the whole line etc. If i want to use something from the second or third condition does it increase numerically or do i do mutlimatchs[1][3] where [1]= first line [3]= third variable. Thanks so much for the help!
Re: Need some Help
First match is multimatches[1], all others increase by one. So second is multimatches[2], and so on and so forth.
Re: Need some Help
For future reference is I had Regex in other lines would i use multimatch[][]?
Re: Need some Help
I have another fairly general question, this one about tables. Do i need to go in an set up a table in the scripts option or will adding function showMultimatches() create one for me. If i do need to create one I tried making one early and modeled it after the one in the manual but it kept giving me the little bug error conceding the }. Thanks again for the help