PDA

View Full Version : .pl??


nadr man
06-11-2004, 11:14 AM
hey! just got perl installed and everything working, but i logged into my server to find that my quests don't work. Lemme explain my setup..

my everquest directory (my client) is located in D:\Everquest. My Server is at D:\Server-EqEmu. Within D:\Server-EqEmu i have 3 folders. One is D:\Server-EqEmu\Eqemu (this has the world.exe, zone.exe, ect. files). One is D:\Server-EqEmu\mysql (holds the db stuff). And the other is D:\Server-EqEmu\perl (holds perls stuff).

In D:\Server-EqEmu\Eqemu i put the perl58.pl file, but deleted it due to it crashing the zone.exe files. I also put a plugin.pl in this folder...i read this plugin.pl sends the quests to the server (not sure if the plugin.pl is causing a problem, it was sent to me...not sure if i need to edit more than the server name..).

Thing is the quests aren't working. Perl is installed. IO::Scaler is installed. and my quests are in D:\Sever-Eqemu\EQEmu\$EQEmuDir$\Quests. I was unsure why i needed to name the folder $EQEmuDir$, but was told to do so in another post describing the perl system. I have a quest called default.pl in my nexus folder to set the quest for the zone just to test it...

#default.pl
#test quest to make sure quests are working
sub EVENT_SAY {
if($text=~/Hail/i){quest::say("Shhh... I am trying to test out questing!");}
}

simple hail quest.

My zone window:

[Status] CURRENT_ZONE_VERSION: EQEMu 0.5.7-DR3
[Status] Loading Variables
[Status] Loading zone names
[Status] Loading items
[Status] EMuShareMem loaded
[Status] Loading npcs
[Status] Loading npc faction lists
[Status] Loading loot tables
[Status] Loading doors
[Status] Loading guilds
[Status] Loading factions
[Status] Loading corpse timers
[Status] Loading what ever is left
[Status] Loading commands
[Status] command_init(): Warning: Command 'help' defaulting to access level 0!
[Status] command_init(): Warning: Command 'version' defaulting to access level 0
!
[Status] command_init(): Warning: Command 'serversidename' defaulting to access
level 0!
[Status] command_init(): Warning: Command 'loc' defaulting to access level 0!
[Status] command_init(): Warning: Command 'flag' defaulting to access level 0!
[Status] command_init(): Warning: Command 'si' defaulting to access level 0!
[Status] 163 commands loaded
[Status] Loading embedded perl
[Status] Loading perlemb plugins.
[Status] Entering sleep mode
Connected to worldserver: 127.0.0.1:9000


Shows that perl is enabled...

Lastly, i put .pl after my quests (example: 183017.pl would be a filename), but the document itself stays as a text file. I would think it would be a perl file...but either there's something wrong with plugin.pl or there's something wrong with my file setup.

Any help would be great.


command promt:

i enter perl -MCPAN -e shell

i get this:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Mark>perl -MCPAN -e shell
Terminal does not support AddHistory.

There seems to be running another CPAN process (pid 1612). Contacting...
Other job not responding. Shall I overwrite the lockfile? (Y/N) [y] y

cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support available (try 'install Bundle::CPAN')

cpan>

thinking that's suppose to happen, i enter install IO::Scaler, i get this:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Mark>perl -MCPAN -e shell
Terminal does not support AddHistory.

There seems to be running another CPAN process (pid 3872). Contacting...
Other job not responding. Shall I overwrite the lockfile? (Y/N) [y]

cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support available (try 'install Bundle::CPAN')

cpan> install IO::Scalar
CPAN: Storable loaded ok
Going to read \.cpan\Metadata
Database was generated on Fri, 11 Jun 2004 19:35:49 GMT
IO::Scalar is up to date.

cpan>

plugin.pl:

$SERVER="Nads_test_area";
$version="0.0.1";

@remove=("job","mrace","interest","guild");


#this is the main controller routine for default quests
sub dispatch{
my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(1);

#$debug && quest::say("[debug]in dispatch");
#$debug && quest::say("[debug] package : $pack");
#$debug && quest::say("[debug] subroutine : $subr");

#get all variables in caller's scope
# first, we want to cleanup what was set by previous call
undef $job;
undef $interest;
undef $guild;
undef $mrace;
#$debug=0;

no strict 'refs';
my $package;
($package=$subr) =~ s/::\w+// ;
my $stash = *{$package . '::'}{HASH};
my $n;

foreach $old (@remove){
defined ${$old} && eval { "undef $package"."::"."$old"};
}
foreach $n (keys %$stash) {
my $fullname = $package . '::' . $n;
if( defined $$fullname){
$$n=${$fullname};
# potentially unsafe, don't do :push(@remove,$n); for the moment

#uncomment to get report of what is available
#quest::say("$n -> $$n (eqiv to $fullname)\n");
}
}

$debug && quest::say("checking event");

#this looks for the correct routine to use, based on l=globals and event type
if(defined $subr){
my $event;
if($subr =~ /EVENT_SAY/) { $event="say";}
if($subr =~ /EVENT_SLAY/) { $event="slay";}
if($subr =~ /EVENT_DEATH/) { $event="death";}
if($subr =~ /EVENT_SPAWN/) { $event="spawn";}
if($subr =~ /EVENT_ITEM/) { $event="item";}
if($subr =~ /EVENT_ATTACK/) { $event="attack";}
if($subr =~ /EVENT_WAYPOINT/) { $event="waypoint";}

#now lookup the routine, and return after first match.
#the following assumes npc have a $job, $mrace and $guild global
# This is where precedence takes place :
# first look for an interest oriented event, then a job oriented match,
# then race dependant, then guild ...
# whatever you set as a global category for the mob
# If guild behaviour is more important (or more specific)
# than race or job, for example, move the line up.
# zone usually comes last, as it allows to reproduce the genuine
# 'default.pl' behavior.
# returning ensures you don't get 2,3 or 4 answers for an event

#$debug && showvars();
#$debug && showfuncs();
defined $interest && defined &{"$interest$event"} && &{"$interest$event"} && return;
defined $job && defined &{"$job$event"} && &{"$job$event"} && return;
defined $mrace && defined &{"$mrace$event"} && &{"$mrace$event"} && return;
defined $guild && defined &{"$guild$event"} && &{"$guild$event"} && return;

#eventually revert to the standard per-zone default.pl
defined &{"$zonesn$event"} && &{"$zonesn$event"} && return;

# we came here if there was no match (i.e. no specific routine
# for that event)
# do nothing then ? or ...
defined &{"default$event"} && &{"default$event"} && return;
}

#we very unlucky to get here
}


sub showvars{
my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(1);
#get all variables in caller's scope
no strict 'refs';
my $package;
($package=$subr) =~ s/::\w+// ;
my $stash = *{$package . '::'}{HASH};
my $n;
foreach $n (sort keys %$stash) {
my $fullname = $package . '::' . $n;
if( defined $$fullname){
$$n=${$fullname};
#uncomment to get report of what is available
quest::say("$n -> $$n (eqiv to $fullname)");
}else{
#defined &$fullname && quest::say("function $fullname is defined");
if(defined @$fullname){
quest::say(" list \@$fullname : (". join(",",@$fullname) . ")");
}
if(defined %$fullname){
quest::say(" hash \%$fullname : (");
foreach $k ( keys %$fullname){
quest::say(" $k => ${fullname}->{$k} ");
}
quest::say(")");
}
}

}
}

sub showfuncs{
my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(1);
#get all variables in caller's scope
no strict 'refs';
my $package;
($package=$subr) =~ s/::\w+// ;
my $stash = *{$package . '::'}{HASH};
my $n;
foreach $n (sort keys %$stash) {
my $fullname = $package . '::' . $n;
defined &$fullname && quest::say("function $fullname is defined");
}
}

#print "starting plugin for $SERVER\n";



Thanks.

Dave987
06-11-2004, 11:28 AM
You dont need to name your EQEmu folder $EQEmuDir$ . That was just meaning whatever your EQEmu folder is called.

For example, I might have a quest in

C:\EQEmu\quests\default.pl

Make sure yours are in something like
D:\Server-EqEmu\EQemu\quests\default.pl

This should fix yout problem.

m0oni9
06-11-2004, 11:37 AM
Thing is the quests aren't working. Perl is installed. IO::Scaler is installed. and my quests are in D:\Sever-Eqemu\EQEmu\$EQEmuDir$\Quests. I was unsure why i needed to name the folder $EQEmuDir$, but was told to do so in another post describing the perl system. I have a quest called default.pl in my nexus folder to set the quest for the zone just to test it...
$EQEmuDir$ represents your EQEmu directory. For instance, if I run emu from C:\EQEmu, my quests directory will be named C:\EQEmu\quests.

Within this "quests" directory you may create a subdirectory for each zone (ie: feerrott, nexus, potimeb, etc.). You may also place a default.pl file in this directory. Inside each of these zone subdirectories, you may have a perl file for any NPC type that is loaded in that zone.

You may have a structure like the following:

C:\EQEmu\quests\default.pl
C:\EQEmu\quests\nexus\2019.pl
C:\EQEmu\quests\nexus\152013.pl
C:\EQEmu\quests\feerrott\47003.pl
etc..

nadr man
06-11-2004, 11:44 AM
well, i did the D:\Server-EqEmu\eqemu\quests...but still quests don't work.

i'm assuming there's something wrong with perl. Any other ideas would be great.

cofruben
06-12-2004, 06:18 AM
try another event,like spawn_death and then kill a mob,see if that triggers.

EVENT_DEATH
{
quest::shout("test");
}

nadr man
06-17-2004, 02:53 AM
nothing works. When i did #reloadquest (or something along those lines) i got "clearing .qst cashe"...i'm wondering if the server's not compiled correctly.

cofruben
06-17-2004, 08:12 AM
#reloadquest is for .qst format I think,reload for PL is not implemented.

nadr man
06-17-2004, 08:38 AM
Well, i just did 2 things.

1. I reinstalled perl -- it went in fine.
2. I downloaded quests from quests.eqemulator.net.

At this point, those downloaded quests don't work. Atm i think it's my plugin.pl causing my problem. I'm using the plugin.pl from The Lazy Perl Quest Writer stickied in this forum.

it looks like this:


$SERVER="Khalzed-dur";
$version="0.0.1";

@remove=("job","mrace","interest","guild");


#this is the main controller routine for default quests
sub dispatch{
my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(1);

#$debug && quest::say("[debug]in dispatch");
#$debug && quest::say("[debug] package : $pack");
#$debug && quest::say("[debug] subroutine : $subr");

#get all variables in caller's scope
# first, we want to cleanup what was set by previous call
undef $job;
undef $interest;
undef $guild;
undef $mrace;
#$debug=0;

no strict 'refs';
my $package;
($package=$subr) =~ s/::\w+// ;
my $stash = *{$package . '::'}{HASH};
my $n;

foreach $old (@remove){
defined ${$old} && eval { "undef $package"."::"."$old"};
}
foreach $n (keys %$stash) {
my $fullname = $package . '::' . $n;
if( defined $$fullname){
$$n=${$fullname};
# potentially unsafe, don't do :push(@remove,$n); for the moment

#uncomment to get report of what is available
#quest::say("$n -> $$n (eqiv to $fullname)\n");
}
}

$debug && quest::say("checking event");

#this looks for the correct routine to use, based on l=globals and event type
if(defined $subr){
my $event;
if($subr =~ /EVENT_SAY/) { $event="say";}
if($subr =~ /EVENT_SLAY/) { $event="slay";}
if($subr =~ /EVENT_DEATH/) { $event="death";}
if($subr =~ /EVENT_SPAWN/) { $event="spawn";}
if($subr =~ /EVENT_ITEM/) { $event="item";}
if($subr =~ /EVENT_ATTACK/) { $event="attack";}
if($subr =~ /EVENT_WAYPOINT/) { $event="waypoint";}

#now lookup the routine, and return after first match.
#the following assumes npc have a $job, $mrace and $guild global
# This is where precedence takes place :
# first look for an interest oriented event, then a job oriented match,
# then race dependant, then guild ...
# whatever you set as a global category for the mob
# If guild behaviour is more important (or more specific)
# than race or job, for example, move the line up.
# zone usually comes last, as it allows to reproduce the genuine
# 'default.pl' behavior.
# returning ensures you don't get 2,3 or 4 answers for an event

#$debug && showvars();
#$debug && showfuncs();
defined $interest && defined &{"$interest$event"} && &{"$interest$event"} && return;
defined $job && defined &{"$job$event"} && &{"$job$event"} && return;
defined $mrace && defined &{"$mrace$event"} && &{"$mrace$event"} && return;
defined $guild && defined &{"$guild$event"} && &{"$guild$event"} && return;

#eventually revert to the standard per-zone default.pl
defined &{"$zonesn$event"} && &{"$zonesn$event"} && return;

# we came here if there was no match (i.e. no specific routine
# for that event)
# do nothing then ? or ...
defined &{"default$event"} && &{"default$event"} && return;
}

#we very unlucky to get here
}


sub showvars{
my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(1);
#get all variables in caller's scope
no strict 'refs';
my $package;
($package=$subr) =~ s/::\w+// ;
my $stash = *{$package . '::'}{HASH};
my $n;
foreach $n (sort keys %$stash) {
my $fullname = $package . '::' . $n;
if( defined $$fullname){
$$n=${$fullname};
#uncomment to get report of what is available
quest::say("$n -> $$n (eqiv to $fullname)");
}else{
#defined &$fullname && quest::say("function $fullname is defined");
if(defined @$fullname){
quest::say(" list \@$fullname : (". join(",",@$fullname) . ")");
}
if(defined %$fullname){
quest::say(" hash \%$fullname : (");
foreach $k ( keys %$fullname){
quest::say(" $k => ${fullname}->{$k} ");
}
quest::say(")");
}
}

}
}

sub showfuncs{
my($pack, $filename, $line, $subr, $has_args, $want_array)=caller(1);
#get all variables in caller's scope
no strict 'refs';
my $package;
($package=$subr) =~ s/::\w+// ;
my $stash = *{$package . '::'}{HASH};
my $n;
foreach $n (sort keys %$stash) {
my $fullname = $package . '::' . $n;
defined &$fullname && quest::say("function $fullname is defined");
}
}

#print "starting plugin for $SERVER\n";



This plugin.pl looks like it's made to call 4 categories (job,mrace,interest,guild). From the point of a perl-idiot, this looks like it could be the problem. If this plugin.pl is incorrect, could someone post the contents of theirs?

Sakrateri
06-18-2004, 11:50 PM
Ok , I have everything installed correctly and had no errors on doing it , But when I boot 5 zones it never shows perl enabled, Please help ! i want some quests ...... :(



EDIT : Damn im sorry , I meant to put this is a different thread , I had to many windows open and got confused

nadr man
06-19-2004, 12:39 AM
in the source code you need to enable perl

Sakrateri
06-19-2004, 07:43 AM
Ok i got perl enabled now and it says it on my zones "Loading embedded Perl " but not the second line" Loading perlemb plugins"
any suggestions? and thanks for the help :)

nadr man
06-19-2004, 07:54 AM
do you have a quests folder or any .pl files in your eqemu folder?

Sakrateri
06-19-2004, 11:19 AM
I have plugin.pl in the eqemu folder and quests in a quest folder and i also have a plugin folder with plugin.pl in that .....not sure how that folder got there