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

Bolding a Captured Variable for Echo?

ExelethrilExelethril Member Posts: 3,360 @@ - Legendary Achaean
edited January 2017 in Curing Systems and Scripts
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 ValhallaMember Posts: 203 ✭✭✭ - 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 beMember Posts: 3,370 @@ - Legendary Achaean
    edited January 2017
    selectCaptureGroup (2) setBold (true) deselect ()
    Huh. Neat.
  • ExelethrilExelethril Member Posts: 3,360 @@ - Legendary Achaean
    edited January 2017
    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 beMember Posts: 3,370 @@ - 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 Member Posts: 3,360 @@ - 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 Member, Secret Squirrel Posts: 5,287 @@ - 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.

    Deucalion has cowardly declined the challenge of Atalkez to engage in mortal combat.

    You hug Aurora compassionately.
    Exelethril
  • ExelethrilExelethril Member Posts: 3,360 @@ - 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 Member, Secret Squirrel Posts: 5,287 @@ - Legendary Achaean
    Try to select direction too?

    selectCaptureGroup(direction)
    setBold(true)
    deselect()

    no idea if you can do that or not 

    Deucalion has cowardly declined the challenge of Atalkez to engage in mortal combat.

    You hug Aurora compassionately.
  • AhmetAhmet Wherever I wanna beMember Posts: 3,370 @@ - Legendary Achaean
    Cant do that, no.
    Huh. Neat.
  • RyzethRyzeth Member Posts: 1,105 @ - Epic Achaean
    edited January 2017
    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 beMember Posts: 3,370 @@ - 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 Member Posts: 3,360 @@ - Legendary Achaean
    edited January 2017
    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 beMember Posts: 3,370 @@ - Legendary Achaean
    Setbold should work on your trigger as well as long as you've selected the text (which selectCaptureGroup does)
    Huh. Neat.
  • TydasTydas Member Posts: 232 ✭✭✭ - Distinguished
    The setBold function doesn't work with cecho, only with standard echo or insertText. That's why it's not working.
    AhmetExelethril
  • ExelethrilExelethril Member Posts: 3,360 @@ - Legendary Achaean
    Is there a way to make it work with cecho?

    [ SnB PvP Guide | Link ]

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

    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 Member Posts: 3,360 @@ - Legendary Achaean
    edited January 2017
    Awesome, thanks!! That worked.

    [ SnB PvP Guide | Link ]

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