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 ➜ Tips and tricks ➜ More questions about the infobar and other things

More questions about the infobar and other things

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


Posted by Plazgoth   USA  (10 posts)  Bio
Date Thu 03 Apr 2003 10:43 PM (UTC)
Message
1. I was wondering if it is somehow possible to have the infobar contain more then a single line.

2. The limit of how many things a trigger can store is currently 9. Is there some way to expand that? Perhaps break down the triger into two separate ones or some such. I am trying to capture the prompt output from my mud and there are options to see more then 9 things about your character and I would like to be able to see more then 9 in the infobar.

Thanks
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 03 Apr 2003 11:21 PM (UTC)
Message
The info bar is currently constrained to one line.

To handle more than 9 wildcards you can re-parse the line using re_exec (from memory). Search the forum, there are examples doing exactly that. Your trigger does a rough match, enough to justify calling the script, then the script uses the VB re_exec parser to re-parse the line, pulling out as many wildcards as you want.

- Nick Gammon

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

Posted by Plazgoth   USA  (10 posts)  Bio
Date Reply #2 on Thu 03 Apr 2003 11:51 PM (UTC)
Message
I did a search on 're_exec' and this was the only post it returned. What keyword should I use to see examples of this.

Thanks
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #3 on Fri 04 Apr 2003 04:29 AM (UTC)

Amended on Fri 04 Apr 2003 04:31 AM (UTC) by Shadowfyr

Message
NOTE: Assuming you are processing the information in a script, you can set more than one trigger for the line and have each one return only parts of the line, by making the first one at sequence 99 and the second at 100, you can always be sure which one will match first. Then in the sub you would do something like:
sub Yadda (name, output, wilds)
  if name = "First_one" then
    'store the wildcards contents in mushclient variables.
  else
    'retrieve the ones you saved and use them along with the contents of the new wildcards.
  end if


This works nicely, except for the minor fact that optionals like (\d+:\d+)? create a problem, do to regexp seeing them as 'sub patterns', but Mushclient using the same thing to define 'data to return'. This was an unintended complication that can kill you if you have too many cases where you need to 'match' a pattern, but can't actually exclude it in the next trigger. :p In that case you have no choice but to use the re_exec method. :(

For most cases though, you don't need to use () to define a 'group', so simply excluding it from the parts you don't want to pass to the sub means triggers will handle the problem without the cludge of re-processing the entire mess in scripting.
Top

Posted by Vaejor   (120 posts)  Bio
Date Reply #4 on Fri 04 Apr 2003 05:18 AM (UTC)

Amended on Fri 04 Apr 2003 05:20 AM (UTC) by Vaejor

Message
The code I use to grab more than 9 entries from a trigger can be found a few posts in at:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2224


...Er, yeah. And it's for VB only. I believe you could find something similar for perlscript or jscript though.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Fri 04 Apr 2003 05:22 AM (UTC)
Message
Sorry, re_exec was the C function. Try searching for "regexp pattern". Here is one such post:


http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1291

- Nick Gammon

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

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #6 on Fri 04 Apr 2003 06:21 AM (UTC)
Message
You could of course use the other method as well, which is to create multiple triggers, and use ?: to exclude wild expressions from being returned as wild cards.

See the file "RegularExpressions.txt" in one of the MUSHclient directories for more details.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Plazgoth   USA  (10 posts)  Bio
Date Reply #7 on Fri 04 Apr 2003 04:19 PM (UTC)
Message
Thanks for all the great feedback. I knid of got around the single line infobar by using the status line, but am not sure how to chnage the font, color, and size of it. When I search the functions page it seems that the status line does not have as many supporting functions as the info line.

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


26,350 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.