mIRC Home    About    Download    Register    News    Help

Print Thread
#140322 24/01/06 01:26 PM
Joined: Jan 2006
Posts: 19
E
Pikka bird
OP Offline
Pikka bird
E
Joined: Jan 2006
Posts: 19
writeini $2 $+ .chr $2 expgained $rand($calc($readini($2 $+ .chr,$2,luck), $readini($2 $+ .chr,$2,hp)))
writeini $2 $+ .chr $2 moneygained $rand($calc($readini($2 $+ .chr,$2,luck), $readini($2 $+ .chr,$2,hp)))

i get the error: * Too few parameters: $rand (line 195, script.ini)

any idea why this is happening?

Last edited by evidence22; 24/01/06 01:54 PM.
#140323 24/01/06 03:05 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
$rand takes two parameters, and it will return a character in between the range of these two parameters.

$rand(0,9) --> number between 0 and 9
$rand(a,z) --> letter between a and z
$rand(!,.) --> character between ! and .

etc.


Gone.
#140324 24/01/06 03:05 PM
Joined: Mar 2004
Posts: 21
Ameglian cow
Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
hello evidence22,

Why do you use $calc() in $rand ?

* $rand() has to be used like that : $rand(N1,N2)

In your code, you have N1 = $calc($readini($2 $+ .chr,$2,luck), $readini($2 $+ .chr,$2,hp)) and no N2.

* $calc() is used to return result of calculs, e.g: $calc(N1 operator N2). Here, you have $calc(N1,N2) . No meaning.

So, you used $calc() for nothing.

Try $rand(N1,N2) with N1 = $readini($2 $+ .chr,$2,luck) et N2 = $readini($2 $+ .chr,$2,hp)


-Be cool with my English-
irc.EpiKnet.org:#scripts
#140325 24/01/06 03:46 PM
Joined: Jan 2006
Posts: 19
E
Pikka bird
OP Offline
Pikka bird
E
Joined: Jan 2006
Posts: 19
ty worked it out just did a variable


Link Copied to Clipboard