The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random function
Author Message
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #11
RE: Random function
It's better you use R1,10 for "clarity", but RAND(10) it's from 0 to 9 !

Just try to do RAND(1) and you'll get always 0 Tongue
(This post was last modified: 07-11-2012 04:54 PM by darksun84.)
07-11-2012 04:52 PM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #12
RE: Random function
(07-11-2012 04:52 PM)darksun84 Wrote:  It's better you use R1,10 for "clarity", but RAND(10) it's from 0 to 9 !

Just try to do RAND(1) and you'll get always 0 Tongue

IF ((<SWORDSMANSHIP> >= 100.0) && (<R1,10>))
Like this?
or:
IF ((<SWORDSMANSHIP> >= 100.0) && <R1,10>)
or:
IF ((<SWORDSMANSHIP> >= 100.0) && (R1,10))

^_^ 1º rly?

[Image: 2hy9q0y.png]
07-12-2012 03:30 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #13
RE: Random function
1º and 2º its ok.
(R1,10) don't work.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-12-2012 03:33 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #14
RE: Random function
(07-12-2012 03:33 AM)Extreme Wrote:  1º and 2º its ok.
(R1,10) don't work.

Extreme, I m falling in love with you Love

hahaha ^_^ thank you very much.

Another question, if i want more randoms in the same script i will use R2?
or still R1?

LIKE:

IF ((<SWORDSMANSHIP> >= 100.0) && (<R1,10>))
SAD
ADSASA

IF ((<FENCING> >= 100.0) && (<R1,10>))

ASDSA
SADSADSA

IF ((<MACE..> >= 100.0) && (<R1,10>))

EFHNEBGFVHAEGF


I think R1 it's the same like =1 in mine script


^_^

[Image: 2hy9q0y.png]
(This post was last modified: 07-12-2012 03:41 AM by Lazarus.)
07-12-2012 03:37 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #15
RE: Random function
<RX,Y>
Randoms from X to Y
If you want something like 50 to 100, use <R50,100>

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-12-2012 03:47 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #16
RE: Random function
(07-12-2012 03:47 AM)Extreme Wrote:  <RX,Y>
Randoms from X to Y
If you want something like 50 to 100, use <R50,100>

But, in this script it's the same take the random from 1 to 10 like the 50 to 60... 10 numbers to random.
^_^ ¿Rly Smile?

If i want 50 % chance i'll take 50 to 100, or 1 to 50.

This will be a nice informative thread for new scripters about the random function.

[Image: 2hy9q0y.png]
07-12-2012 03:50 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #17
RE: Random function
Yes, but you don't need use <R50,60> to do 10%, just use <R1,10>, its best to understand.
If you want 50% use <R1,2>, 33% <R1,3>, 25% <R1,4>, etc...

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-12-2012 03:54 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #18
RE: Random function
(07-12-2012 03:54 AM)Extreme Wrote:  Yes, but you don't need use <R50,60> to do 10%, just use <R1,10>, its best to understand.
If you want 50% use <R1,2>, 33% <R1,3>, 25% <R1,4>, etc...



yepyepyep yeyeppyepyepe =DD==DD

Thanks very much ^_^
we can add a new thread in the SCRIPT HELP to add's all the questions of FUNCTIONS like this ?

^_^ that will be nice and informative Smile

See ya in the forummmm and thanks to all for helping!

[Image: 2hy9q0y.png]
07-12-2012 04:17 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #19
RE: Random function
(07-12-2012 03:54 AM)Extreme Wrote:  Yes, but you don't need use <R50,60> to do 10%, just use <R1,10>, its best to understand.
If you want 50% use <R1,2>, 33% <R1,3>, 25% <R1,4>, etc...


Just to advice: this doesn't works
IF ((<SWORDSMANSHIP> >= 100.0) && <R1,10>)
neither this:
IF ((<SWORDSMANSHIP> >= 100.0) && (<R1,10>))
I don't know why but... doesn't works o.o

[Image: 2hy9q0y.png]
07-12-2012 10:54 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #20
RE: Random function
(07-12-2012 10:54 AM)Lazarus Wrote:  
(07-12-2012 03:54 AM)Extreme Wrote:  Yes, but you don't need use <R50,60> to do 10%, just use <R1,10>, its best to understand.
If you want 50% use <R1,2>, 33% <R1,3>, 25% <R1,4>, etc...


Just to advice: this doesn't works
IF ((<SWORDSMANSHIP> >= 100.0) && <R1,10>)
neither this:
IF ((<SWORDSMANSHIP> >= 100.0) && (<R1,10>))
I don't know why but... doesn't works o.o
Maybe <SRC.SWORDMANSHIP> ?
Or <R1,10> == 1 ?
=D

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-12-2012 11:03 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)