Highlighting targets?

I'm fairly inexperienced in Mudlet coding, beyond very simply basics.

How would I set the system to highlight my target in red, so that I can easily track it?

My variable is 'target', and I'm just trying to make it highlight it in every output, for ease of it all.

Also, is there a very simple curing system (that is free) and up to date (mostly) that I could use for bashing in areas like Shallach Ruins and the like?
image

Comments

  • It has been a while, but I believe there is a trigger type called "highlight" which will highlight the matched words in the trigger.  Should be a drop down menu option.
  • Interesting, that worked, but how do I make it highlight 'target' variable?  Right now, it only highlights the word 'target'
    image
  • TarkentonTarkenton Traitor Bear
    edited October 2014
    according to the mudlet wiki, put the following in your target alias, http://wiki.mudlet.org/w/Manual:Scripting#How_to_highlight_my_current_target.3F is the page in question.

    target = target:title()
    if id then killTrigger(id) end
    id = tempTrigger(target, [[selectString("]] .. target .. [[", 1) fg("gold") deselect() resetFormat()]])

    Edit: Assuming you're targeting players.  If you're targeting denizens by something like fink, snake, etc, then you'd want to get rid of the first line.  Ideally, run a target alias for pvp, one for pve, that way you can highlight both.
    image
  • Man, thanks!  Life saver!
    image
  • ShaddusShaddus , the Leper Messiah Outside your window.
    I've probably seen four different ways of doing this, and this is by far the easiest way of doing it. Thank you!
    Everiine said: The reason population is low isn't because there are too many orgs. It's because so many facets of the game are outright broken and protected by those who benefit from it being that way. An overabundance of gimmicks (including game-breaking ones), artifacts that destroy any concept of balance, blatant pay-to-win features, and an obsession with convenience that makes few things actually worthwhile all contribute to the game's sad decline.
  • TarkentonTarkenton Traitor Bear
    I take zero credit for this, other than putting "highlight target in mudlet" into Google :p
    image
  • when I do this, my highlighted target seems to stay highlighted, even after I change targets. suggestions?
  • edited May 2017
    Not sure if the old code isnt working for some reason but I tried making one based on what that thingy said and this works:

    https://pastebin.com/i9uSFcmN

    or

    target = string.lower(matches[2])

    cecho("\n<red>MY TARGET IS: <white>"..string.title(target))

    if (colourtarget) then killTrigger(colourtarget) end

    colourtarget = tempTrigger(target, [[selectString("]] .. target .. [[", 1) fg("gold") deselect() resetFormat()]])



  • Hmm this works but  mm name database seems to over write it.
  • Highlights your target red and capitalizes the name for you. The color does go away once you target someone else or target nothing at all. Also, it overrides NDB.  Hope it helps! :D



    ALIAS IS AS FOLLOWS:

    pattern is: ^t (.*)

     Big White Box:
                                 
    setTarget(matches[2]:title())






    SCRIPT IS AS FOLLOWS:

    function setTarget(tar)
       target = tar
       if id then killTrigger(id) end
       id = tempRegexTrigger("\\b(?i)" .. target .. "\\b", [[colorAllInLine(matches[1], "red")]])
       cecho("<white>=<gold>)_)_)_)_)_)_)_)_)_)_)_<white>@&lt;red> " .. target:title())
        
       send(" ")
    end
    --coloring script for targetting
    function colorAllInLine(word, color)
       local i = 0
       for _ in string.gmatch(line, word) do
          i = i + 1
          selectString(word, i)
          fg(color)
       end
    end

  • Feel free to edit the colors and wand I drew. hehe
  • I recommend making a little table for this script, just for tidiness.  (Global variables proc my OCD)

    So I'd add above the function:

    valScript = valScript or {}

    and replace all instances of tar or id with valScript.tar and valScript.id!

    Nice work :)
    Take great care of yourselves and each other.
  • Ciaran said:
    I recommend making a little table for this script, just for tidiness.  (Global variables proc my OCD)

    So I'd add above the function:

    valScript = valScript or {}

    and replace all instances of tar or id with valScript.tar and valScript.id!

    Nice work :)
    Ooohh! Getting fancy on me! Thanks for that. :smile:
  • edited September 2017
    You can also put the functions within that table if you like. (Just make sure to define your table before trying to define the function!)

    So it'd look like this:

    valScript = valScript or {}


    function valScript.setTarget(tar)
    ......blah......
    end

    The more you know! :)
    Take great care of yourselves and each other.
Sign In or Register to comment.