When you read the tutorial, it says that whatever code you use to get the 3D coordinates from the mouse click(the matrix specific code, or the pick object() code) will be referred as get3dMouse() from that point on. So just make your own function called get3dMouse() that does the same thing.
Here's mine if you want it:
//where index is the current value of the for loop this function will be called from
function unit_getMouse3DCoord( index as integer , mouse_x as integer , mouse_y as integer )
local null
null=pick object(mouse_x,mouse_y,groundObjID,groundObjID)
if null=0
unit(index).isMoving=false
unit(index).isIdle=true
else
unit(index).tgt.x=camera position x(0)+get pick vector x()
unit(index).tgt.z=camera position z(0)+get pick vector z()
unit(index).isMoving=true
unit(index).isIdle=false
unit(index).angleToTgt=atanfull(unit(i).tgt.x-unit(i).pos.x,unit(i).tgt.z-unit(i).pos.z)
endif
endfunction
Note: You'll probably have to adjust for the tutorial but I think you can figure it out.