I'm trying to make Second life more accessible. I was hoping an experienced LSL scripter could help me out. I'm trying to create a navigation mechanism that allows someone who can only use single switch access http://en.wikipedia.org/wiki/Switch_access to navigate their avatar.
The mechanism is supposed to be an avatar attachment or a HUD attachment in the form of a translucent arrow that hovers at the avatars feet and which has three states that the user cycles through by pressing the forward/switch key:
1) Rotate: the arrow rotates 180 degrees from left to right. When the user presses the up key the direction of the arrow becomes fixed and goes to state 2.
2) Extend: the arrow grows in length until it reaches a certain maximum (10m) and then shrinks again until a certain minimum. If the user presses the UP key again the arrow becomes fixed and goes to state 3.
3) Move: the avatar moves towards the top of the arrow while the arrow shrinks again. If the user has arrived at its destination, the mechanism goes back to state 1.
I was able to create the arrow, the three states, and my avatar to move see the code below, but I'm having a really hard time with attaching the arrow prim to my avatar, my arrow keeps getting disoriented.
I have a few questions:
1) is there a way to set the rotation of my arrow to the direction my avatar is facing?
2) How can I make sure my arrow does not move into the ground?
3) Is there a way to attach my arrow as such that it moves with my avatar but that it doesn't move with the body part ? E.g. I would like my arrow to just hover under my avatar.
Here's a screenshot of the switchnav mechanism.

Any help would be appreciated.
Below my code (note the moving part does not work yet). If your drop this into a triangle with z height =0 and attach it to the pelvis it should work.
Hmm this forum doesn't allow for displaying code.
If you want to take a look at my code you can download it at:
http://www.eelke.com/files/switchnav.lsl