I'm just a little confused on how to start this off (i'm new to scripting

)
What i need is an example of a script that will message a contact when you open a conversation with them.
EG:
When you open a conversation it will automatically say "Hi." or "Hi <contacts name here>"
Thanks.