EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   Noob Perl user (https://www.eqemulator.org/forums/showthread.php?t=16223)

Adh87 10-07-2004 02:21 AM

Noob Perl user
 
Here are some small simple events I have made while being in my Accounting class...any help/suggestions would be appreciated.



Sub EVENT_SAY
{
if ($text=~/Hail/i){quest::say(“Hello, welcome to my world!”);}
}




sub EVENT_SAY
{
if ($text=~ /Hail/i){quest::say("Why hello there mister!");}
}





sub EVENT_SAY
{
if ($text=~/Hail/i){quest::say("When someone is slain…they will return to where their soul has been bound. I can [bind your soul] if you would like.”);}
if ($text=~/bind my soul/i)
{
quest::say(“Binding your soul sir.”);
quest::castspell($userid,2049);
}
}



sub EVENT_SAY
{
if ($text=~/Hail/i){quest::say(“Hello, you look like you could use a [Big Soul Devour]. Would you like one?”);}
if ($text=~/Big Soul Devour/i)
{
quest::say(“Alright give me a minute and I’ll craft ya a knew one!”);
quest::summonitem(11001);}
}








sub EVENT_SAY
{
if ($text=~/Hail/i){quest::say(“Hello there! I am Tunare…mother of the Elves. You look very hot, would you like my forces to [summon a rainstorm]?”);}
if ($text=~/summon a rainstorm/i)
{
quest::rain(1);
quest::say(“There ya go! Cool down a bit.”);}
}

x-scythe 10-07-2004 03:07 AM

try to space out your code
like

Code:

sub EVENT_SAY
{
  if($text=~/what up yo/i)
  {
    quest::say("Nothin much, lets go shoot up some homies!");
  }
}

makes it easier to read and find mistakes

Adh87 10-07-2004 03:26 AM

Alright thanks
 
But so far I'm doing this right?

Malignus Wingnut 10-07-2004 09:20 AM

Yes, what x-scythe said, definitely take it into consideration. As a long time programmer in many languages I know how important it is to space out your code and, as dumb as it sounds, USE COMMENTS. As soon as you make a large quest file...then say you dont look at it for about a month. You then return to edit the file and uh-oh its jumbled and you cant figure out what stuff does! But the syntax of all of your code seems to be correct.


All times are GMT -4. The time now is 07:12 PM.

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