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
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 4:16 pm   

More questions about using %#
 
I have an alias that will let me cast spells repeatidly:
I want to make it I can string it all together and it would then cast it one at a time
For instance

ewh 4 rh 4 lh 5 head 5 neck

What those are is this
C is the alias
esh is the type of spell
4 is the power I want to use
then where I want to cast it at

For the value I had this to begin with
prep esh %1
which prepped the spell good.
Then when it reaches the next part I want it to expand the word

If it is rh then it will set the variable heal to right hand
if it is ll then it will set the variable heal to left leg, etc
#IF %2="ra" {#VAR heal1 right arm}
(this however was only capturing the word right and not right arm but I want it to capture right arm if I put ra)

then the next line is

#TRIGGER {You feel fully prepared} {cast @heal1}
This is saying when the spell is ready to cast it will cast.

After this is done I want to then go back to the top and do it again but there is a small problem. Is there anyway to shift the %# so that %3 becomes %1 and %5 becomes %2, etc. Then when it casts the second time it shifts it again and starts back at the top
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sat Jan 11, 2003 8:16 pm   
 
#CLASS {casting}
#VAR cast {all}
#TRIGGER {prep (*)} {#var cast %1;does nothing;more nothing;some more of that;your ready}
#TRIGGER {your ready} {cast @cast}
#CLASS 0

Try this it just might work for you, change the triggers to what ever you want the the last trigger to what the mud says when your ready, should work but may have a bug in that it might try to cast twice.?

megamog75
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jan 11, 2003 9:45 pm   
 
From the explanation you gave, I'm guessing
  • ewh 4 rh 4 lh 5 head 5 neck

  • should actually be
  • C esh 4 rh 4 lh 5 head 5 neck

  • You should always doublecheck your posts for typos.

    Anyway, I think this will do what you want.
    #AL C {#VAR CastSpell %1;#VAR CastList {%replace(%-2, " ", "|")};ListCast}
    #AL ListCast {#IF (%numitems(@CastList)) {#VAR CastTarget %item(@CastList, 2);#IF (%item(@CastList, 2) = "rh") {#VAR CastTarget {right hand}};#IF (%item(@CastList, 2) = "lh") {#VAR CastTarget {left hand}};#IF (%item(@CastList, 2) = "ra") {#VAR CastTarget {right arm}};#IF (%item(@CastList, 2) = "la") {#VAR CastTarget {left arm}};#IF (%item(@CastList, 2) = "rl") {#VAR CastTarget {right leg}};#IF (%item(@CastList, 2) = "ll") {#VAR CastTarget {left leg}};#TEMP {You feel fully prepared} {cast @CastTarget;#ALA +1 ListCast};prep @CastSpell %item(@CastList, 1);#DELNITEM CastList 1;#DELNITEM CastList 1}}

    LightBulb
    Senior Member
    Reply with quote
    RobMacAF
    Apprentice


    Joined: 09 Jun 2002
    Posts: 186
    Location: USA

    PostPosted: Sun Jan 12, 2003 12:36 am   
     
    actually ewh is the alias that I use. It stands for the name of one of my spells
    Reply with quote
    LightBulb
    MASTER


    Joined: 28 Nov 2000
    Posts: 4817
    Location: USA

    PostPosted: Sun Jan 12, 2003 3:06 am   
     
    Then modify the above script accordingly. This one was written to work with:
    "C is the alias
    esh is the type of spell
    4 is the power I want to use
    then where I want to cast it at"

    LightBulb
    Senior Member
    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