!read names
!if $special_parm=script
 script=$allowlevel/$thisexo 
 skip_next=
 !for i=1 to $stepcnt
  !if $skip_next=yes
   skip_next=
   !goto lend
  !endif
  l=!line $i of $steplist
  !distribute item $l into name,num,x1,x2,x3,x4,x5,x6
  !if $name=circle
   script=!append line circle,$x1,$x2 to $script
  !endif
  !if $name=random
   script=!append line random,$x1,$x2 to $script
  !endif
  !if $name=line
   l=!line $num of $lines
   t=!item 5 of $l
   name=!item $t of $special1
   script=!append line $name,$x1,$x2 to $script
  !endif
  !if $name iswordof middle midper midperpendicular
   script=!append line $name,$x1,$x2 to $script
  !endif
  !if $name=point
   script=!append line point,$x3,$x1,$x4,$x2 to $script
   !if circle isin $l and $i<$stepcnt
    ll=!line $i+1 of $steplist
    !distribute item $ll into n2,n3,y1,y2,y3,y4,y5,y6
    !if $n2=point and $x1=$y1 and $x2=$y2 and $x3=$y3 and $x4=$y4
     skip_next=yes
    !endif
   !endif
  !endif
  !if $name=hide
   script=!append line $l to $script
  !endif
  :lend
 !next i
 !exit
!endif

!if $special_parm=goal
 size=250
 !distribute item -1,-1,1,1 into xmin,ymin,xmax,ymax
 !for i=1 to $startpointcnt
  l=!line $i of $points
  !distribute item $l into x,y,c
  xmin=$[min($x,$xmin)]
  ymin=$[min($y,$ymin)]
  xmax=$[max($x,$xmax)]
  ymax=$[max($y,$ymax)]
 !next i
 !for i=1 to $startcirclecnt
   l=!line $i of $circles
   !distribute item $l into x,y,r
   xmin=$[min($x-$r,$xmin)]
   ymin=$[min($y-$r,$ymin)]
   xmax=$[max($x+$r,$xmax)]
   ymax=$[max($y+$r,$ymax)]
 !next i
 !for i=1 to $gpointcnt
  l=!line $i of $gpoint
  !distribute item $l into x,y,c
  xmin=$[min($x,$xmin)]
  ymin=$[min($y,$ymin)]
  xmax=$[max($x,$xmax)]
  ymax=$[max($y,$ymax)]
 !next i
 !for i=1 to $gcirclecnt
   l=!line $i of $gcircle
   !distribute item $l into x,y,r
   xmin=$[min($x-$r,$xmin)]
   ymin=$[min($y-$r,$ymin)]
   xmax=$[max($x+$r,$xmax)]
   ymax=$[max($y+$r,$ymax)]
 !next i
 zoomfactor=1
 !read proc/drawrange
 drawcnt=$startstepcnt
 drawlist=$startsteplist
 drawline=$lines
 drawpoint=$points
 drawcircle=$circles
 drawcolor=$color1
 !read proc/drawgoal
 draw_src1=$draw_src 
 
 drawcnt=$goalcnt
 drawlist=$goallist
 drawline=$gline
 drawpoint=$gpoint
 drawcircle=$gcircle
 drawcolor=$color2
 shownum=no
 !read proc/drawgoal
 !read proc/animate 
 !exit
!endif

