/play -E[n] - Execute next iteration(s) - 19/12/15 05:23 PM
When using /play there is not a script-accessible way to progress a currently /play'ing buffer. I suggest the following:
/play -E[n]
Plays the next line of the buffer.
if n is specified the next n lines are handled
if n is specified as 0 the rest of the buffer is handled
Specifics:
The -E switch can be used, with other switches, to create a new play buffer instance. If used as such an initial number of lines will be played immediately within the script execution block.
If the -c switch is specified with -E, lines to be evaluated should be done so within the script execution block allowing such lines access to local variables and aliases. If done so on a pre-existing play buffer only the lines to be handled as a result of the /play -E call should be evaluated as such.
Example#1 - Progressing a Buffer:
Example #2 - Initial Line Handling
Example #3 - Scoping
/play -E[n]
Plays the next line of the buffer.
if n is specified the next n lines are handled
if n is specified as 0 the rest of the buffer is handled
Specifics:
The -E switch can be used, with other switches, to create a new play buffer instance. If used as such an initial number of lines will be played immediately within the script execution block.
If the -c switch is specified with -E, lines to be evaluated should be done so within the script execution block allowing such lines access to local variables and aliases. If done so on a pre-existing play buffer only the lines to be handled as a result of the /play -E call should be evaluated as such.
Example#1 - Progressing a Buffer:
Code:
alias example1 { play # example1.txt 1000 ;; Handles the first line of example.txt play -E ;; Handles the next 2 lines play -E2 ;; Handles the rest of the buffer play -E0 }
Example #2 - Initial Line Handling
Code:
alias example2 { ;; Handles the initial 3 lines of example.txt immediately ;; then handles the rest of the file in accordance with current behavior play -E3 #chan example.txt 1000 }
Example #3 - Scoping
Code:
;; /set %example global ;; /play -c # example.txt 1000 alias example3 { var %example = local ;; evaluates instances of "%example" to "global" play -E ;; evaluates instance of "%example" to "local" play -cE }