I'm trying to make a spell that essentially scans the area with the analyze world objects spell, then manipulate the objects using the Lock Orb to Player Look Target command.
Problem is, I have no idea how to transfer the information found during the scan, to the command which picks the objects up.
Any help would be greatly appreciated
Preface - I am not a very good programmer, what I say might not be useful.
The analyse world object spell, after scaning, calls upon a function providing an input which is the list of all world objects found during the analysis. On the top left of a function block is a button which can be used to change the amount of inputs a function should expect.
For example scaning 3 objects will provide the input '[object Object],[object Object],[object Object]'. (I'm afraid I do not know how these are ordered.) In the the lists and loops section of blocky there are blocks that can be used to separate the [object Object] 's. You can then get information,such as position, using the 'get ...' blocks found in the Air/Analyse World objects section.
To use this information outside of the function you can just define it as a variable in the function to be used by the same spell or broadcast it to another spell that reacts to the message.
Here is an example one, that I made public today. It scans an area and ramdomly decides who should have an explosion centered on them.
If my memory serves me correctly, scanned objects are ordered from closest to farthest from the orb that was scanning them. My memory doesn't always serve me correctly though, so it's worth doing some research on rather than just taking my word for it.
Unfortunately, I don't think this is true. I wrote a program that prints the distance of each world object from the orb and the results didn't indicate that.
Here it is:
The program was made public today if you want to try and figure it out.