More questions about the infobar and other things

Posted by Plazgoth on Thu 03 Apr 2003 10:43 PM — 8 posts, 34,470 views.

USA #0
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
Australia Forum Administrator #1
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.
USA #2
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
USA #3
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.
Amended on Fri 04 Apr 2003 04:31 AM by Shadowfyr
#4
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.
Amended on Fri 04 Apr 2003 05:20 AM by Vaejor
Australia Forum Administrator #5
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
Canada #6
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.
USA #7
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.