I use an application called NoSleep. Technically it is a Kernel Extension. It is used to prevent a Mac (OSX Mavericks) from going to sleep when you close the lid.
NoSleep works fantastically well. I only have one issue. I want the NoSleep feature ON when the computer boots and performs auto login. By default NoSleep is running but in an off state. To toggle on, you simply click (once) the NoSleep icon on the system bar (up where volume, dropbox etc shows up), upper right.
I would like a simple AppleScript that I can run at startup as an App using System Preferences/ Users and Groups / login items. That just clicks that icon.