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, 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.
 Entire forum ➜ MUSHclient ➜ General ➜ Matching mid line for trigger

Matching mid line for trigger

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


Pages: 1  2 

Posted by Xavious   (41 posts)  Bio
Date Reply #15 on Sat 28 Jun 2008 09:38 PM (UTC)
Message
I tried doing what you said Darwin and the trigger didn't fire at all. Poromenos your trigger fired perfectly except it didn't get the skill at the bottom.

---------------------------------Weapons-----------------------------------
   advanced blaster 100%   advanced bowcaster  90%   advanced forcepike  90%  
%1 = advanced blaster
%2 = 100
%3 = advanced bowcaster 
%4 = 90
%5 = advanced forcepike 
%6 = 90

advanced vibroblade 100%      blaster mastery 100%             blasters 100%  
%1 = advanced vibroblade
%2 = 100
%3 = blaster mastery
%4 = 100
%5 = blasters
%6 = 100

  bowcaster mastery  90%           bowcasters  90%           disruptors  90%  
%1 = bowcaster mastery 
%2 = 90
%3 = bowcasters 
%4 = 90
%5 = disruptors 
%6 = 90

        force pikes  90%    forcepike mastery  90%       unarmed combat  90%  
%1 = force pikes 
%2 = 90
%3 = forcepike mastery 
%4 = 90
%5 = unarmed combat 
%6 = 90

       vibro-blades 100%  
To see a shorter practice list, type PRACTICE <class name>.
Top

Posted by Nick Gammon   Australia  (23,062 posts)  Bio   Forum Administrator
Date Reply #16 on Sat 28 Jun 2008 10:02 PM (UTC)

Amended on Sat 28 Jun 2008 11:24 PM (UTC) by Nick Gammon

Message
Try just modifying what I had and adding the underscore, remember it is in 3 places:


match="(?x)^ \s* ( [-a-z _]+ ) \s+ ( \d+ ) % \s* (?: ( [-a-z _]+ ) \s+ ( \d+ ) % \s* )? (?: ( [-a-z _]+ ) \s+ ( \d+ ) % \s* )? $"



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Xavious   (41 posts)  Bio
Date Reply #17 on Sun 29 Jun 2008 12:23 AM (UTC)

Amended on Sun 29 Jun 2008 01:33 AM (UTC) by Nick Gammon

Message

That worked Nick aside from one line:

smalltalk  90%                snipe 100%       space combat 1  90%  



My guess is it has to do with the extra space in the third skill of that row. I appreciate everyones help by the way. Once I get better at expressions I will be able to accomplish almost any task!

I'm also using VBScript and am not sure how to weed out a wildcard if it was in a place where no skill appeared and is filled with white space. I need an if condition that prevents a blank wildcard from being added to the array.
ie. if %1 not null.. or whatever it should be in this situation.

Top

Posted by Nick Gammon   Australia  (23,062 posts)  Bio   Forum Administrator
Date Reply #18 on Sun 29 Jun 2008 01:46 AM (UTC)
Message
Let's see if you can work this one out yourself. :)

Currently you are matching on a character "class" which is:


[-a-z _]


That is:


  • a hyphen (has to come first, or it is considered a range)
  • The range of letters a-z
  • A space
  • An underscore


Do you see something other than those in "space combat 1"?

If you do, and a-z represents the letters a to z, what do you think you would need to add?

Quote:

and am not sure how to weed out a wildcard if it was in a place where no skill appeared and is filled with white space


Try comparing to "".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Xavious   (41 posts)  Bio
Date Reply #19 on Sun 29 Jun 2008 06:45 AM (UTC)
Message
Thanks Nick that helped. I used "" for the comparison and filtering of skills into the array. Futhermore, chaging "[-a-z _]" to "[-a -z _]" resolved the issue with that line that wasn't firing. Now all I have to do is get some more data from the mud and this plugin will be nearly complete. Thanks for all the help!
Top

Posted by Xavious   (41 posts)  Bio
Date Reply #20 on Sun 29 Jun 2008 07:00 AM (UTC)
Message
Actually I should have kept my for loop test it appears, what I did there messed things up. It seems I celebrated prematurely, however I resolved the issue by using [-a-z0-9 _] instead. It now functions like it is suppose to.
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.


58,661 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.