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


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Fri Aug 23, 2002 3:12 am   

I think I need a #FORALL?
 
#IF (&edged="-1") {#VARIABLE so_edged {Neg}} {
#IF (&edged="0") {#VARIABLE so_edged {None}} {
#IF (&edged="1") {#VARIABLE so_edged {V Poor}}{
#IF (&edged="2") {#VARIABLE so_edged {Poor}} {
#IF (&edged="3") {#VARIABLE so_edged {V Litt}} {
#IF (&edged="4") {#VARIABLE so_edged {B Avg}} {
#IF (&edged="5") {#VARIABLE so_edged {Avg}} {
#IF (&edged="6") {#VARIABLE so_edged {A Avg}} {
#IF (&edged="7") {#VARIABLE so_edged {Good}} {
#IF (&edged="8") {#VARIABLE so_edged {V Good}} {
#IF (&edged="9") {#VARIABLE so_edged {Excellent}} {
#IF (&edged="10") {#VARIABLE so_edged {Supreme}} {
#IF (&edged="11") {#VARIABLE so_edged {Ultra}} {
#IF (&edged="12") {#VARIABLE so_edged {Absurd}} {
#IF (&edged="13") {#VARIABLE so_edged {MAX}}}}}}}}}}}}}}}}

The above script is part of my DB script that I've been working on for what feels like months. The script above works perfect. My question is, how can i run the above script, and just replace every instance of "edged" with blunt, fire, ice, acid, mind, and poison?

my attempt didn't work, but it might give you an idea of what i want to do:

#FORALL edged|blunt|fire|ice|acid|mind|poison {
#IF (&%i="-1") {#VARIABLE so_%i {Neg}} {
#IF (&%i="0") {#VARIABLE so_%i {None}} {
#IF (&%i="1") {#VARIABLE so_%i {V Poor}}{
#IF (&%i="2") {#VARIABLE so_%i {Poor}} {
#IF (&%i="3") {#VARIABLE so_%i {V Litt}} {
#IF (&%i="4") {#VARIABLE so_%i {B Avg}} {
#IF (&%i="5") {#VARIABLE so_%i {Avg}} {
#IF (&%i="6") {#VARIABLE so_%i {A Avg}} {
#IF (&%i="7") {#VARIABLE so_%i {Good}} {
#IF (&%i="8") {#VARIABLE so_%i {V Good}} {
#IF (&%i="9") {#VARIABLE so_%i {Excellent}} {
#IF (&%i="10") {#VARIABLE so_%i {Supreme}} {
#IF (&%i="11") {#VARIABLE so_%i {Ultra}} {
#IF (&%i="12") {#VARIABLE so_%i {Absurd}} {
#IF (&%i="13") {#VARIABLE so_%i {MAX}}}}}}}}}}}}}}}}}

What's wrong with the above script? why won't it work? please fix it for me :) thanks

Father Horks
The only problem with computer security, is when you think it exists.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri Aug 23, 2002 3:57 am   
 
Ah, yes you can do it.

Just have to make em like this:
#FORALL edged|blunt|fire|ice|acid|mind|poison {
#IF (&{%i}="-1") {#VARIABLE so_%i {Neg}} {
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 23, 2002 6:20 pm   
 
If you do your script like this, you can easily change damage types
#VAR so_edged {%case(%eval(&edged + 2), Neg, None, V Poor, Poor, V Litt, B Avg, Avg, A Avg, Good, V Good, Excellent, Supreme, Ultra, Absurd, MAX)}

For instance,
#VAR so_blunt {%case(%eval(&blunt + 2), Neg, None, V Poor, Poor, V Litt, B Avg, Avg, A Avg, Good, V Good, Excellent, Supreme, Ultra, Absurd, MAX)}

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