Noob Questions.

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

Noob Questions.

Post by manwichman44 » Wed Jun 12, 2019 8:32 pm

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
Zaphob
Posts: 106
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Noob Questions.

Post by Zaphob » Wed Jun 12, 2019 9:37 pm

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:

https://wiki.mudlet.org/w/Manual:Introduction#Aliases

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

Re: Noob Questions.

Post by SlySven » Fri Jun 14, 2019 1:37 pm

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

Who is online

Users browsing this forum: No registered users and 5 guests