Help - Search - Members - Calendar
Full Version: Mushclient - Highlighting Enemies
Achaea's Forums > Off-Topic > Tech Support
Denex
Hola everyone!

I've got quite an interesting MUSHClient coding challenge. I am looking to highlight the names of everyone on the CITY ENEMIES list and make them Dark Red, and then HOUSE ENEMIES and make them Red so as to appear very similar to how the Group-Based Events work.


My goal is to have this able to be updated regularly by just checking HOUSE ENEMIES / CITY ENEMIES to remove any old highlights, and place in new highlights accordingly.

I know many of you have this already -- I come to you with the question.



How in the Nine Hells is it done? blink.gif

Regards,

-D
Kairuni
Make a regex trigger \b@!enemies\b and check expand variables, change the color on it.
use mushclient SetVariable : SetVariable("enemies","Bleak|Kairuni|Sabiru|Veldrin|Dakeyras|Rangor|HASHAN AHH")
magic.
Denex
In doing this, and then reviewing HOUSE ENEMIES - it only shows one out of every 12 or so bold red.

I think I messed something up here.


So one would copy the HOUSE ENEMIES list that shows : Luthius, Portis, Rinoa, Goliath, Alex, Pegasus, Arabi, Kragg, Otha, Ravirrh, etc. And then edit out all the " , " and replace with "|", and then put that in the Script in place of your old command line, correct?


Im trying to set this up to auto-update itself every time I use HOUSE ENEMIES / CITY ENEMIES list.
Kairuni
Did you forget to check repeat on same line ;(

as for updated via HOUSE ENEMIES, meet config screenwidth 0.
Dontarion
Capture the names with a trigger. String.gsub(string, ", ", "|"). Make a trigger with the format \b@!CityEnemies\b and select regex, repeat on same line, keep checking and pick a highlight color.
Soludra
QUOTE (Dontarion @ Nov 1 2009, 10:03 AM) *
Capture the names with a trigger. String.gsub(string, ", ", "|"). Make a trigger with the format \b@!CityEnemies\b and select regex, repeat on same line, keep checking and pick a highlight color.


Lowercase 's' in string.gsub. Also, assuming the variable with the string is called 'str', you can just do str:gsub(", ", "|).

And the trigger should probably be \b(?:@!CityEnemies)\b, note the grouping. MUSHclient will expand @!CityEnemies out into enemy1|enemy2|enemy3, and if you have anything besides the @!CityEnemies thing (and you do, the \b's), it'll confuse the regex and probably give inconsistent results.
Denex
Okay. Every time I try to add \b@!henemies\b as a trigger, it crashes mushclient.

FROM THE TOP.

What do I need to do from the very beginning?
-Create a variable named houseenemies
-Create a trigger with the viewline of : \b@!houseenemies\b
Within that, as SCRIPT output, houseenemies.gsub(string, ", ", "|")

?

Kairuni
It crashes MUSH if the variable is empty.
Trevize
QUOTE (Kairuni @ Nov 2 2009, 02:52 PM) *
It crashes MUSH if the variable is empty.

Or starts/ends with a vertical bar, or has two in a row. This is because that regex will matching -everything-.
Irion
QUOTE (Trevize @ Nov 3 2009, 09:34 PM) *
QUOTE (Kairuni @ Nov 2 2009, 02:52 PM) *
It crashes MUSH if the variable is empty.

Or starts/ends with a vertical bar, or has two in a row. This is because that regex will matching -everything-.


Actually if you have () around the whole string of names it can have an extra | at the end and still function.
So:

(Irion|Trevize|Soludra|) still works. For wharever reason.
Trevize
QUOTE (Irion @ Nov 7 2009, 11:38 AM) *
QUOTE (Trevize @ Nov 3 2009, 09:34 PM) *
QUOTE (Kairuni @ Nov 2 2009, 02:52 PM) *
It crashes MUSH if the variable is empty.

Or starts/ends with a vertical bar, or has two in a row. This is because that regex will matching -everything-.


Actually if you have () around the whole string of names it can have an extra | at the end and still function.
So:

(Irion|Trevize|Soludra|) still works. For wharever reason.

If there's something else in the pattern, yeah. But if that is -the whole pattern- it should freeze up.
Irion
QUOTE (Trevize @ Nov 10 2009, 08:22 AM) *
QUOTE (Irion @ Nov 7 2009, 11:38 AM) *
QUOTE (Trevize @ Nov 3 2009, 09:34 PM) *
QUOTE (Kairuni @ Nov 2 2009, 02:52 PM) *
It crashes MUSH if the variable is empty.

Or starts/ends with a vertical bar, or has two in a row. This is because that regex will matching -everything-.


Actually if you have () around the whole string of names it can have an extra | at the end and still function.
So:

(Irion|Trevize|Soludra|) still works. For wharever reason.

If there's something else in the pattern, yeah. But if that is -the whole pattern- it should freeze up.


Yeah, it definitely does.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.