Here's one way to do it. Basically loop over them and save the iid of the Sprite at the end of the loop so we can access it too at the next loop iteration using the sprite(1).x type syntax.
Global variable prev=-1
For each dot ordered by dot.x ascending
---- compare: loopindex>0
-------- draw quad (dot(prev).x dot(prev).y, dot.x, dot.y, dot.x, 300, dot(prev).x, 300)
---- set prev to dot.iid
An alternate way would be to store the positions in an array instead of that picking trickery.
The quad points start with the top-left and go clockwise from there.