Page 1 of 1

Dice Roll Chat Commands

Posted: Mon Apr 11, 2022 9:18 pm
by Qui Chang
Someone on the discord suggested adding dice rolls to the chat commands. An example:

Code: Select all

else if (GetStringLeft(sSaid, 7) == "/roll d" && StringToInt(GetSubString(sSaid, 7, GetStringLength(sSaid))) != 0)
        {
            //maybe add while loop to make sure all characters after '/roll d' are numbers
            int iDiceParsed = StringToInt(GetSubString(sSaid, 7, GetStringLength(sSaid)));
            string sDiceParsed = IntToString(iDiceParsed);
            int iDiceRoll = Random(StringToInt(sDiceParsed))+1;
            SetPCChatMessage(COLOR_GOLD+sName+" rolled a d"+sDiceParsed+". The result was: "+IntToString(iDiceRoll)+COLOR_END);
            return;
        }
This would allow anyone to roll literally and single dice at any time. IE, if you needed to roll a d2314, you could. Could also further parse it for multiple dice.

Re: Dice Roll Chat Commands

Posted: Tue Apr 12, 2022 5:50 am
by driller
I already added this back on the 9th.

viewtopic.php?f=15&p=38620#p38620

Thanks.

Re: Dice Roll Chat Commands

Posted: Tue Apr 12, 2022 11:21 pm
by Qui Chang
driller wrote: Tue Apr 12, 2022 5:50 am I already added this back on the 9th.

viewtopic.php?f=15&p=38620#p38620

Thanks.
Oh I completely missed that update. Awesome!