Hello
divider y1 y2 does not converge.
Let suppose that y1 must be inferior to y2.
divider introduces two points dy1 and dy2 reducing the distance between y1 and y2.
y1 => dy1 => dy2 => y2
However there are only additions in the definitions of dy1 and yd2.
so for example dy2 could be greater than the target y2.
Fortunately, the program stops before the infinity
thanks to:
(gimp-image-select-rectangle image 2 0 y 300 dy )
dy could be negative and gimp-image-select-rectangle does not like negative values.
One of issues is the call of
random.
According to C:\Program Files\GIMP 2\share\gimp\2.0\scripts\script-fu-compat.init
random has only one parameter.
However dy1 and dy2 are defined by:
(define dy1 (+ (random y2 y1) y1)) ; Calculate the higher Division-Point
(define dy2 (+ (random y2 dy1) dy1)) ; Calculate the lower Division-Point
The comment is not sufficient.
Always supply a running example with expected result:
y1=
y2=
dy1 could be ...