|
Prompting my current EXP to the infobar
|
Reply to this subject
Start a new subject
 
Refresh page
Pages: 1
2
| Posted by |
Twisol
USA (2,229 posts) bio
|
| Date |
Reply #15 on Mon 16 May 2011 10:39 AM (UTC) [ quote
] Amended on Mon 16 May 2011 10:52 AM (UTC) by Twisol
|
| Message |
Kaimarae said:^You are level * and *% of the way to the next level.$
Any idea what I'm doing wrong? (Regular Expression is checked)
Yeah, it's the mixture of basic patterns and regular expressions again. * alone is a basic pattern symbol for a match. In a regular expression it means something totally different ("zero or more of the character before this one").
^You are level \d+ \([^)]+\) and \d+(?:\.\d+)?% of the way to the next level\.$
Internally the basic-pattern * is converted to (.*?), but that's not always (read: rarely) optimal, so I took the liberty of making it match more exactly. \d means "a digit", and the + after it means "one or more". The bit after that matches anything in parentheses that isn't an end parenthesis, and then I match the experience (making the fractional part optional). I also escaped the .'s because . means "any character" in regexp.
You might want to check out a tutorial on regular expressions. They're pretty easy to understand once you've learned a bit of the syntax.
http://www.regular-expressions.info/tutorial.html
[EDIT]: Also, congratulations on levelling up since you started the thread. ;) |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
| Posted by |
Kaimarae
(34 posts) bio
|
| Date |
Reply #16 on Mon 16 May 2011 10:49 AM (UTC) [ quote
] Amended on Mon 16 May 2011 10:51 AM (UTC) by Kaimarae
|
| Message |
Woowoo! Matches. Now, one last question... What %# do I use to capture the percentage? ^_^;
EDIT: Regarding the level, thanks! It was a by-product of bashing things trying to get the triggers to work ;) | top |
|
| Posted by |
Twisol
USA (2,229 posts) bio
|
| Date |
Reply #17 on Mon 16 May 2011 10:53 AM (UTC) [ quote
] |
| Message |
OOPS. I just edited my original post instead of quoting it! XD Luckily I could go back in my history and fish out the original... anyways, my response is below.
^You are level \d+ \([^)]+\) and (\d+(?:\.\d+)?)% of the way to the next level\.$
You can add parentheses around a piece of the expression to capture it. I bolded/underlined the changed part. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
| Posted by |
Kaimarae
(34 posts) bio
|
| Date |
Reply #18 on Mon 16 May 2011 01:50 PM (UTC) [ quote
] |
| Message |
| So do I then use %1, or just Send To Variable? (Sorry if I'm a bit dense at times :P) | top |
|
| Posted by |
Twisol
USA (2,229 posts) bio
|
| Date |
Reply #19 on Mon 16 May 2011 07:19 PM (UTC) [ quote
] |
| Message |
| "Send to" just tells MUSHclient what you want to do with the Send box. If it were set to "Variable", the contents of the Send box would be put in a variable. ;) You want Send to Script, using %1 in it for the capture. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
| Posted by |
Kaimarae
(34 posts) bio
|
| Date |
Reply #20 on Tue 17 May 2011 12:19 AM (UTC) [ quote
] |
| Message |
Yessss! Everything works beautifully. Thanks so much :D
/bow | top |
|
| Posted by |
Twisol
USA (2,229 posts) bio
|
| Date |
Reply #21 on Tue 17 May 2011 12:36 AM (UTC) [ quote
] |
| Message |
| Glad to help! |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | 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.
3,526 views.
This is page 2, subject is 2 pages long:
1
2
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )