Hello!
I'm new to LUA and to Mudlet but I was able to get some first results. I'm trying to map the Wilderness of an Italian MUD, but I can't get the trigger right.
This mud changes the wilderness size, but it is ALWAYS a set of 7 lines of 13 characters each. When the visibility is blocked, empty spaces are displayed, but always of len 13.
I managed to find strings of exactly 13 characters like this: \W{13}\n|.{6}X.{6}\n
My question is: how should I set the multiline trigger so that it fires only when this is recognized in 7 consecutive lines?
I attach a couple of screenshots of the wilderness for more clarity...
Thanks!
Corben
Multiline script with the same pattern 7 times
Re: Multiline script with the same pattern 7 times
Is there anything it consistently sends before the name of the tile? If so, it may be that a trigger chain will be an easier fit. Otherwise, I'll have to think about how best to ensure the same line matches in 7 different lines without using the same pattern followed by a line spacer 1, repeated 7 times.
That would work, but I'd like to think there's a better way.
That would work, but I'd like to think there's a better way.
Re: Multiline script with the same pattern 7 times
Unfortunately no, usually it is the prompt, but there might be variations (mobs entering the room, etc.). I'm not familiar with trigger chain, but I'll dig into it... My best guess was to buffer the lines in a global variable/table and "consume" it once a length of 7 is reached, but I hoped there was a better way too...demonnic wrote: ↑Fri Sep 16, 2022 3:51 pmIs there anything it consistently sends before the name of the tile? If so, it may be that a trigger chain will be an easier fit. Otherwise, I'll have to think about how best to ensure the same line matches in 7 different lines without using the same pattern followed by a line spacer 1, repeated 7 times.
That would work, but I'd like to think there's a better way.
Thanks for your hits!
Re: Multiline script with the same pattern 7 times
So, what I would do is have a trigger that grabs every line, and pops it into an array, which stores the last 8 or so lines (however many you need so when the exits line shows up, you have the whole map). And then have a separate trigger that fires when the exits line shows up, you know you have your map, and you can use what is stored in your array.