Zone Crash on quest execute.
When i load this script and hand in anything but 100pp zone.exe crashes. any ideas on why? i have a feeling its in
Code:
if(($myplatinum = 100) && ($mygold = 0) && ($mysilver = 0) && ($mycopper = 0)) Code:
sub EVENT_SAY |
Just a thought...
Code:
if(($myplatinum = 100) && ($mygold = 0) && ($mysilver = 0) && ($mycopper = 0)) Code:
if(($myplatinum == 100) && ($mygold == 0) && ($mysilver == 0) && ($mycopper == 0)) |
hmm again i forget how important a syntax is.. strange though, i didn't get any compiling errors when starting zone.exe, however iw ill try this edit and report back to ya =)
|
aswome it worked, thanks, however for some reason when i am giving the item in i still get the message saying i only asked for 100pp so i need to change the code around a bit, hmm anyway thanks for the help =)
What is the syntax for somthing does not equal, like if $variable1 *doesnot equal* 100, how would i do this? perhaps i could make it work for me! |
It is syntavtiavlly correct to do it with jsut = like you had,but it will not do what you want and was crashing because of how you used the single =. != == not equals :)
|
What I always do before putting a quest on , is open a cmd window , go to the directory of quests, and type *.pl
Start > Run > cmd dir EQEmu\quests questname.pl That checks to make sure the quest works ... yummy |
= is the assignment operator, == is the equality operator
It's somewhat common to write: Code:
if(($myplatinum == 100) && ($mygold == 0) && ($mysilver == 0) && ($mycopper == 0)) Code:
if((100 == $myplatinum) && (0 == $mygold) && (0 == $mysilver) && (0 == $mycopper)) Not too sure why it was crashing. Your if-statement should have always evaluated to false, and executed the "quest::givecash($mycopper,$mysilver,$mygold,$mypl atinum);" part, I think. Maybe $mysilver and $mycopper were undef, and passing those back caused the crash? |
I also thought that the code should have evaluated to false. That's why I was unsure if my suggestion would actually fix it since it was (sorta) working.
= assigns a value == checks equality != not equal I agree with M0oni9 - by reversing the variable and value, you can easily make sure that it your code is correct because you can never assign a value to a number. Code:
$mygold = 100 Code:
100 = $mygold I also agree with Dave987 - always run the Perl script from the command line to check for bugs - easier to spot and fix there. About your turn in code: Code:
if($itemcount{18700} && $itemcount{18700} == 1) Code:
if($itemcount{18700} == 1) Anyway, good luck! 8) ~Gandar |
Cool thanks all for the info, it doesn't crash now, only part i am having issue with is i keep getting the msg saying i only want 100pp in plat take back you money when i hand in the item, i am going to try using a statment where if something doesn't equal this, i.e if((100 != $myplatinum)){quest::say("i only want 100pp in Plat only, take back your money); problem is i need to make it so it will ignore any item turn ins, becuase even using this will still return the fact that i am giving him 0 plat and 0 != 100 so... hmm
|
Hmm - another suggestion...
That else at the end seems to be catching everything, including your item turn in (because it's not 100 pp! ) try changing it to elsif. I'm going to load your script onto my Soulbinder and test it pretty quick - I'll let you know if it doesn't work. Wish me luck! :P ~Gandar Edit: Nevermind - I'll still test it, though, and see if I can figure it out - elsif isn't the way to go, I'm not sure what I was thinking |
hehe tried it, got same problem, i need to find a way to make it so it says
Code:
if i give you 100pp Code:
if i give you 100pp then |
I haven't checked the accuracy of this, but the variables ($platinum, etc) may be undefined. If that is true, the following may help you out (replace your current four lines). It will assure that none of the $myMONEY variables are undefined.
Code:
$myplatinum = (defined($platinum) ? $platinum : 0); |
All times are GMT -4. The time now is 12:41 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.