If you're trying to run the script on the same machine as the server, you'll want to use something called AMIP. It won't be as fancy, but it still works. http://amip.tools-for.net/wiki/
Then you can make !request and other scripts that don't use sockets for the server.