Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 12-03-2012, 08:58 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

there are perl tutorials all over the place. it's been around since 1987 and isn't only used in the emulator.

here is the official 5.12.4 introduction.
here is a list of official, categorized 5.12.4 tutorials.

as to the problems with this script, you have an incorrectly placed closing bracket here:

Code:
      if (plugin::check_handin(\%itemcount, 150062 => 1)) {
         quest::say("Well done, $name, you are now level 1 with an upgraded ring.");
         quest::level(1);
         quest::summonitem(150063, 1);
         quest::ding();
      }
            }
additionally, you have two else statements in the same part of your logic chain at the bottom. you can only use one.

finally, you should be using if/elsif statements in your chains, not just if statements. elsif causes the script to stop looking for matches after it finds one. in your script's case, it will continue looking at each condition, even after a match is found.

example:
Code:
sub EVENT_SAY
{
    my $ring = quest::saylink("ring", 1);
    my $one  = quest::saylink("one", 1);

    if($text=~/Hail/i) {
        quest::say("Hand me your $ring and I'll upgrade it, as long as you're Level 65.");
    }
    elsif($text=~/Ring/i) {
        quest::say("Yes, the Ring of Armageddon, do you need $one?");
    }
    elsif($text=~/One/i) {
        quest::say("Here you go, enjoy!");
        quest::summonitem(150009, 1);
    }
}

Last edited by c0ncrete; 12-03-2012 at 09:28 AM.. Reason: added perl tuorial links
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:32 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3