1. I would have highly recommended you work on whatever project on the side BEFORE moving to Silicon Valley. Get feedback, build a prototype, launch, fix bugs, etc, and go somewhere with it.
2. THEN I would have recommended moving at that point, finding other startup folks looking for roommates, and join in. Gives you like minded folks who hopefully will turn out to be good roommates.
3. Finally, I'd continue working on said project and start hitting up meetups/events to spread the word while getting feedback and making new friends along the way.
Given that isn't what you're asking and say you are in SV without a project or anything going on, first order is still to find a place to live and an income source. Then proceed to work on said idea (as mentioned above) and go mingle to get some friends.