PDA

View Full Version : QUest Problems (Help)


Deimos
09-03-2004, 02:40 PM
Hey all, I am having a huge problem with a quest that won't work for some odd reason. Here it is, thx:

#( Zone:potimea ID:219 -- A_Powerful_Rogue )
sub EVENT_SAY {

if(($text=~/hail/i) && ($class == /rogue) && ($ulevel > 64)){

quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");

else if(($text=~/hail/i) && ($class == /rogue) && ($ulevel < 65))

quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");

else

quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}
if(($text=~/object/i) && ($class == /rogue) && ($ulevel > 64)){

quest::say("This weapon is called the Staff of Flowing
Time and as a Rogue you will have no need for it. I
need it though for that new Thieves Guild. I can't join
it unless I provide it to them to prove my power. I can't
talk Father Time into giving me the staff though. I am
looking for someone to [kill] him. Are you willing?");
}
if(($text=~/willing/i) && ($class == /rogue) && ($ulevel > 64)){

quest::say("I will reward you for bringing me back
his Staff of Flowing Time. It is the One-Handed Blunt
type so make sure you bring me the right one or I am
going to take it for myself. You reward is a special
spear made specifically for a rogue. It can only be
used for rogues. Bring me the staff and I will give
you the spear.");
}
}
sub EVENT_ITEM {

if($itemcount{69250} == 1){

quest::say("Aha! The Staff of Flowing Time! As promissed
here is your spear as promised!");

quest::emote("hands you the spear.");

quest::summonitem(69011);
}
}

#( END of FILE )

Hope someone knows why it wouldn't work =)

animepimp
09-03-2004, 02:55 PM
if(($text=~/hail/i) && ($class == /rogue) && ($ulevel > 64)){

quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");

else if(($text=~/hail/i) && ($class == /rogue) && ($ulevel < 65))

quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");

else

quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}


Its probably becaise you are missing a few {}s here. The elsif and else are insdie the if so the elses have no if to match with which causes problems. Put { after each if or else and } at the end of the code for every one also. And next time you should say what happens when you try it, like what zone.exe says because that'll tell you what is wrong in most cases.

Charmy
09-03-2004, 05:05 PM
Well one of the main problems is how your checking class


($class == /rogue)


i am guessing your trying to do somthing similar to if($text~= /hail/) and using the / becuase of that.

but actually since your only checking the actual value of the vairable $class, you don't need the / char. and actually its even better to use the text operators to check it instead of the numberical ones.

e.g.

if($class eq "Rogue")


So this will check their class and if it eq (equals) the string "Rogue" then its true.

Other than that as AP said check your bracket count make sure that you don't have more { than } and make sure that they are all contained in the correct code blocks, otherwise you will get events going off when you don't want them too.

one thing i think AP said it but not sure, this isn't like BASIC, you need to close a code block before and else statment is produced.

e.g.

if($var1 == 1)
{
do this
}
elsif ($var1 == 2)
{
do this
}
else
{
do this
}


Another thing about perl, you CANNOT use else if, it doesn't compile, you must use the perl term elsif (only one 'E' and no spaces). Add all this into it and it should compile correctly and execute.

since your using perl you can just open a command prompt, naviagte to your eqemu quests directory and (ex. C:\EQEMu\quests\tutorial for tutorial zone) and type at the command prompt


>perl 23.pl

for quest on mob number 23, and it will try to compile, if you get any errors it will tell you what they are and where to fix them, if it doesn't give you any output period it means it compiled correctly and is ready to use =)

Deimos
09-04-2004, 10:29 AM
Tx guys, I fixed the brackets already, but I am going to try the other things, thx. And I dont code in basic, I code in C# and C++, tx

sotonin
09-04-2004, 12:38 PM
perl isnt basic. perl is perl.

Deimos
09-04-2004, 02:13 PM
Hey everyone, the solutions didn't quite work out...
this is what I have now.......

#Zone:
#Short Name: potimea
#Long Name: Plane of Time A
#Zone ID:219

#NPC:
#NPC Name: A Powerful Rogue
#NPC ID: 281268

#-----------------------------------------------------------------------------------
sub EVENT_SAY
{
#HAILING HAILING HAILING HAILING HAILING HAILING HAILING HAILING HAILING HAILING
if(($text=~/hail/i) && ($class eq "Rogue") && ($ulevel > 64))
{
{
quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");
}
elsif(($text=~/hail/i) && ($class eq "Rogue") && ($ulevel < 65))
{
quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");
}
else
{
quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}
}
#OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT OBJECT
if(($text=~/object/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("This weapon is called the Staff of Flowing
Time and as a Rogue you will have no need for it. I
need it though for that new Thieves Guild. I can't join
it unless I provide it to them to prove my power. I can't
talk Father Time into giving me the staff though. I am
looking for someone to [kill] him. Are you willing?");
}
#KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL KILL
if(($text=~/kill/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("I will reward you for bringing me back
his Staff of Flowing Time. It is the One-Handed Blunt
type so make sure you bring me the right one or I am
going to take it for myself. You reward is a special
spear made specifically for a rogue. It can only be
used for rogues. Bring me the staff and I will give
you the spear.");
}
}

sub EVENT_ITEM {

if($itemcount{69250} == 1)
{

quest::say("Aha! The Staff of Flowing Time! As promissed
here is your spear as promised!");

quest::emote("hands you the spear.");

quest::summonitem(69011);
}
}

#( END of FILE )


pwz help, lol

m0oni9
09-04-2004, 02:43 PM
Pay closer attention to where you are putting your brackets. Look at Charmy's example above. Also, you might want to try something like this to eliminate duplicate code (untested):

if ($text =~ /hail/i)
{
if ($class eq "Rogue")
{
if ($ulevel > 64)
{
quest::say ("you're over 64!");
}
else
{
quest::say ("you're not over 64!");
}
}
else
{
quest::say ("begone! you're not a rogue!");
}
}

Also, if you do not know what is causing a problem with your perl, run it with perl, rather than through the emu!

Richardo
09-04-2004, 03:07 PM
Ok I took a look at your quest and I dont get any compile errors with this format.. May work, may not...

sub EVENT_SAY
{
if(($text=~/hail/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");
}
elsif(($text=~/hail/i) && ($class eq "Rogue") && ($ulevel < 65))
{
quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");
}
else
{
quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}
}

if(($text=~/object/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("This weapon is called the Staff of Flowing
Time and as a Rogue you will have no need for it. I
need it though for that new Thieves Guild. I can't join
talk Father Time into giving me the staff though. I am
looking for someone to [kill] him. Are you willing?");
}


if(($text=~/kill/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("I will reward you for bringing me back
his Staff of Flowing Time. It is the One-Handed Blunt
type so make sure you bring me the right one or I am
going to take it for myself. Your reward is a special
spear made specifically for a rogue. It can only be
used for rogues. Bring me the staff and I will give
you the spear.");
}

sub EVENT_ITEM
{

if($itemcount{69250} == 1)
{

quest::say("Aha! The Staff of Flowing Time! As promissed
here is your spear!");

quest::emote("hands you the spear.");

quest::summonitem(69011);
}

Cisyouc
09-04-2004, 03:34 PM
Ok I took a look at your quest and I dont get any compile errors with this format.. May work, may not...

sub EVENT_SAY
{
if(($text=~/hail/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");
}
elsif(($text=~/hail/i) && ($class eq "Rogue") && ($ulevel < 65))
{
quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");
}
else
{
quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}
}

if(($text=~/object/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("This weapon is called the Staff of Flowing
Time and as a Rogue you will have no need for it. I
need it though for that new Thieves Guild. I can't join
talk Father Time into giving me the staff though. I am
looking for someone to [kill] him. Are you willing?");
}


if(($text=~/kill/i) && ($class eq "Rogue") && ($ulevel > 64))
{
quest::say("I will reward you for bringing me back
his Staff of Flowing Time. It is the One-Handed Blunt
type so make sure you bring me the right one or I am
going to take it for myself. Your reward is a special
spear made specifically for a rogue. It can only be
used for rogues. Bring me the staff and I will give
you the spear.");
}

sub EVENT_ITEM
{

if($itemcount{69250} == 1)
{

quest::say("Aha! The Staff of Flowing Time! As promissed
here is your spear!");

quest::emote("hands you the spear.");

quest::summonitem(69011);
} whats this 'eq'? isnt it '=='?

Also instead of using:sub EVENT_SAY
{
if(($text=~/hail/i) && ($ulevel >= 64))
{
quest::say("");
}
}

TRY:sub EVENT_SAY
{
if($text=~/hail/i)
{
if($ulevel >= 64)
{
if($class == "Rogue")
{
quest::say("");
}
}
}
}

Deimos
09-04-2004, 04:57 PM
I think it should work now, I can't wait to test it. I do not own my own server and can't install PERL, so I can't test it until other guy comes on =D. This is now what it looks like =).


###################################
#Zone: #
#Short Name: potimea #
#Long Name: Plane of Time A #
#Zone ID:219 #
###################################
#NPC: #
#NPC Name: A Powerful Rogue #
#NPC ID: 281268 #
###################################
sub EVENT_SAY
{
################################################## #############
if($text=~/hail/i)
{
if($class == "Rogue")
{
if($ulevel > 64)
{
quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");
}
else
{
quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");
}
}
else
{
quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}
}
################################################## #############
if($text=~/object/i)
{
if($class == "Rogue")
{
if($ulevel > 64)
{
quest::say("This weapon is called the Staff of Flowing
Time and as a Rogue you will have no need for it. I
need it though for that new Thieves Guild. I can't join
it unless I provide it to them to prove my power. I can't
talk Father Time into giving me the staff though. I am
looking for someone to [kill] him. Are you willing?");
}
}
}
################################################## #############
if($text=~/kill/i)
{
if($class == "Rogue")
{
if($ulevel > 64)
{
quest::say("I will reward you for bringing me back
his Staff of Flowing Time. It is the One-Handed Blunt
type so make sure you bring me the right one or I am
going to take it for myself. Your reward is a special
spear made specifically for a rogue. It can only be
used for rogues. Bring me the staff and I will give
you the spear.");
}
}
}
}

sub EVENT_ITEM
{
################################################## #############
if($itemcount{69250} == 1)
{

quest::say("Aha! The Staff of Flowing Time! As promissed
here is your spear!");

quest::emote("hands you the spear.");

quest::summonitem(69011);
}
}

#( END of FILE )

Charmy
09-04-2004, 05:48 PM
Cisyouc == is a numerical operator, it isn't good programming practice to use it when operating with strings, when you use the == it can have a similar effect as using atoi in C++ in which it turns a string into a number, this can, although not very often, cause errors if you have a complex script.

when working with strings you should always use the string comparison operators.

eq equals
ne not equals

From http://www-cgi.cs.cmu.edu
eq
String equality (== is numeric equality). For a mnemonic just think of "eq" as a string. (If you are used to the awk behavior of using == for either string or numeric equality based on the current form of the comparands, beware! You must be explicit here.)

two basic ones, there is a greater than and less than, but i don't see much use for them in these types of quests.

perl is a rather loose language and as such you won't get compilation errors when using == but as i said, it can cause errors in complex scripts, and as such you should use eq over ==.

Cisyouc
09-04-2004, 06:25 PM
Cisyouc == is a numerical operator, it isn't good programming practice to use it when operating with strings, when you use the == it can have a similar effect as using atoi in C++ in which it turns a string into a number, this can, although not very often, cause errors if you have a complex script. Ah, very well then. Thanks for the clarification. :D

smogo
09-05-2004, 01:03 AM
perl is a rather loose language and as such you won't get compilation errors
No, perl is not loose :)

It makes perfect sense to write $string1==$string2, it means 'are they the same scalar object ?' , that's why you get no error.

Testing string for equalty requires the eq operator
Testing for identity requires ==


***edit ***
if what's above is not clear, it means if you want to know if two string have the same value, use eq

just my 2 coppers ;)

Charmy
09-05-2004, 11:52 AM
I can't argue with smogo on the equality operators, i learned that you should always use the text comparison operators when working with strings but <shrug>, but smogo knows more about perl than i will probably ever know., however i still stand by the fact that perl is 'loose' =P you don't have to define variable types, arrays and hashes can be filled with int, chars, strings all in the same array, unlike many other C languages. I am not saying its a weak language, infact i think perl is the best you can use for web/networking apps, but it isn't a "strict" language.

Ya?

Deimos
09-05-2004, 02:49 PM
Well, I am not arguing with Smogo either. I tried eq and it didn't work, the last thing I am going to try is ==, then I dont know what to do, hehe. This is what the code is looking like now:


#########################################
#Zone: #
#Short Name: potimea #
#Long Name: Plane of Time A #
#Zone ID:219 #
#########################################
#NPC: #
#NPC Name: A Powerful Rogue #
#NPC ID: 281268 #
#########################################
sub EVENT_SAY
{
################################################## #############
if($text=~/hail/i)
{
if($class == "Rogue")
{
if($ulevel > 64)
{
quest::say("The Plane of Time is a dangerous place.
In this plane is the Father of Time himself. We all
call him Father Time. He has a weapon I would really
love to get my hands on and if you are up to it you
could maybe get this [object] I am in need of.");
}
else
{
quest::emote("stares at you knowing that you can
server a purpose for her but that you are not yet
powerful enough to do it.");
}
}
else
{
quest::say("I will only speak with those who have chosen
the same path as me. Begone!");
}
}
################################################## #############
if($text=~/object/i)
{
if($class == "Rogue")
{
if($ulevel > 64)
{
quest::say("This weapon is called the Staff of Flowing
Time and as a Rogue you will have no need for it. I
need it though for that new Thieves Guild. I can't join
it unless I provide it to them to prove my power. I can't
talk Father Time into giving me the staff though. I am
looking for someone to [kill] him. Are you willing?");
}
}
}
################################################## #############
if($text=~/kill/i)
{
if($class == "Rogue")
{
if($ulevel > 64)
{
quest::say("I will reward you for bringing me back
his Staff of Flowing Time. It is the One-Handed Blunt
type so make sure you bring me the right one or I am
going to take it for myself. Your reward is a special
spear made specifically for a rogue. It can only be
used for rogues. Bring me the staff and I will give
you the spear.");
}
}
}
}

sub EVENT_ITEM
{
################################################## #############
if($itemcount{69250} == 1)
{

quest::say("Aha! The Staff of Flowing Time! As promissed
here is your spear!");

quest::emote("hands you the spear.");

quest::summonitem(69011);
}
}

#( END of FILE )

Deimos
09-10-2004, 09:59 AM
Hey everyone, it still doesn't work. Right now I am asking the host of the server to check the different functions and see if class is a function. I do not see anything wrong with the code. Getting 0 running errors when I run it, 0 syntax. It is probably him, because I don't see anything wrong, hehe.

Is there anything wrong with the above code to not make it work?

killspree
09-10-2004, 03:50 PM
I can tell you one problem with it:

it's quest::me not quest::emote - that may be the culprit.

Cisyouc
09-10-2004, 03:53 PM
I can tell you one problem with it:

it's quest::me not quest::emote - that may be the culprit.quest::emote is a command.

"sub emote{push(@cmd_queue,{func=>'emote',args=>join(',',@_)});}"

killspree
09-10-2004, 04:08 PM
I just tossed it up on my server to test it out and got this:

[Status] WARNING: error compiling quest file quests/freportw/92.pl: Perl runtime
error: Missing right curly or square bracket at (eval 613) line 90, at end of l
ine
syntax error at (eval 613) line 90, at EOF
(reverting to default questfile)

Edit: Removed the # End of File and it worked fine with $class eq "Rogue"

Deimos
09-10-2004, 04:50 PM
Well, hehe, so, the #(END of FILE) should not make a difference at all. # comments out the line, so that doesn't matter, just tells soemone who is reading it the files has ended. Also, eq "Rogue" does not work for me, nor does ==. I still don't see anything wrong with it that I have already tried =|. If anyone can find anything, that would be a great help. Thank you guys for helping out thus far though, woulda never made it to this point without you all =).

killspree
09-10-2004, 05:09 PM
Well I'm telling you exactly how I got it to work. Prior to that it gave compile errors, removing the # End of File made it work perfectly.

How about you try that. :P

Deimos
09-11-2004, 03:10 AM
Ok, lol, I will try it =P. I dont see how it would make it work, but I guess I might as well try, lol.