Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Bolding a Captured Variable for Echo?

ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
Hello,

Looking for help in regards to capturing a wildcard via a trigger and bolding that particular wildcard in an echo.

[ SnB PvP Guide | Link ]

[ Runewarden Sparring Videos | Link ]

Comments

  • ZahanZahan ValhallaPosts: 200Member ✭✭✭ - Distinguished
    Are you having trouble capturing the wildcard?  If so, let's see the pattern.

    Capturing it already?  Is it safe to assume you're on mudlet?

    There is a pretty easy way to do bold echos in mush, by setting a note style before the note.  Not sure about mid-line though, I haven't tried that yet.  Definitely not sure about mudlet.

    I usually just change the colour of the word in the sentence, but bolding stuff sounds fun.  I might try it myself.
    Click here for Nexus packages
    Currently available: Abs, Cnote, Keepalive, Lootpet, Mapmod
  • AhmetAhmet Wherever I wanna bePosts: 3,344Member @@ - Legendary Achaean
    edited January 8
    selectCaptureGroup (2) setBold (true) deselect ()
    Huh. Neat.
  • ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
    edited January 8
    I don't have any trouble with capturing it. It's the bolding in the echo part that I'm having trouble with.

    @Ahmet : Oh, what does selectCaptureGroup(2) do?

    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
  • AhmetAhmet Wherever I wanna bePosts: 3,344Member @@ - Legendary Achaean
    selectCaptureGroup selects whatever text is in the matches group for your current trigger. 1 for the whole line, 2 for your first capture group, etc.
    Huh. Neat.
    Exelethril
  • ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
    I tried this, still doesn't seem to work HMMM

    ^(\w+) leaves to the (\w+).   (perl regex)



    if target == matches[2] then

    direction = matches[3]:upper()

    selectCaptureGroup (3) setBold (true) deselect ()

    cecho("\n <GreenYellow> MOVED ::::::> [ >> " ..direction.. " << ]")

    cecho("\n <GreenYellow> MOVED ::::::> [ >> " ..direction.. " << ]")

    cecho("\n <GreenYellow> MOVED ::::::> [ >> " ..direction.. " << ]")

    cecho("\n <GreenYellow> MOVED ::::::> [ >> " ..direction.. " << ]")

    end




    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
  • AtalkezAtalkez Posts: 4,132Member, Secret Squirrel @@ - Legendary Achaean
    You have the beginning anchor but not the end. Also you're not escaping your period at the end.

    ^(\w+) leaves to the (\w+)\.$

    Also, when you select the capture group, you may need to use matches[3] instead of just 3. I could be wrong on this one though.


    You hug Aurora compassionately.
    Exelethril
  • ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
    Thanks but capturing isn't the problem though. It captures both variables without the anchor.



    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
  • AtalkezAtalkez Posts: 4,132Member, Secret Squirrel @@ - Legendary Achaean
    Try to select direction too?

    selectCaptureGroup(direction)
    setBold(true)
    deselect()

    no idea if you can do that or not 


    You hug Aurora compassionately.
  • AhmetAhmet Wherever I wanna bePosts: 3,344Member @@ - Legendary Achaean
    Cant do that, no.
    Huh. Neat.
  • RyzethRyzeth Posts: 1,105Member ✭✭✭✭✭ - Grand Achaean
    edited January 8
    If you're trying to bold the echo, I'm pretty sure you can't. Could be wrong, though. Nothing I tried in the past worked at least.
  • AhmetAhmet Wherever I wanna bePosts: 3,344Member @@ - Legendary Achaean
    You can bold an echo by using setBold(true) before your echo. It's nearly indistinguishable from regular text unless you highlight it or use a very large font size, though.
    Huh. Neat.
  • ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
    edited January 8
    Ok well, thanks anyways, guys. I'll just pay more attention to the unbolded stuff.

    setBold(true) works on echoes but not on specific variables, I think?

    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
  • AhmetAhmet Wherever I wanna bePosts: 3,344Member @@ - Legendary Achaean
    Setbold should work on your trigger as well as long as you've selected the text (which selectCaptureGroup does)
    Huh. Neat.
  • TydasTydas Posts: 232Member ✭✭✭ - Distinguished
    The setBold function doesn't work with cecho, only with standard echo or insertText. That's why it's not working.
    AhmetExelethril
  • ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
    Is there a way to make it work with cecho?

    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
  • TydasTydas Posts: 232Member ✭✭✭ - Distinguished
    Is there a way to make it work with cecho?
    There's a workaround. Try this:
    cecho("\n <GreenYellow> MOVED ::::::> [ >> ")
    setBold(true)
    fg("GreenYellow")
    echo(direction)
    resetFormat()
    cecho("<GreenYellow> << ]")

    You can put it all on one line, like so, for easy reading:
    cecho("\n <GreenYellow> MOVED ::::::> [ >> "); setBold(true); fg("GreenYellow"); echo(direction); resetFormat(); cecho("<GreenYellow> << ]")
    Testing this, it works, and the text definitely bolds, though how easy it is to tell remains dependent on your font and font size.
    Exelethril
  • ExelethrilExelethril PhD EbonicsPosts: 3,123Member @@ - Legendary Achaean
    edited January 8
    Awesome, thanks!! That worked.

    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
Sign In to Comment.