SphereCommunity
Random function - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Random function (/Thread-Random-function)

Pages: 1 2 3


RE: Random function - darksun84 - 07-11-2012 04:52 PM

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


RE: Random function - Lazarus - 07-12-2012 03:30 AM

(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?


RE: Random function - Extreme - 07-12-2012 03:33 AM

1º and 2º its ok.
(R1,10) don't work.


RE: Random function - Lazarus - 07-12-2012 03:37 AM

(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


^_^


RE: Random function - Extreme - 07-12-2012 03:47 AM

<RX,Y>
Randoms from X to Y
If you want something like 50 to 100, use <R50,100>


RE: Random function - Lazarus - 07-12-2012 03:50 AM

(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.


RE: Random function - Extreme - 07-12-2012 03:54 AM

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...


RE: Random function - Lazarus - 07-12-2012 04:17 AM

(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!


RE: Random function - Lazarus - 07-12-2012 10:54 AM

(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


RE: Random function - Extreme - 07-12-2012 11:03 AM

(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