Added autoTriggerUntil function support

Added support to use autoTriggerUntil as a function instead only number of pages.