int TLuaInterpreter::sendATCP( lua_State *L ) { string msg; if( ! lua_isstring( L, 1 ) ) { lua_pushstring( L, "sendATCP: what do you want to send?" ); lua_error( L ); return 1; } else { msg = lua_tostring( L, 1 ); } string what; if( lua_isstring( L, 2 ) ) { what = lua_tostring( L, 2 ); } string _h; _h += TN_IAC; _h += TN_SB; _h += 200; _h += msg; if (what) { _h += " "; _h += what; } _h += TN_IAC; _h += TN_SE; Host * pHost = TLuaInterpreter::luaInterpreterMap[L]; pHost->mTelnet.socketOutRaw( _h ); return 0; }