help with alias

Post Reply
Raiynsong
Posts: 11
Joined: Wed Oct 06, 2010 6:35 pm

help with alias

Post by Raiynsong »

I am trying to set up an alias for healing

in my mud the command is heal <target> <amount of heal>

what i want to do is to be able to set up an alias so that i type hh BOB and I heal BOB for 200. I can't seem to get this to work because the variable appears in the middle of the send command. Can someone help?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: help with alias

Post by Vadi »

send("heal " .. matches[2] .. " " .. matches[3])

or

send(string.format("heal %s %s", matches[2], matches[3]))

Raiynsong
Posts: 11
Joined: Wed Oct 06, 2010 6:35 pm

Re: help with alias

Post by Raiynsong »

ok that worked BUT what i want to do is set the amount to 200 each time so I dont have to type that. and just type
heal target and have the amount set in the alias. Is that possible?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: help with alias

Post by Vadi »

send("heal " .. matches[2] .. " 200")

Raiynsong
Posts: 11
Joined: Wed Oct 06, 2010 6:35 pm

Re: help with alias

Post by Raiynsong »

that's what i tried and it isn't working... my game is New Worlds Ateraan
pattern hh (.*)
and the send string as you have it above

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: help with alias

Post by Heiko »

you need to prefix the pattern with ^ othewise it'll fire on all hh sequences that you ever type :)
^hh (\w+)
send( "heal" .. matches[2] .. " 200" )
note the space before 200 :)

Raiynsong
Posts: 11
Joined: Wed Oct 06, 2010 6:35 pm

Re: help with alias

Post by Raiynsong »

thanks! It's working now finally. it was the space and the (\w+) THANKS so much for the help

Post Reply