patrick08:
Ok, so I used your code:
void QtBotCore::connected()
{
int loops = -1;
while ( !t->atEnd() )
{
loops++;
response = t->readLine();
qDebug() << loops << " line " << response;
if ( response.contains(":VERSION") )
qDebug() << "IT WORKED !";
}
}
void QtBotCore::connected()
{
QTextStream *t = new QTextStream( tcpSocket );
QString response;
int loops = -1;
while ( !t->atEnd() )
{
loops++;
response = t->readLine();
qDebug() << loops << " line " << response;
if ( response.contains(":VERSION") )
qDebug() << "IT WORKED !";
}
}
To copy to clipboard, switch view to plain text mode
And the output is something like this:
0 line "127.0.0.1 372 nmuntz :- ____ _____ _______ ____ ____ _"
1 line ":127.0.0.1 372 nmuntz :- | _ \ / _ \ \ / / ____| _ \/ ___| ___| |"
2 line ":127.0.0.1 372 nmuntz :- Welcome to Server"
3 line ":127.0.0.1 372 nmuntz :- "
4 line ":127.0.0.1 376 nmuntz :End of /MOTD command."
5 line ":nmuntz MODE nmuntz :+iw"
6 line ":Global!services@powers.cl NOTICE nmuntz :[Logon News - May 03 2006] PWN!"
7 line ":nmuntz@pool.verizon.net PRIVMSG nmuntz :VERSION"
Bookmarks