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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

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

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

numerical wildcard capture

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Archibald   (12 posts)  [Biography] bio
Date Tue 25 Nov 2008 03:19 AM (UTC)  quote  ]
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)  quote  ]
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)  quote  ]
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.


1,624 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]