[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  numerical wildcard capture

numerical wildcard capture

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Archibald   (12 posts)  [Biography] bio
Date Tue 25 Nov 2008 03:19 AM (UTC)
Message
Hi there. I searched the website and the help files in hopes of an answer to this question, but I have not had any luck so here I am posting.

This is what I want to do. I want to capture a specific set of numbers 0-25 in a wildcard trigger. This is the line:

Without further performance, the song will end in 130 seconds.
(^Without further performance, the song will end in (.*?) seconds.$)

I was thinking I could do something like (.*?<=25) but that didnt work. Someone told me try CInt, but I think thats VBscript, and it didnt work. If anyone knows how I can do that I really appreciate it you could help me.

Also, if someone could point me to where I can learn about basic lua logic arguements (like for vb its If/else/etc) that would also be great!
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #1 on Tue 25 Nov 2008 08:09 AM (UTC)
Message
For the trigger you can use ([0-9]|1[0-9]|2[0-5]), which is ugly but straightforward and works.

For Lua, you can check out the Programming in Lua book and the manual at http://lua.org/docs

Although there isn't much magic to if in Lua:

if something_is_true then
 -- do something
elseif something_else_is_true then
 -- do something else
else
 -- do something else entirely
end
[Go to top] top

Posted by Archibald   (12 posts)  [Biography] bio
Date Reply #2 on Tue 25 Nov 2008 10:14 PM (UTC)
Message
Cool, it works :D

Thanks!
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,598 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]