Stuck with aliases

KildClient forum.
Post Reply
Gumm
Posts: 2
Joined: Tue Jul 12, 2016 6:14 pm

Stuck with aliases

Post by Gumm »

Hello,

my first experience with kildclient had been really great, but now i am stuck with aliases. I simply want to create an alias like

Code: Select all

^tt (.*)$
which should be evaluated (without actually sending something to the mud) to

Code: Select all

$target = $1
But whatever i do, i always get warnings about uninitialized values, and the whole thing simply doesnt work. Any examples or suggestions what to do here?
In a second alias later i want to expant "kk" to "kill $target"....
ekalin
Site Admin
Posts: 44
Joined: Sun Feb 05, 2012 3:59 pm

Re: Stuck with aliases

Post by ekalin »

First, the alias must start with / so that it is executed as a Perl command. Otherwise you'll be sending text to the MUD server.

You also need to escape the $ in $target, otherwise the value of the $target variable will be replaced - generating the warnings about unitialized values.

Lastly, Perl syntax requires quotes around the string value to be assigned to $target. So the replacement should be

Code: Select all

/\$target = "$1"
As for the kk aliases, this one is more straightforward as you're just sending text to the server.

If you want, you can import the attached file to load the aliases in your world.
Attachments
aliases.xml
Aliases to be imported
(477 Bytes) Downloaded 1010 times
Gumm
Posts: 2
Joined: Tue Jul 12, 2016 6:14 pm

Re: Stuck with aliases

Post by Gumm »

works great! Thanks a lot
Post Reply