string $light[] = listRelatives -children defaultLightSet
;
gives me the lights in the order in which the appear in the outliner, as these are all listed under "defaultLightSet".
This is just what I want. Thank you.
For reference, the full code for getting the lights is:
string $lightshape[] = `listRelatives -children defaultLightSet`;
int $i;
int $num\_light\_shapes = size($lightshape);
string $light[];
for ($i = 0; $i != $num\_lights; $i++)
{
//get light itself
$light[$i] = `listRelatives -parent $lightshape[$i]`;
}