EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Perl Script Question (https://www.eqemulator.org/forums/showthread.php?t=40117)

jpyou127 10-19-2015 10:49 AM

Perl Script Question
 
How do I do an or statement here:

if($wp eq 55) {
quest::SetRunning(1);
}


My attempt:
if($wp eq 55) or ($wp eq 117) {
quest::SetRunning(1);
}


Celestial

NatedogEZ 10-19-2015 10:55 AM

When comparing numbers make sure to use ==
When comparing strings is when you use eq

When doing an OR its ||

Code:

if($wp == 55 || $wp == 117) {
quest::SetRunning(1);
}


jpyou127 10-19-2015 11:01 AM

Thank you sir! Slowly learning a little Perl =)


Celestial

jpyou127 10-19-2015 11:33 AM

One more question. Would I call AddEXP() as a quest function:

quest::AddEXP(500);


Celestial

NatedogEZ 10-19-2015 12:21 PM

Are you using he WIKI?

It really helps for referencing things for people that are learning.

http://wiki.eqemulator.org/p?Ultimat...rence&frm=Main


quest::exp(amount);

or

$client->AddEXP(add_exp, conlevel, resexp);

jpyou127 10-19-2015 03:32 PM

I was using the wiki, but I was not sure in this case to use quest or $client.

I am just learning to script. I appreciate the help!


Celestial

Kayen 10-20-2015 07:38 PM

A lot of quest:: functions are redundant with the $client ect point functions.


All times are GMT -4. The time now is 11:59 AM.

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