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
sourcecomm
Newbie


Joined: 12 May 2002
Posts: 0

PostPosted: Thu Apr 11, 2002 9:01 am   

Target Variable HOW?
 
Ok Here is my dilemma.

I am trying to continously heal myself without having to keep pressing the alias for heal lets say (alias c 'cast cure light').

Now..in game when I type cure light it casts cure light on me. Defaulted. It casts on yourself. Now if I type cs person, it'll cast the first cure light on that person but the rest of the cure light casting will be back to me.

I figured that I can use a variable in this situation. For instance having let's say an alias cs @healtarget

Whereby, I need to define @healtarget with another alias that will put the actual person's name in that variable.

The question is, how do I create that alias to store a persons name in that variable. This way I can even have a another target for attacking and all I have to do is always set my attacking target to whatever I want to attack then just type k because k is an alias set to k @attacktarget variable.

Any ideas? Thanks

ZmuD AddicT
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Apr 11, 2002 9:23 am   
 
quote:

I am trying to continously heal myself without having to keep pressing the alias for heal



You'll have to tie that into your prompt
with some fancy foot work so you aren't
spamming. There are many examples in the
forums that use flags for this. Search
for auto heal.


quote:

The question is, how do I create that alias to store a persons name in that variable.


#ALIAS c {cast cure light}
#ALIAS setheal {#VAR healtarget %prompt("","Heal target:")}
#ALIAS cs {cast cure light @healtarget}

Similiarily,

#ALIAS setkill {#VAR attacktarget%prompt("","Attack target:")}
#ALIAS k {kill @attacktarget}

There are other ways of doing this, I remember
Troubadour doing something nifty somewhere.

Ton Diening
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 11, 2002 5:17 pm   
 
You can set the variable with the same alias that casts the spell.
#AL c {#VAR healtarget {%1};cast 'cure light' %1}
NOTE: The {} around %1 in the #VAR command are essential for recognizing a null-value.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
sourcecomm
Newbie


Joined: 12 May 2002
Posts: 0

PostPosted: Thu Apr 11, 2002 9:09 pm   
 
Thank you very much..just what I was looking for!

ZmuD AddicT
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