# Dice roller ahoy!

**URL:** <https://discussion.tekeli.li/t/dice-roller-ahoy/830>\
**Category:** Site guides\
**Created:** [6 May 2020 11:32 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830 "2020-05-06T11:32:15Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![RossM](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/rossm/32/1021_2.png) [@RossM](https://discussion.tekeli.li/u/RossM)\
**Post date:** [11 May 2020 12:10 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/42 "2020-05-11T12:10:25Z")

</div>

Who are these twenty characters?

---

<div class="post-metadata">

**Author:** ![Agemegos](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/agemegos/32/15077_2.png) [@Agemegos](https://discussion.tekeli.li/u/Agemegos)\
**Post date:** [11 May 2020 12:49 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/43 "2020-05-11T12:49:34Z")

</div>

They are a bunch of garrulous bouzeaux who insist on suppressing succinctness.

---

<div class="post-metadata">

**Author:** ![RogerBW](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/rogerbw/32/3_2.png) [@RogerBW](https://discussion.tekeli.li/u/RogerBW)\
**Post date:** [12 May 2020 10:36 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/44 "2020-05-12T10:36:42Z")

</div>

Right, the new version has been tested on my toybox, so it’ll go live next time I restart the forum software.

---

<div class="post-metadata">

**Author:** ![RogerBW](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/rogerbw/32/3_2.png) [@RogerBW](https://discussion.tekeli.li/u/RogerBW)\
**Post date:** [20 May 2020 10:47 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/45 "2020-05-20T10:47:13Z")

</div>

…and it is now live.

---

<div class="post-metadata">

**Author:** ![RogerBW](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/rogerbw/32/3_2.png) [@RogerBW](https://discussion.tekeli.li/u/RogerBW)\
**Post date:** [14 October 2020 10:47 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/46 "2020-10-14T10:47:37Z")

</div>

The next version of the dice roller fixes some parsing bugs, cleans up more of the inherited code, and adds Genesys/Star Wars RPG dice. This will go live next time I restart the forum software.

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [19 May 2025 08:32 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/49 "2025-05-19T08:32:36Z")

</div>

@Benkyo asked for a die roll:  
Just testing:

`5d6: 5 + 5 + 5 + 2 + 5 = 22`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [23 May 2025 23:06 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/50 "2025-05-23T23:06:23Z")

</div>

@lalunaverde asked for a die roll:  
Hey is the mic on? `5d6: 2 + 1 + 6 + 3 + 1 = 13`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [25 May 2025 10:25 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/51 "2025-05-25T10:25:18Z")

</div>

@GeeBizzle asked for a die roll:  
`d6: 2`

---

<div class="post-metadata">

**Author:** ![GeeBizzle](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/geebizzle/32/20606_2.png) [@GeeBizzle](https://discussion.tekeli.li/u/GeeBizzle)\
**Post date:** [13 August 2025 09:37 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/52 "2025-08-13T09:37:00Z")

</div>

[roll7d6]

---

<div class="post-metadata">

**Author:** ![RogerBW](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/rogerbw/32/3_2.png) [@RogerBW](https://discussion.tekeli.li/u/RogerBW)\
**Post date:** [13 August 2025 09:42 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/53 "2025-08-13T09:42:56Z")

</div>

Two reasons that didn’t work:

- written in the new editor so the square brackets were escaped “\[” and “\]”
- no space between the “roll” command and the die specification

---

<div class="post-metadata">

**Author:** ![Assussanni](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/assussanni/32/11057_2.png) [@Assussanni](https://discussion.tekeli.li/u/Assussanni)\
**Post date:** [13 August 2025 09:51 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/54 "2025-08-13T09:51:59Z")

</div>

To add to Roger’s point, to switch between the new and old editors you need to click on the “A” in the top left of the input window:

 ![New_Editor](https://discussion.tekeli.li/uploads/default/original/3X/5/0/50713eb03c1f242450ad9f38fec8ee1e87a8a8d2.png)  
It should change to M↓, which indicates you are using the old editor and can type square brackets as the dice roller expects.

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [13 August 2025 09:55 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/55 "2025-08-13T09:55:25Z")

</div>

@Benkyo asked for a die roll:  
`d6: 3`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [13 August 2025 11:14 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/56 "2025-08-13T11:14:10Z")

</div>

@GeeBizzle asked for a die roll:  
`7d6: 3 + 5 + 2 + 6 + 3 + 6 + 2 = 27`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [2 October 2025 12:32 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/57 "2025-10-02T12:32:07Z")

</div>

@Phil asked for a die roll:  
`d12: 1`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [2 October 2025 12:32 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/58 "2025-10-02T12:32:49Z")

</div>

@Phil asked for a die roll:  
`d99: 74`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [2 October 2025 12:35 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/60 "2025-10-02T12:35:59Z")

</div>

@Phil asked for a die roll:  
`d6: 1`

---

<div class="post-metadata">

**Author:** ![system](https://discussion.tekeli.li/uploads/default/original/2X/e/ef089ab6628f1c6dc2a899bcbf6bc4faa5901940.png) [@system](https://discussion.tekeli.li/u/system)\
**Post date:** [2 October 2025 12:36 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/61 "2025-10-02T12:36:17Z")

</div>

@Phil asked for a die roll:  
`d1: 1`

---

<div class="post-metadata">

**Author:** ![dscheidt](https://discussion.tekeli.li/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://discussion.tekeli.li/u/dscheidt)\
**Post date:** [3 October 2025 00:12 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/62 "2025-10-03T00:12:35Z")

</div>

What are the chances!

---

<div class="post-metadata">

**Author:** ![Phil](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/phil/32/1508_2.png) [@Phil](https://discussion.tekeli.li/u/Phil)\
**Post date:** [16 March 2026 10:32 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/63 "2026-03-16T10:32:07Z")

</div>

When `[foo]` is a valid dice roll request, can `[foo][` and `[foo](` be ignored, to avoid clashes with links ala [Your Last Played Game Volume 3 - #1295 by system](https://discussion.tekeli.li/t/your-last-played-game-volume-3/5698/1295) ?

Failing that (if the code in question cannot see what follows), perhaps extra validation is possible, such that invalid inputs result in no modification taking place? (In that example, it was looking for `battle N` where N was an integer, and when it didn’t match that it did the roll with a default N=1, whereas “ignoring the request entirely” would have been a more desirable outcome in that case.)

---

<div class="post-metadata">

**Author:** ![RogerBW](https://discussion.tekeli.li/user_avatar/discussion.tekeli.li/rogerbw/32/3_2.png) [@RogerBW](https://discussion.tekeli.li/u/RogerBW)\
**Post date:** [16 March 2026 11:24 UTC](https://discussion.tekeli.li/t/dice-roller-ahoy/830/64 "2026-03-16T11:24:15Z")

</div>

I’ll give it a go. I agree, a markdown link is a reasonable thing to exclude from processing.

I really ought to rewrite from scratch rather than keep modifying the code that I originally got from someone else.

Also I think I’ll just remove all the “special dice” for now since nobody has used them for a while. I’ll leave in the custom faces option so that if anyone wants a weird die it can be done that way.

[Previous page](https://discussion.tekeli.li/t/dice-roller-ahoy/830.md?page=2)
