// DRAWPOINTS - allow user to "draw" with mouse, then save points to a file.

message "Click left mouse button to draw lines\nClick right button to move turtle\nPress F for fill" "Done"

// get the points..
set first = yes
pointlist startcapture
repeat untilbreak [
  getkey
  set k = whichkey
  if :k = "Done" [ break ]
  elseif :k = "right" or :first = yes [ pu ]
  elseif :k = "left" [ pd ]
  elseif :k = "f" [ fillshape  continue ]
  else [ continue ]
  moveto whereclick
  set first = no
  ]
pointlist endcapture
set filename = typein "File name to save to:\n(recommend use .pts at end of name)" "OK|Cancel" 
if :filename != "Cancel" [ 
  set filename = concat 2 "ptsfiles/" :filename 
  pointlist savefile :filename 
  ]

