Calling your function correctly
There are a few issues with your provided code.
- You're actually calling the built-in
[highest NUMBER of DICE]function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
DandEare missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.- The
doperator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't used12 d10because it would parse them as a single argument ofd12d10. You would have to phrase it asd121d12 1d10. If you always use exploding dice this is ok since no argument has a leadingd.
Icepool
If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.
from icepool import d, highest
output(highest(d(4).explode(),
d(6).explode(),
d(8).explode(),
d(10).explode(),
d(12).explode(),
keep=2))