I wish to extract the mob's name - "a gibbering coder".
$left(17,"$p0") returns a gibbering coder
/varset l0 $left(17,"$p0") sets l0 to "a" because of the embedded white spaces.
This works.
Code: Select all
sub event_pyschotic
/varset l0 2
:loop_find_critter_name
/varadd l0 1
/if $arg($l0,"$p0")!=for /goto :loop_find_critter_name
/varsub l0 1
/for l1 1 to $l0
/varset a(1,$l1) $arg($l1,"$p0")
/next l1
/varset l2 "$a(1,1) $a(1,2) $a(1,3) $a(1,4) $a(1,5)"
/echo $l2
/for l2 1 to 5
/varset a(1,$l2) ""
/next l2
/return
For the record, this appears to consistently blow up
Code: Select all
/for l1 1 to l0
/varset l2 "$l2 $a(1,$l1)"
/next l1


