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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Fri Oct 13, 2006 5:47 am   

Alias help
 
Is it possible to make an alias, with a default and arguments? so like say I make an alias, we'll call it HEAL. Now what I want it to do is if its sent by itself, if will check a list of things your afflicted, and based on this list cure the highest prioty. However if you use HEAL (affliction) it should heal that affliction right then and there, is it possible to do this?
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Fri Oct 13, 2006 6:19 am   
 
#alias {heal} {#if (%ismember(%-1,@afflictionlist)) {} {~heal %-1}}
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Fri Oct 13, 2006 6:29 am   
 
How does that work exactly?
Reply with quote
rajasetan
Beginner


Joined: 14 Sep 2006
Posts: 11
Location: Jakarta, Indonesia

PostPosted: Fri Oct 13, 2006 3:07 pm   
 
Try something like (UNTESTED)

#ALIAS heal {#IF (%-1 == "") {#FORALL @affliction {#IF (%ismember(%i, @afflicted)) {~heal %i}}} {~heal %-1}}

How it's suppose to work:
first, it checks if there are any arguments after the heal.
If there are, then it will go over the @affliction list (You need to make this list, with the highest priority affliction on top) to check if you are afflicted with that affliction (here it's called @afflicted, change this to a stringlist where you keep the list of things you're afflicted with) and will heal that affliction.
If there is anything after heal, then it heals that affliction.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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