Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: 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.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: 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.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net