tell me how to start i and how will i link it to facebook as in i want to make a bot for farmville 2 in php how will i make it please help

A 'bot' to do what, exactly? Explain your motivations first, along with what language you are thinking of using etc etc. I have moved this question to the programming section...