EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   Help with Perl script (https://www.eqemulator.org/forums/showthread.php?t=14509)

nilar 06-22-2004 07:45 PM

Help with Perl script
 
Can anyone tell me whats wrong with this script? The second sub Event_Say and the sub Event_Attack work but I can't get the first sub Event_say to work.

Code:

sub EVENT_SAY(){
  if ($text=~/Hail/i){quest::say("Hello there $name. I am the Avatar of Anarchy. If you are wishing to turn to the dark side, I can call upon Cazic Thule to free you from the chains of order. This will convert you into a Player Killer who can kill and be killed by other Player Killers. Do you wish to [convert]?");  }
}
sub EVENT_SAY(){
  if ($text=~/convert/i){quest::say("Very well then $name. Bring Anarchy upon this world!"); quest::pvp("on");  }
}
sub EVENT_ATTACK(){
  quest::shout("FOOL! You have dug your own grave!");
}


red1234 06-22-2004 08:25 PM

Both 'if' statements should be in one EVENT_SAY I believe.

Syntax looks right for the first 'if' statement, too.

KhaN 06-22-2004 08:30 PM

Code:

sub EVENT_SAY
{
 if ($text=~/Hail/i)
 {
  quest::say("Hello there $name. I am the Avatar of Anarchy. If you are wishing to turn to the dark side, I can call upon Cazic Thule to free you from the chains of order. This will convert you into a Player Killer who can kill and be killed by other Player Killers. Do you wish to [convert]?");
 }
 if ($text=~/convert/i)
 {
  quest::say("Very well then $name. Bring Anarchy upon this world!");
  quest::pvp("on");
 }
}
sub EVENT_ATTACK
{
 quest::shout("FOOL! You have dug your own grave!");
}


animepimp 06-23-2004 01:03 AM

You're not allowed to have two subs with the same name. The program is reaching that second one, finding an error and quiting.

nilar 06-23-2004 05:47 AM

Ah alright I've been using QST which allowed more than one Event_Say. Thanks guys


All times are GMT -4. The time now is 04:28 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.