Noob Questions.

Post Reply
Posts: 2
Joined: Mon Jun 10, 2019 4:42 pm

Noob Questions.

Post by manwichman44 »

Can someone explain to me what the matches[#] is and how to use it properly? I'm trying to learn how to script and stuff but cant find clear answers

User avatar
Posts: 169
Joined: Wed May 09, 2012 8:07 am

Re: Noob Questions.

Post by Zaphob »

Hey manwichman44, welcome to Mudlet!

Did you find the manual in wiki already? There are lots of examples. E.g. here is the alias introduction, which uses a lot matches:

User avatar
Posts: 999
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Noob Questions.

Post by SlySven »

For the record the matches entity is a global Lua table - i.e. visible in all parts of the Lua sub-system for example: Triggers, Timers, KeyBindings, etc. - (and the profile's command line) which gets populated automagically by some of the C++ application code with data from the results of the use of the Perl Compatible Regular Expression (PCRE) library and some other bits of the application. This is so that users' scripts/packages can get the output and do things with or in response to that data. The contents of that table are somewhat dynamic and there are some places where it may not contain what you think it might because something else has already updated it.

{There is a related multimatches table that is used for, IIRC, multi-line triggers which is, I think effectively a table of matches tables, one for each line in the trigger...}

Post Reply