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 ➜ General ➜ trouble with a regexp trigger

trouble with a regexp trigger

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


Posted by Qbert911   (3 posts)  Bio
Date Sat 19 Dec 2009 12:50 AM (UTC)
Message
Hello all, and thanks to Nick for a great client.

I'm playing aardwolf and would like to see the stats of an item when it is first auctioned with a trigger.

So when text like:
Razorlight is auctioning >.: (Concealed) Portable Power Source :.< (Level 71, Num 144). Current bid is 100.

I would like the trigger to respond with bidding on the item number like:
bid 144

So far, I have got:
^(?:\w+ )?\w+ is auctioning .+ \(Level \d+, Num (\d+)\). Current bid is \d+.$

action:
bid %1


This doesn't work and I'm rubbish at regexp.

Thank You in Advance,
qbert911
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #1 on Sat 19 Dec 2009 12:56 AM (UTC)

Amended on Sat 19 Dec 2009 12:57 AM (UTC) by Twisol

Message
That looks correct, except you may want to escape the literal periods (from . to \.), see below. Are you sure the "Regular expression" checkbox on the trigger is checked?

^(?:\w+ )?\w+ is auctioning .+ \(Level \d+, Num (\d+)\)\. Current bid is \d+\.$

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Qbert911   (3 posts)  Bio
Date Reply #2 on Sat 19 Dec 2009 01:08 AM (UTC)
Message
Ok, tried that, no joy. The regexp button is indeed checked.

In an attempt to simplify things I also tried:
^.+ is auctioning .+ Num (\d+).+$

(which may be wildly wrong)

Using aardwolf-client package (mushclient 4.33).

Thanks,
qbert911
Top

Posted by Qbert911   (3 posts)  Bio
Date Reply #3 on Sat 19 Dec 2009 01:14 AM (UTC)
Message
Scratch that, this worked!

^.+ is auctioning .+ Num (\d+).+$

Cheers!
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #4 on Sat 19 Dec 2009 01:24 AM (UTC)

Amended on Sat 19 Dec 2009 01:25 AM (UTC) by Twisol

Message
If you're going to use .+ on both sides, why not just use this instead?

is auctioning .+? \(Level \d+, Num (\d+)\)


I just removed the anchors and the .+ at the ends, and put in the (Level, Num) part to make it less likely to accidentally match elsewhere. I'm not sure why the first trigger didn't work, to be honest, but I don't play Aardwolf.

'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.


15,507 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.