lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Wade Guidry once stated:
> I'm new to lua.
> 
> I'm trying to script a session against a telnet server (login, run a few commands within a menu-driven interface, then close the session).
> 
> I'm using lua sockets. My code appears below.
> 
> I'm not getting the expected results, though the code seems to run OK.
> 
> I'm trying to figure out how I can "see" what's going on during the session.
> 
> Is there a way in lua to echo back the server responses, for example?

  You could try using conn:receive() (which blocks until data is received)
and printing the results.  I don't have much experience with Lua sockets so
that's the best suggestion I can give.

> local assert (conn:send("^E\n"))  (ed. note: not sure if this is the correct way to send a ctrl-E. Also tried \005 )

  Using "\5\n" should work.

  -spc