if ($1 == xt) { msg x topic $active $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $29 $30 $31 $31 $32 $32 $33 $34 $35 $36 $37 $38 $39 $40 | }
can also be
if ($1 == xt) { msg x topic $active $2- | halt }
$N- Nth term and everything after it
or $N-P everything from N till P
so if you must
if ($1 == xt) { msg x topic $active $2-40 | halt }
p.s. you also missed the halt after | in that 1