create terrain using script

i want to create a terrain using script by c# or javascript,or to attach a texture form a “.jpg” file to a terrain using script also.can somebody give me some script aboat these option?thanks!

here’s some info to get you started