 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Sat Oct 25, 2008 4:14 am
Slightly More than Simple Alias |
I figured I could accomplish this easily with what I know. I failed and I looked it up in the manual and still failed, so I'm at a loss. It should be simple, but it isn't.
What I speak of is an alias that accomplishes the following.
fireproof # <item name>
fireproof 2 golden warding ring
remove 2.'golden warding ring'
c fireproof 'golden warding ring'
wear 'golden warding ring'
remove 'golden warding ring'
c fireproof 'golden warding ring'
wear 'golden warding ring'
fireproof 1 holy symbol
remove 'holy symbol'
c fireproof 'holy symbol'
wear 'holy symbol'
I've tried:
Code: |
ID: fireproof($number, $item)
#IF ($number=1)
{
remove '$item'
c fireproof '$item'
wear '$item'
}
#IF ($number=2)
{
remove 2.'$item'
c fireproof '$item'
wear '$item'
remove '$item'
c fireproof '$item'
wear '$item'
}
ID: fireproof
#IF (%1=1)
{
remove '%-2'
c fireproof '%-2'
wear '%-2'
}
#IF (%1=2)
{
remove 2.'%-2'
c fireproof '%-2'
wear '%-2'
remove '%-2'
c fireproof '%-2'
wear '%-2'
}
|
I can only ever wear 2 of an item anyways, hence why I have limited it to if statements as opposed trying to do some sort of loop. |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Oct 25, 2008 4:35 am |
Don't know what's not working for you. Where is it failing? I just tried:
Quote: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<alias name="fireproof" copy="yes">
<value>#IF (%1=1) {remove %-2;c fireproof '%-2'';wear '%-2'} {remove 2.'%-2';c fireproof '%-2';wear '%-2';remove '%-2';c fireproof '%-2';wear '%-2'}</value>
</alias>
</cmud>
|
which is essentially what your second alias does, and it worked for me.
Charneus |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Sat Oct 25, 2008 4:54 am |
Odd, it works now too. Perhaps I missed a bracket somewhere. And by works, well, it doesn't work entirely but I think it's an issue with the commands to the MUD, not a CMUD problem.
|
|
|
 |
|
|