well this is what i had before

on *:text:!d4:*:{
msg $chan $nick rolles a $rand(1,4)
}

on *:text:!d6:*:{
msg $chan $nick rolles a $rand(1,6)
}

on *:text:!d8:*:{
msg $chan $nick rolles a $rand(1,8)
}

on *:text:!d10:*:{
msg $chan $nick rolles a $rand(0,10)
}

on *:text:!d12:*:{
msg $chan $nick rolles a $rand(1,12)
}

on *:text:!d20:*:{
msg $chan $nick rolles a $rand(1,20)
}

on *:text:!d100:*:{
msg $chan $nick rolles a $rand(0,100)
}

but i want something to do this in an all in one command - where it would create a variable for each # i need
1 - number of rolls
2 - sides on the rolled die
3 - # added to end result
4 - final result