Mudlet syntax

edited October 2015 in Common Grounds
how would I make an alias like pointing staff in a direction or moving  a phantomsphere in a certain direction? I apologize because I have asked this before, but I forgot how to. In mudlet that is.

Comments

  • LuceLuce Fox Populi
    This should probably be in the mechanic's corner, but I'm assuming you want to do something like PST <person> <dir>?

    If so, under the Alias window, create a new alias with Add Item.

    Your pattern is going to be ^pst (\w+) (\w+)$ as regex, then your main window would have send("Point Staff "..matches[2].." "..matches[3])
    This will let you do pst Roark e to send the staff command at Roark, to the east.

    Obviously whatever you want the command to be goes under pattern.

    For the record, matches[1] returns the whole pattern (pst Roark e).
  • thank you. Sorry if I put it in the wrong place.
  •  I don't think it's working for me
  • where does matches[1] go?
  • edited October 2015
    Edit: oops, my brain wasn't working. The correct picture is below:

    image

    ^ That is what he meant. Read through his post and look at the picture.

  • Yeah I keep getting that is not  a valid command.
  • Alternatively to the above;

    Pattern: ^pst (\w+)(?: (\w+)|)$

    Code:

    if matches[3] == nil then

       send("point staff "..target.." "..matches[2])

    else

       send("point staff "..matches[3].." " ..matches[2])

    end


    Usage: pst e, for example, will point staff at your target to the east.

                pst e lerad, will point staff at lerad to the east.


    image
  • LuceLuce Fox Populi
    Worth noting: user made aliases are case sensetive, which is shy I always code mine in lower case.

    The above will trigger on pst lerad e, not Pst lerad e or PST lerad e.
  • edited October 2015
    Yeah both ways are still giving me the it's not a valid command. I put everything in correctly. Is there something wrong with my attack alias maybe?
  • nevermind! I was doing the syntax wrong, it works! thank you.
  • do you have a space between the end of staff and the "? because if you don't do that it'll end up sending point staffdirection

    It might help if you can show us exactly what your alias looks like.
  • pst leard e
    point staff leard e is what it does. I was doing just pst before, it needed the entire pst leard e to work.
  • my fault!
Sign In or Register to comment.