@ above code:
Looks fine. Please note that the plugin is old. The used script commands might be protected (and thus unavailable) by now. Thus, if your client disconnects when trying it, don't retry