Moved autoconnect to lua