Rolisteam / DiceParser

Powerful dice Roller is used as discord bot, irc bot, cli tool and inside Rolisteam : 1d20+4, 1L[head,arm,leg,belly,chest], 1d6+1d8, 8+5*3

Home Page:http://www.rolisteam.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some trouble on list on Discord

S-GADIOUX opened this issue · comments

Hey. I have some weird result when I'm using a list in a macro
I type this : !L[2[1],3[3],4[7],5[12],6[49],7[81],8[31],9[3],10[4],11[18],12[1]];$1
And I obtain this :

# 7,0
Details:[L[2[1],3[3],4[7],5[12],6[49],7[81],8[31],9[3],10[4],11[18],12[1]];$1 ()]

So the value of the list is not kept in the next instruction.
Does anyone know why this is happening ?

Displaying a simple value as result make diceparser manage that value as a number.
To make it displayed as an output result you must put some letters (such as result…)

!L[2[1],3[3],4[7],5[12],6[49],7[81],8[31],9[3],10[4],11[18],12[1]];"result $1"

But I need to use the value in a condition in the next instruction like this :
!1L[1[2],2[4],3[1]];$1i[<2]{"Dice :1"}{"Dice : 2,3"}
But I obtain this :

# 1,0
Details:[1L[1[2],2[4],3[1]];$1i[<2]{"Dice :1"}{"Dice : 2,3"} ()]

Instead of
1,Dice : 1

Main problem

Your if needs to compare a scalar net a dice value. To make it happen, you have to put : after the i:

!1L[1[2],2[4],3[1]];$1i:[<2]{"Dice :1"}{"Dice : 2,3"}

About the output

DiceParser needs to see a place holder to identify a string as output string. Otherwise, it takes the string as a regular value.

So writing this:

1d6;1L[foo,bar] # X,bar or X,foo

will produce the same kind of output that:

"6";"bar" # 6,bar

But

6;"foo: $1"

will produce an output like that:

foo: 6