So, this is the program that I have been tinkering with. It is just something that I was trying to quickly whip up to generate a character for D&D. I tried to do a search of the forum for anything similar but I didn't find anything. I have tried to set it up for various systems in that I have a variable number of die rolled, and number of stats needed. Further, my DM gives us a minimum stat. (nothing lower than 10 in his case, nice guy that he is ) It seems to be the minimum stat that is giving me issues. Everything else seems to work well. But when it tries to reroll the stat if it is below the minimum it gives me way too many stats. Anyway, any help would be appreciated. (It is probably something stupid that I missed. It usually is... )
CODE
$dice = Inputbox ("Stats", "How many die?")
$stat = InputBox ("Stats", "How many stats do you need?")
$min = InputBox ("Stats", "What is your minimum stat?")
$i = 0
$s = 0
While $s < $stat
$k = (Random (1,6,1) * $dice)
If $k < $min then
$k = (Random (1,6,1) * $dice)
FileWriteLine ("Stats2.txt", "Stat " & $k)
Else
FileWriteLine ("Stats2.txt", "Stat " & $k)
$s = $s + 1
EndIf
WEnd