The Last Homely House

General => The Golden Hall => Topic started by: Kralik on November 01, 2008, 09:44:06 AM

Title: Dice Roller
Post by: Kralik on November 01, 2008, 09:44:06 AM
I deleted my original announcement, and then had a problem with my second try... so here it goes again! Third time's the charm...

I was poking around the RPG forum and I noticed that some people were looking for a dice roller. I found one online that I installed, but then I found a purtier one to use. Here's the basic syntax:

Code: [Select]
:dice [# of dice]d[size of dice][sign][modifier]
Some examples (remove the extra space between : and dice):

: dice 5d18:

  Rolling 5d18:   (11+14+16+12+9): Total = 62



: dice 2d9+1:

  Rolling 2d9+1:   (7+8)+1: Total = 16



: dice 4d8-2:

  Rolling 4d8-2:   (4+3+8+4)-2: Total = 17



Note two things:
1) It only works when you post (intentionally not in previews).
2) If you edit your post and/or try to change the dice rolls, it will give you gobbledygook.

Feel free to try it out on this thread. Enjoy! ;D
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 10:09:36 AM
Note: I can't edit the above post, but I forgot the ending colon in the above syntax. The correct syntax is:

Code: [Select]
:dice [# of dice]d[size of dice][sign][modifier]:
Title: Re: Dice Roller
Post by: Gate Troll on November 01, 2008, 12:10:16 PM
 >:( This is complicated.
Title: Re: Dice Roller
Post by: SomeRandomDude on November 01, 2008, 12:28:47 PM
Not really.

<hr><div><img src="http://lotrtcgdb.com/forums/Themes/bluee_plus/images/dice2.gif" alt="" />  Rolling 2d6:   <span style="background-color: #87ceeb;">(5+2): Total = 7</span></div><hr>

(EDIT: Example of what happens if you edit your post.)
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 12:32:12 PM
A perfect example of what happens if you edit your post! Don't do it. ;D
Title: Re: Dice Roller
Post by: SomeRandomDude on November 01, 2008, 12:32:48 PM
Sweetness.

:dice 2d6:
Title: Re: Dice Roller
Post by: menace64 on November 01, 2008, 12:41:14 PM

  Rolling 1d7:   (2): Total = 2

Title: Re: Dice Roller
Post by: menace64 on November 01, 2008, 12:41:41 PM
(I tried rolling a 7.2-sided die.)
Title: Re: Dice Roller
Post by: SomeRandomDude on November 01, 2008, 12:54:58 PM
Sorry, too many rolls!
Title: Re: Dice Roller
Post by: SomeRandomDude on November 01, 2008, 12:55:21 PM
^^That was 10000 rolls. What's the limit?
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 12:55:42 PM
NB and I have been experimenting. It looks like if you edit a post and try to add in a dice roll, it doesn't work. So hopefully the whole thing will discourage cheating. :)
Title: Re: Dice Roller
Post by: SomeRandomDude on November 01, 2008, 12:55:58 PM
Sorry, too many rolls!
Title: Re: Dice Roller
Post by: SomeRandomDude on November 01, 2008, 12:56:11 PM

  Rolling 10d6:   (4+2+5+6+2+3+3+4+4+4): Total = 37

Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 12:56:23 PM
^^That was 10000 rolls. What's the limit?

I think it's 100d40. Let's try:

Sorry, too many rolls!

:twisted:
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 12:56:33 PM
Nope! I'll check the code.
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 12:57:44 PM
Ah, OK. It's 40d100:


  Rolling 40d100:   (57+22+92+70+26+62+86+12+24+88+35+64+93+50+68+17+98+96+40+62+65+86+54+28+70+6+44+32+46+61+87+20+16+6+9+50+19+34+70+31): Total = 1996

Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 12:58:20 PM
Though those numbers are arbitrary and could be increased if needed.
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 01:04:06 PM

  Rolling 2d7:   (2+3): Total = 5

Title: Re: Dice Roller
Post by: NappyKorn on November 01, 2008, 01:13:59 PM
just an edit LOL
Title: Re: Dice Roller
Post by: NappyKorn on November 01, 2008, 01:15:45 PM
Sorry, too many rolls!
Title: Re: Dice Roller
Post by: Gate Troll on November 01, 2008, 04:02:47 PM
You have to post half a page of code.  :roll:
Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 04:23:00 PM
GT, stop whining. The code is:

: dice 2d6:

Without the extra space. What's the big deal?!
Title: Re: Dice Roller
Post by: Gate Troll on November 01, 2008, 04:33:05 PM

  Rolling 2d6:   (2+2): Total = 4

Title: Re: Dice Roller
Post by: Gate Troll on November 01, 2008, 04:33:20 PM
Oh, I see.
Title: Re: Dice Roller
Post by: MR. Lurtzy on November 01, 2008, 05:35:44 PM

  Rolling 2d6:   (5+4): Total = 9



What's the point of this?
Title: Re: Dice Roller
Post by: Gate Troll on November 01, 2008, 05:36:39 PM

  Rolling 1d20:   (15): Total = 15

Title: Re: Dice Roller
Post by: Kralik on November 01, 2008, 05:57:08 PM
What's the point of this?

Roleplaying. :)
Title: Re: Dice Roller
Post by: menace64 on November 01, 2008, 11:18:03 PM
What's the point of this?

It's an easy way to randomize whether or not I'll drop seventeen tons of plague-ridden toads on your house.
Title: Re: Dice Roller
Post by: AgentDrake on November 02, 2008, 09:04:07 PM

  Rolling 3d3:   (2+2+2): Total = 6

Title: Re: Dice Roller
Post by: AgentDrake on November 02, 2008, 09:04:51 PM
Cool!  :up:
Title: Re: Dice Roller
Post by: FM on November 03, 2008, 06:47:56 AM

  Rolling 10d6:   (5+3+6+2+6+3+5+2+5+5): Total = 42

Title: Re: Dice Roller
Post by: FM on November 03, 2008, 06:49:23 AM
Wow. Thanks, Kralik, awesome! And btw, this is why my Fireballs are so deadly, I mean, even in online randomized dice I STILL role better than average. A good deal better, btw. :D
Title: Re: Dice Roller
Post by: NappyKorn on November 03, 2008, 07:26:20 AM

  Rolling 40d1:   (1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1): Total = 40

Title: Re: Dice Roller
Post by: Thranduil on November 03, 2008, 09:06:04 AM
Wow - you rolled badly! 8-)
Title: Re: Dice Roller
Post by: Kralik on November 03, 2008, 11:52:11 AM
Wow. Thanks, Kralik, awesome! And btw, this is why my Fireballs are so deadly, I mean, even in online randomized dice I STILL role better than average. A good deal better, btw. :D

You ought to try it again and see if the RNG still rules in your favor. Or were you going to stop while you were ahead? :P
Title: Re: Dice Roller
Post by: Kralik on November 03, 2008, 11:52:51 AM
Can you role a die with 0 sides? Let's see...


  Rolling 10d0:   (1+1+1+1+1+1+1+1+1+1): Total = 10



Negative sides?

:dice 5d-4:
Title: Re: Dice Roller
Post by: Kralik on November 03, 2008, 11:53:20 AM
Guess not ;)
Title: Re: Dice Roller
Post by: FM on November 03, 2008, 12:43:37 PM
Wow. Thanks, Kralik, awesome! And btw, this is why my Fireballs are so deadly, I mean, even in online randomized dice I STILL role better than average. A good deal better, btw. :D

You ought to try it again and see if the RNG still rules in your favor. Or were you going to stop while you were ahead? :P

Those were my thoughts for now, yes. ;)
Title: Re: Dice Roller
Post by: Kralik on November 03, 2008, 08:44:42 PM
Hmmm... let me try one!


  Rolling 10d6:   (3+6+2+3+4+2+2+2+4+3): Total = 31

Title: Re: Dice Roller
Post by: Kralik on November 03, 2008, 08:45:32 PM
Truly, FM, you have amazing fireball casting skills.
Title: Re: Dice Roller
Post by: SomeRandomDude on November 03, 2008, 08:57:44 PM

(https://lotrtcgwiki.com/forums/proxy.php?request=http%3A%2F%2Flotrtcgdb.com%2Fforums%2FThemes%2Fbluee_plus%2Fimages%2Fdice2.gif&hash=d6ab3baefc2d010bc276ddd1252bb87452f93eef)  Rolling 10d6:   (6+6+6+6+6+6+6+6+6+6): Total = 60


Now if I can get the little background color thing working, I can cheat!

EDIT: Not working. Hm...
Title: Re: Dice Roller
Post by: FM on November 04, 2008, 02:21:27 AM
Truly, FM, you have amazing fireball casting skills.

Told ya. ;)
Title: Re: Dice Roller
Post by: Kralik on November 04, 2008, 05:27:11 AM
Now if I can get the little background color thing working, I can cheat!

Pretty close... though a mod could always modify the post to see if it used the <> style html code (genuine) or [] BB code (your attempt)
Title: Re: Dice Roller
Post by: sickofpalantirs on November 05, 2008, 11:11:39 AM

  Rolling 3d20:   (17+11+17): Total = 45

Title: Re: Dice Roller
Post by: sickofpalantirs on November 05, 2008, 11:12:39 AM
oh yeah...you all just got owned by my sweet moves.
Title: Re: Dice Roller
Post by: Gate Troll on November 05, 2008, 11:16:27 AM

  Rolling 20d6:   (3+5+2+3+6+3+5+3+2+3+4+2+2+3+6+4+2+5+3+5): Total = 71

Title: Re: Dice Roller
Post by: FM on November 05, 2008, 11:21:47 AM
Meh... We're talking... what? 2 hits? You'd still have to roll for damage, though. THAT'S where the real trick is!
Title: Re: Dice Roller
Post by: CarpeGuitarrem on November 05, 2008, 12:25:38 PM

  Rolling 3d6+1:   (3+2+4)+1: Total = 10

Title: Re: Dice Roller
Post by: sickofpalantirs on November 07, 2008, 08:27:26 AM
Meh... We're talking... what? 2 hits? You'd still have to roll for damage, though. THAT'S where the real trick is!


  Rolling 2d20:   (4+11): Total = 15



Title: Re: Dice Roller
Post by: sickofpalantirs on November 07, 2008, 08:27:54 AM
truly...FM speaks the truth...lets try again...


  Rolling 2d20:   (15+8): Total = 23

Title: Re: Dice Roller
Post by: TheJord on November 07, 2008, 03:11:18 PM
Wow there is 4 pages on this dice roller... is that really necessary? Especially in the Golden Hall
Title: Re: Dice Roller
Post by: macheteman on November 19, 2008, 11:48:03 AM
y'know, besides the one sided dice (and zero sided dice) i never saw a single 1 rolled. it that on purpose?
Title: Re: Dice Roller
Post by: Kralik on November 19, 2008, 12:23:37 PM

  Rolling 18d6:   (2+6+6+5+3+2+2+4+3+6+2+6+2+4+6+5+6+5): Total = 75

Title: Re: Dice Roller
Post by: Kralik on November 19, 2008, 12:23:56 PM

  Rolling 20d2:   (2+2+2+2+2+2+1+2+2+2+2+1+1+2+2+1+2+2+2+2): Total = 36

Title: Re: Dice Roller
Post by: Kralik on November 19, 2008, 12:24:38 PM
Odd... it definitely seems to shy away from 1's! Maybe I can check the code.

Another test:

  Rolling 20d3:   (3+2+2+3+2+2+3+3+2+2+3+3+2+2+2+2+3+3+3+2): Total = 49

Title: Re: Dice Roller
Post by: Kralik on November 19, 2008, 12:25:10 PM
Good call, mm. Doesn't seem random! I'll look into it. :gp:
Title: Re: Dice Roller
Post by: macheteman on November 19, 2008, 12:59:02 PM
thanks for the gold, matey! yeah, "seems to shy away from 1's" is a good way to put it. because it obviously rolled a few with the 2-sided die. but not many...
Title: Re: Dice Roller
Post by: Kralik on November 25, 2008, 03:42:42 PM
Well, after a lot of pulling my hair out, I rewrote the dice rolling code a bit. It was, in fact, perfectly good code... but for whatever reason it was "shying away" from the low end of the random number range (1 in this case). Now you should see quite a few more one's:


  Rolling 20d6:   (1+3+6+1+4+6+2+1+2+3+1+6+6+6+6+4+3+5+5+3): Total = 74



  Rolling 20d6:   (5+6+4+2+5+4+5+1+1+1+2+4+3+6+4+5+5+5+6+3): Total = 77



  Rolling 20d6:   (3+3+1+2+1+3+4+1+4+1+4+1+1+1+1+5+5+4+1+5): Total = 51



  Rolling 20d6:   (1+3+4+2+2+1+3+3+6+4+5+6+3+2+5+4+1+4+5+1): Total = 65



  Rolling 20d6:   (3+3+2+6+1+6+5+2+2+5+6+4+3+3+1+3+1+4+6+2): Total = 68

Title: Re: Dice Roller
Post by: macheteman on November 25, 2008, 08:03:56 PM
cool! it works better methinks!