Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ numerical wildcard capture

numerical wildcard capture

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


Posted by Archibald   (12 posts)  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!
Top

Posted by Ked   Russia  (524 posts)  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
Top

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

Thanks!
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.


12,973 views.

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

Go to topic:           Search the forum


[Go to top] top

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