|
CFeather Newbie
Joined: 29 Dec 2010 Posts: 6
|
Posted: Wed Dec 29, 2010 4:34 pm
Alias Trouble |
Here is my alias
#al rb {say rub %alias(%1) on weapon}
Now this alias only works sometimes. For example:
RB JT works fine
1275h, 1275m cdevx- outp jitsu
say rub jitsu on weapon
Done.
1275h, 1275m cdevx-
Your rune-bug picks up words; Zog says, "Rub jitsu on weapon".
But RB GM doesnt work
Done.
1275h, 1275m cdevx-
Your rune-bug picks up words; Zog says, "Rub grimleaf".
1275h, 1275m cdevx-
I am unable to comprehend what you ask.
1275h, 1275m cdevx-
So what it does sometimes is place the "ON WEAPON" onto a 2nd line. I cant for the life of me figure out why. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Dec 29, 2010 6:02 pm |
Why are you using %alias? It looks to me like you just need %1, not %alias(%1). %alias(foobar) is for expanding an alias named foobar, which is not what you are doing.
|
|
|
|
CFeather Newbie
Joined: 29 Dec 2010 Posts: 6
|
Posted: Wed Dec 29, 2010 7:08 pm |
Yes, that is what Im trying to do.
GM is alias for grimleaf
JT is alias for jitsu |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Dec 29, 2010 7:17 pm |
Please show us the actual XML code for all of the aliases. Put it within code tags like so:
Click on the alias to select it
In the code window at the right, click on the XML tag at the bottom
Highlight all of the XML code displayed, and type CTRL-C to copy it to the buffer
In your reply to this thread, type: [code]
Then type CTRL-V to paste the code
They type: [/code]
Do this for all three aliases. |
|
|
|
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Wed Dec 29, 2010 7:23 pm |
I was looking at this and it looks like the original poster has aliases set to shorten the names of items he uses. JT looks to be an alias for the word jitsu, GM an alias for grimleaf. I can't seem to get any fails with a similar test system. Does "on weapon" still appear on a second line if you change the alias to this?
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<alias name="rb" copy="yes">
<value>#send {say rub %alias(%1) on weapon}</value>
</alias>
</cmud>
|
That probably won't make a difference but it's worth a shot. If it still continues to fail you might consider using an alias like the one below.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<alias name="rb" copy="yes">
<value>#local rub
#switch (%1 =~ "JT") {$rub = jitsun}
(%1 =~ "GM") {$rub = grimleaf}
#send say rub $rub on weapon</value>
</alias>
</cmud> |
Or even making a database variable with the keys being your short names and the values being their full names then checking your alias parameters against the key and returning the value.
*edit*
A bit late I guess lol. |
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Last edited by Fizgar on Wed Dec 29, 2010 7:25 pm; edited 1 time in total |
|
|
|
CFeather Newbie
Joined: 29 Dec 2010 Posts: 6
|
Posted: Wed Dec 29, 2010 7:24 pm |
<alias name="rb" id="101">
<value>outp %alias(%1)
say rub %alias(%1) on weapon
</value>
</alias> |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed Dec 29, 2010 7:40 pm |
Er, still not sure why it's being done like this. Instead of creating several aliases with no purpose whatsoever, why not do the following:
Code: |
#ADDKEY items jt jitsun
#ADDKEY items gm grimleaf |
then
Code: |
#ALIAS rb {#SEND {say rub %db(items, %1) on weapon}} |
That way, one variable, one alias, and you're set to go.
Charneus |
|
|
|
CFeather Newbie
Joined: 29 Dec 2010 Posts: 6
|
Posted: Wed Dec 29, 2010 8:44 pm |
Yeah, that does work better. Ill do it this way instead...thanks
|
|
|
|
|
|