Quote:
Originally Posted by Irreverent
OK, what did I do wrong...if I hand in ANY of the plat amt is casts ALL spells?
sub EVENT_ITEM() {
if ($platinum = 500) {quest::selfcast(3360);}
if ($platinum = 200) {quest::selfcast(2570);}
if ($platinum = 50) {quest::selfcast(1693);}
if ($platinum = 20) {quest::selfcast(174);}
if ($platinum = 400) {quest::selfcast(1710);}
if ($platinum = 300) {quest::selfcast(1729);}
if ($platinum = 60) {quest::selfcast(10);}
if ($platinum = 30) {quest::selfcast(39);}
}
|
ok. one more time.
in each IF statement, he is ASSIGNING the value to $platinum, not testing for equivalence. in PERL, assignment always evaluates to true, unless the RHS is zero, undef, null, or eof.
SO, every IF statement evaluates to true, and, thus, the buffbott casts everything. there's no need for elsif's. all he needs to do is change "if( $variable = some_value)" to the correct form of "if( $variable == some_value )"
this concludes PERL 101, please take a blue book and exam guide. grades will be posted at the end of the semester.
== sfisque