Trigger issues in Mudlet

I'm trying to do this:

^(\w+) put your hands on your hips and go "Hmmm!"$   (Where the start of this line and the value for "target" is "You.")


if matches[2] == target then

cecho("<cyan>\nHey, this is working!")

end


And it's working... but only when I remember to capitalize my target's name.  Is there a way I can make the same trigger work without needing to capitalize the value for "target?"

Comments

  • KaimanahiKaimanahi The One True Queen
    There are ways to fudge it into your triggers, but probably the best way is to use something like this as your target alias:

    target = matches[2]:title()

    This will make sure your target is always capitalized. If you're set on the other way, you can use matches[2]:lower() in your trigger to make it lowercase, but to make sure your target wasn't input as upper case then you'd probably use:

    if matches[2]:lower()==target:lower() then
    image
  • edited March 2013
    Awesome! I'll try out the first one. Thanks so much!

    Edit: That's *exactly* what I was looking for. Thanks again!
Sign In or Register to comment.