on *:text:!calc *:#yourchannel:{
var %a = $regsubex(calc,$2-,/^(\d)( \d|)( \d|)( )([ABCD])((?: \w+){1,3})$/, $&
(( $+ $remove(\1*x + \2*y + \3*z,\4+ *z,\4+ *y) $+ ) * \5) * $($+(%,calc.points.,$remove(\6,\4)),2))
if $regml(calc,0) {
; result is stored in %a
msg # %a
}
}