Ryandor.com

Forums
It is currently Thu Mar 28, 2024 9:52 am

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Wed May 10, 2006 9:08 pm 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
Dian wrote:
a poor job of coding. look at the huge length of if statements.. thats typicall of a new scripter, trying to accomplish something complex.. not knowing much of anything about the language.


Yeah, that was what it looked like to me but pretty much being in the same boat as "new scripter.....not knowing much of anything about the language" myself I wasn't about to say it outloud :P

I can see what the random doulbe is for, I just can't see why it is basicly repeated so many times, surely there is a way to accomplish the same effect with less code. It is giving a chance of doing extra damage with slightly different parameters for each....I think. People always seem to forget keep it simple stupid.

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 5:32 am 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Jun 12, 2002 12:13 am
Posts: 414
Location: West Virginia, USA
hehe, well they're all ungodly long, that was just the first one I happened to click on. Anyways, I have nothing bad to say about RunUO as I've never used it myself to get an opinion, but I can honestly say I'd never use it after seeing the length and BS required for anything to be scripted in it. I have way too many scripts to even consider it unfortunately :p

oh, if (rand(100) <= 40) :p


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 8:35 am 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Aug 07, 2003 6:57 am
Posts: 472
The possible UOX3 variants:
Code:
   //Random number from 0 to 1 using javascript's built in math.random function
   var rndValue1 = Math.random();

   //Random number from 1 to 20 using javascript's math functions         
   var rndValue2 = Math.round( 20 * Math.random());
   
   //Random number from 1 to 100 using UOX3-specific method
   var rndValue3 = RandomNumber( 1, 100 );

   //Random number using UOX3's DnD-style dicethrows - in this case 3d6 + 0      
   var rndValue4 = RollDice( 3, 6, 0 );

//And now to do what Rose did:
Code:
   if( rndValue3 > 40 )
   
   //or:
   if( RandomNumber( 1, 100 ) > 40 );
:)

_________________
-= Ho Eyo He Hum =-


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group