
def user_make_bindings(window)
  window.bind('F1', proc  {set_cmd 'set_auto_reply  ' })
  window.bind('Shift-F1', proc  {set_cmd 'cancel_auto_reply  ' })
  window.bind ('Control-o', proc { observe_pro_game(window)} )
  end

def user_do_help(window)

   putline "\n"
   putline "my personnal scripts: \n"
   putline "Control-o : observe last pro game started\n"
   putline "hit <F1> to print 'set_auto_reply' \n"
   putline "hit <Shift-F1> to print 'cancel_auto_reply' \n"
end

    def observe_pro_game(window)
      return if @pro_game.nil?
      send_command ('observe '+ @pro_game)
    end

    def  user_make_vars(code,line)
       if  m= /Match (\d+): (\S+) \[(.+)\] vs. (\S+) \[(.+)\]/.match(line)
        if m[3].index( 'p') or m[5].index( 'p')
	  @pro_game= m[1]
	  putline ( line[1...-1]+"\n", 'info')
	  putline ( "Pro Game is started, hit 'Ctrl-O' to observe.\n",'tell')
 	end
       end
    end


