@redeven Yes you can do that but it doesnt work the way you implemented it.
build,harvest and such are only shedules if the current gamestate allows ist. (when you are in range).
Your second command will always return ERR_NOT_IN_RANGE. Meaning it wont be shedules to be executed after your script is finished. I Testet it with one of my harvesters. While approaching the source it never Returned 0 (OK) and it wasnt executed when the harvester was at the source.
it only works the other way around.
For example:
youre in range of your transfertarget. you sucessfully shedule a transfer (retVal == OK). Then you can issue a move to somewhere.
The only thing that you can change while your script is running is memory. Everything else stays the same until next tick. And all commands must have the prerequisites fulfilled when they are issued and dont consider the next tick.