Quest crashing zone and client
I posted earlier about keeping a tally of quests completed. I couldn't figure it out. So I decided to use repetitive if statements and setting the global in each if statement manually. However, It now crashes my client and the zone on the 4th turn in.
Here is the error I get: http://i.imgur.com/lWFi5Ev.jpg Here is the code: Code:
my $luck = quest::saylink("luck"); Also, I tried deleting the global in the last three if statements before resetting it. However, it just got stuck in a loop of setting the value to 1, 2, 1, 2, etc. I deleted my global value for the character and retested it several times with the same results. Also note: Code:
elsif ((defined $qglobals{fish_mort} && $qglobals{fish_mort} == 1)) Thanks in advance! |
*edit: nevermind, let me look again.. you said you made multiple if statements, yet, they are elsifs. Be back, unless someone beats me to the punch.
|
use $name, not %name.
it's crashing because it's trying to use the %n part of '%name' in your last message as a format specifier. |
Well, yeah, I didn't see the %name but that would make sense. Tried helping him, didn't see that. Hehe.
|
always test your scripts from a command line like this to easily catch syntax errors and other such things:
Code:
perl -cW path/to/script.pl |
I use this:
What does the W do? Code:
perl -c path/to/script.pl |
thw W enables all warnings (like telling you that you are using a variable only once)
running this file that way warnMe.pl Code:
$warnMe; Code:
perl -cW warnMe.pl |
Quote:
Quote:
Use google, saves everyone time with trivialities. |
|
As a minor countargument to using google. Asking simple/redundant questions does provide learning opportunities for others. For example I did not know what -W was for :p
|
i'll agree that it's sometimes easier to learn a thing within a certain context (like expected behavior in the game) than through technical documentation. it's easy to learn the basics via reading tutorials, however. then there is no reason to not write short scripts to run outside of the game to determine if your understanding of something is correct or not.
|
Thanks for the suggestions. perl -cW is quite useful. Any one know why I am required to use double parenthesis? Its not a problem for me, but different than others. Maybe it is my version of perl?
Thanks again, everyone. |
take them all out and run -cW again and also check logs if the script won't run.
|
All times are GMT -4. The time now is 12:51 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.