Electronic Multi Dice Roll on Button Press..advice plz

Hello everyone

I love tabletop rpgs and dice but I wanted to make something a little more streamlined for the plethora of dice I need, especially as a GM
However before I order hardware I wanted to make sure I understood the logic and button and random specific syntax
And yes I searched the forums but couldn't quite find my solution.
What I want to build is an arduino with at least 7 buttons representing d4,d6,d8,d10,d12, d20, d100,and an oled screen to display the results

The below code is just a basic syntax outline I'm writing on the fly to make sure I have the specific syntax abd logic down.
Feel free to offer advice..
Id like to eventually add a second display that my players can see for open rolls as Well as the ability to roll multiple dice and add the results, but I'm to novice for that.
Anyways, here's where I am

If buttond4 = HIGH
 diceroll = random(1,4)
 print(diceroll, "d4")
delay 750

Else If buttond6 = HIGH
 diceroll = random(1,6)
 print(diceroll, "d6")
delay 750

Else If buttond8 = HIGH
 diceroll = random(1,8)
 print(diceroll, "d8")
delay 750

** I realize I'm missing basic code syntax but that's not
 really my issue. I know its bad form,bad habits!

Any help /advice would be amazing
Also any insight into doing 2 OLED and multiple dice at the same time would be great

I'm planning on 3D printing a pair giant dice eventually to encase 2 of these with, 1 GM and one for my players.

Once I get these done I'm going to tackle a hitpoint tracker but I figured this was far easier than trying to setup the user inputs abd hitpoints on level..

Thanks in advance!!

All I understand are buttons and a display. The purpose of the buttons and of the display are secret?

I'm not sure how I misrepresented my intentions, I thought

"What I want to build is an arduino with at least 7 buttons representing d4,d6,d8,d10,d12, d20, d100,and an oled screen to display the results"

Would be sufficient but let me elaborate. That's my fault!

I want to connect 7 buttons to an arduino , each representing one of 7 dice
The 4 sided dice, the 6 sided dice, the 8 sided 10 sided 12 sided 20 sided and 100 sided dice and
When the corresponding button is pressed, the arduino does a random between 1 and the dice size and displays the results on an oled

Does that make more sense?

here's where I am

So not up to writing real code yet.

The normal way to do a dice is to make it random, not by a random number generator, because that is not actually random, but by timing how long a button has been pressed. This is truly random.

So have one “throw” button and count how many times you can read it before it is released. Then simply do a modulus divider operation on the result with a number that is the size of the dice you want to use, and all one. The modulus operation is repressed by a percent sign %.

diceResult = 1+( throw % diceSides);

Also any insight into doing 2 OLED and multiple dice at the same time would be great

Using 2 OLED displays would require more SRAM memory than is on most 8 bit Arduinos. The exception is the Mega.

It's sufficient to get the micros when the button was pressed, then massage that time according to the die size.