[Achaea] % to Dragon

Share your scripts and packages with other Mudlet users.
User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

[Achaea] % to Dragon

Post by Vadi »

Direct port of someones zmuds % to dragon script.

Import, do qsc, and if you believe the black magic, be happy or sad :D
Attachments
% to dragon.xml
(3.88 KiB) Downloaded 815 times

Kazuya
Posts: 10
Joined: Sun Jul 11, 2010 10:29 pm
Location: United States

Re: [Achaea] % to Dragon

Post by Kazuya »

I downloaded and then imported the XML, although it doesn't seem to be noticing when I type QSC. Is there any customization needed, or anyway I can troubleshoot this?

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: [Achaea] % to Dragon

Post by Iocun »

Hmm, looking at the file, I see the pattern:
^You are level (\d+) \(.*\) and (\d+.\d+)\% of the way to the next level\.$

This will match only if your level is at least three digits long (in which case you obviously already are a dragon), or have the ability innersight in vision, so the level will be shown with a decimal point. Changing both + to * should make it work otherwise as well (\d*.\d*)\%
Alternatively, add a question mark after the dot: (\d+.?\d+)
In the second case it will still only match on levels that are at least two digits long, but I guess if you're below level 10 you shouldn't really worry too much yet about your percentage to dragon :P

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: [Achaea] % to Dragon

Post by tsuujin »

Iocun wrote:Hmm, looking at the file, I see the pattern:
^You are level (\d+) \(.*\) and (\d+.\d+)\% of the way to the next level\.$

This will match only if your level is at least three digits long (in which case you obviously already are a dragon), or have the ability innersight in vision, so the level will be shown with a decimal point. Changing both + to * should make it work otherwise as well (\d*.\d*)\%
Alternatively, add a question mark after the dot: (\d+.?\d+)
In the second case it will still only match on levels that are at least two digits long, but I guess if you're below level 10 you shouldn't really worry too much yet about your percentage to dragon :P
I'm not seeing what you're seeing here.

^You are level (\d+) should match one or any number of digits.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: [Achaea] % to Dragon

Post by tsuujin »

tsuujin wrote:
Iocun wrote:Hmm, looking at the file, I see the pattern:
^You are level (\d+) \(.*\) and (\d+.\d+)\% of the way to the next level\.$

This will match only if your level is at least three digits long (in which case you obviously already are a dragon), or have the ability innersight in vision, so the level will be shown with a decimal point. Changing both + to * should make it work otherwise as well (\d*.\d*)\%
Alternatively, add a question mark after the dot: (\d+.?\d+)
In the second case it will still only match on levels that are at least two digits long, but I guess if you're below level 10 you shouldn't really worry too much yet about your percentage to dragon :P
I'm not seeing what you're seeing here.

^You are level (\d+) should match one or any number of digits.
Oh, but I do see a problem with what comes next. the line is:
You are level 42 (Heroic) and 86% of the way to the next level.
so the regex should be
Code: [show] | [select all] lua
^You are level (\d+) \(\w+\) and (\d+)\% of the way to the next level\.$
I'm never seeing a decimal on the percentage.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: [Achaea] % to Dragon

Post by Iocun »

Er, silly me, I confused myself there. Obviously I meant not the level, but the percentage after it. (and (\d+.\d+)\% of the way)

Still, changing that part to (\d*.\d*) as I said should do the trick.

The decimal does appear if you have, as I mentioned, the ability Innersight, which I guess Vadi's script is based on.

Kazuya
Posts: 10
Joined: Sun Jul 11, 2010 10:29 pm
Location: United States

Re: [Achaea] % to Dragon

Post by Kazuya »

Thanks for the help thus far, but I'm still having problems. I'm new to Mudlet and to the Lua scripts and trying to pick up as much as I can from all of this.

Is there a different suggestion that I could try besides changing (\d+.\d+)\% to (\d*.\d*)\% as that did not work for me? I have tried reducing the two numerical wildcards to just one (it was entered in as just (\d+)\% to the next level), but that didn't work either.

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: [Achaea] % to Dragon

Post by Denarii »

(\d+(?:\.\d+)?)%

Kazuya
Posts: 10
Joined: Sun Jul 11, 2010 10:29 pm
Location: United States

Re: [Achaea] % to Dragon

Post by Kazuya »

Denarii wrote:(\d+(?:\.\d+)?)%
Unfortunately changing the trigger to ^You are level (\d+) \(.*\) and (\d+(?:\.\d+)?)% of the way to the next level\.$ didn't work either. Perhaps it would help to know what my QSC displays currently in this case? The second and third lines of my QSC are:
You are level 84 (2nd Circle of Celestial Power) and 22% of the way to the next
level.

Hopefully this will bring an "ah hah!" moment for someone.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: [Achaea] % to Dragon

Post by Iocun »

Well, one "ah hah!" may be that you might not have your screenwidth set to 0, so that wrapping into two lines is done by Achaea. In that case the trigger won't match.

Either make your Achaean screenwidth 0 and let Mudlet do your wrapping (I recommend this), or change the pattern to, for instance: ^You are level (\d+) \(.*\) and (\d+(?:\.\d+)?)% of the way


I.e. just leave out the last few words of the pattern.

Post Reply