Need a script for targetting

So, I figure this exists. When someone in clan says targeting: soandso, I need help to do the code to target the person. Am I saying this right? Or is there something that will enemy the person, since I play a mage, using that? Am I asking this right?
Mysrai, the Beckoner Beyond the Maze intones, "Continue to manifest the paradigm of working, My Alary."
The Divine voice of Camus the Cinderfly echoes in your head, "Thank you, once-body. I am happy that I fell into that eye."
image

Comments

  • I'm no master of combat, but as a mage I think you also have to enemy them if you have demesne and effects. The easiest way to do this is take the standard targetting format if your org does it all the same and use a regex to match it.

    I'm on my phone but when I get to my laptop ill write the expression up for you.

         "He was well fed, and on his way to being slightly intoxicated--which contributed to his sense of wellbeing. And, most important, he was among friends. There can't be much more to life than this, he thought."  -Pug's thoughts on his first Ale (via Raymond Feist)


    Visit my personal authorial website. (coming back up soon, with my first publications)
    Coding Resources: Mechanic's Corner | Code Academy | StackOverflow
  • ^\( .+?\)\: .+? says\, \"TARGET\: (.+?)\.\"$

    So for some reason my client isn't highlighting it like it should, but hypothetically this should work. You might need to test to see if the paranthesis denotes a wildcard catch and a non-paranthesis doesn't catch, but the target will either be %1 or %3

         "He was well fed, and on his way to being slightly intoxicated--which contributed to his sense of wellbeing. And, most important, he was among friends. There can't be much more to life than this, he thought."  -Pug's thoughts on his first Ale (via Raymond Feist)


    Visit my personal authorial website. (coming back up soon, with my first publications)
    Coding Resources: Mechanic's Corner | Code Academy | StackOverflow
  • Erm. I feel very stupid. I didn't catch one in five things you just said....
    Mysrai, the Beckoner Beyond the Maze intones, "Continue to manifest the paradigm of working, My Alary."
    The Divine voice of Camus the Cinderfly echoes in your head, "Thank you, once-body. I am happy that I fell into that eye."
    image



  • Majanishi said:
    ^\( .+?\)\: .+? says\, \"TARGET\: (.+?)\.\"$

    So for some reason my client isn't highlighting it like it should, but hypothetically this should work. You might need to test to see if the paranthesis denotes a wildcard catch and a non-paranthesis doesn't catch, but the target will either be %1 or %3
    He gave you a very basic script which will allow you to automatically change your target according to what someone says in your clan....
    (I've never used %1 or %3 to get a target though, could you elaborate @Majanishi?)
  • It depends on your client. %1 and %3 are Mushclient's temporary variable capturing syntaxes. %1 means "The first captured variable". So the actual target in this case is %1, if you're using Mushclient. If you're using Mudlet, it's matches[2].

    Note that a backslash "\" before a symbol (things like ( ) / " ' , < > etc.) will "escape" the symbol, meaning it becomes not a regex symbol, but an actual text the trigger looks for.

    For example, you want to match the following text:

    Andrew says target is Andy.

    The regex for it should be:

    ^Andrew says target is Andy\.$  <--- notice the backslash before the final fullstop at the end.

    To capture Andy as a variable:

    ^Andrew says target is (.+?)\.$ <--- now you can use %1 or matches[2] to recall "Andy" in your trigger's script.

    To make it match other people except andrew saying, but not capture who the speaker is,

    ^.+? says target is (.+?)\.$

  • Alary said:
    Erm. I feel very stupid. I didn't catch one in five things you just said....
    Don't feel stupid at all, regular expressions are very complex. There's a reason most Computer Science majors have to sit through a few weeks of regex training while getting their degrees.

         "He was well fed, and on his way to being slightly intoxicated--which contributed to his sense of wellbeing. And, most important, he was among friends. There can't be much more to life than this, he thought."  -Pug's thoughts on his first Ale (via Raymond Feist)


    Visit my personal authorial website. (coming back up soon, with my first publications)
    Coding Resources: Mechanic's Corner | Code Academy | StackOverflow
  • Alright, so I'm starting to understand a little. Now, this goes under triggers or aliases? /derp
    Mysrai, the Beckoner Beyond the Maze intones, "Continue to manifest the paradigm of working, My Alary."
    The Divine voice of Camus the Cinderfly echoes in your head, "Thank you, once-body. I am happy that I fell into that eye."
    image
  • Got it going, thanks guys.
    Mysrai, the Beckoner Beyond the Maze intones, "Continue to manifest the paradigm of working, My Alary."
    The Divine voice of Camus the Cinderfly echoes in your head, "Thank you, once-body. I am happy that I fell into that eye."
    image
Sign In or Register to comment.