$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 |
This is pure perl language. Answer to first is yes, and to second ... i wouldn't be able to explain :oops:
You'll get all answers in http://aspn.activestate.com/ASPN/doc...perlintro.html documentation |
K thanks man!
|
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
|
Code:
if ($text=~ /Hail/i)($ulevel=>10){quest::say("Hello $name") Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name") |
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") Code:
if ($text=~ /Hail/i && $ulevel >= 10){quest::say("Hello $name");} |
k thanks
|
Quote:
|
All times are GMT -4. The time now is 04:52 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.