Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2004, 11:00 AM
ryder911
Hill Giant
 
Join Date: Jun 2002
Posts: 212
Default $ulevel question

Can $ulevel be used with a number. Like $ulevel => 10? then player would have to be greater then 10 to do the quest?

And when using $ulevel in a quest sitution would it look like this?

if ($text=~ /Hail/i)($ulevel=>10){quest::say("Hello $name")


and another question, sorry for being a noob lol, but Wat is difference between { and ( im not sure when to use which. What does each do / stand for

Thanks any help or tips is appreciated
__________________
Chris---
Reply With Quote
  #2  
Old 03-24-2004, 11:36 AM
smogo
Discordant
 
Join Date: Jan 2004
Location: 47
Posts: 339
Default

This is pure perl language. Answer to first is yes, and to second ... i wouldn't be able to explain

You'll get all answers in http://aspn.activestate.com/ASPN/doc...perlintro.html
documentation
Reply With Quote
  #3  
Old 03-24-2004, 11:47 AM
ryder911
Hill Giant
 
Join Date: Jun 2002
Posts: 212
Default

K thanks man!
__________________
Chris---
Reply With Quote
  #4  
Old 03-24-2004, 12:07 PM
ryder911
Hill Giant
 
Join Date: Jun 2002
Posts: 212
Default

I found what () are for, but i cant find anything on {} seems like all the guides just skip explaining them lol, It doesn't say anything about it and all of a sudden on the guide it starts using them
__________________
Chris---
Reply With Quote
  #5  
Old 03-25-2004, 04:31 AM
Monrezz's Avatar
Monrezz
Dragon
 
Join Date: Mar 2003
Location: #loc
Posts: 745
Default

Code:
if ($text=~ /Hail/i)($ulevel=>10){quest::say("Hello $name")
should be:

Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name")
I believe ( is for an array, and { the start of the function. A wild guess, though :/
__________________

kRPG Profile
Reply With Quote
  #6  
Old 03-25-2004, 07:07 AM
ndnet
Hill Giant
 
Join Date: Oct 2003
Posts: 105
Default

In general, braces {} are used to block code together, such as:

if(condition){code block to execute}

Parentheses are used for a couple of reasons: 1.) Group together mathematical expressions to control evaluation order (things are evaluated in the parentheses together before things outside, and 2.) Enclosing the arguments of a function.

Quick examples of each.

1.) Controlling the order in which expressions are evaluated.

1 + 5 / 7 = 12/7 = ~1.714
but
(1+5) / 7 = 6/7 = ~0.857

2.) Passing arguments to a function

quest::say("Hello $name");

quest::say() is a function that takes an argument, your string there, which is passed by enclosing it in parentheses.

Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name")
should probably be:

Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name");}
Should end lines with semicolons. Also good practice to keep watch of what braces {} and parentheses () you open to make sure you close them later.
Reply With Quote
  #7  
Old 03-26-2004, 02:42 PM
ryder911
Hill Giant
 
Join Date: Jun 2002
Posts: 212
Default

k thanks
__________________
Chris---
Reply With Quote
  #8  
Old 03-26-2004, 11:36 PM
Monrezz's Avatar
Monrezz
Dragon
 
Join Date: Mar 2003
Location: #loc
Posts: 745
Default

Quote:
Originally Posted by ndnet
Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name")
should probably be:

Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name");}
Oooops, didn't see that. Just quoted and corrected the beginning. Nice spot :P
__________________

kRPG Profile
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:26 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3