if(mynickison) { irc_ison(bot.nick); waits(12);
if(recieved_ping) { recieved_ping = 0; waits(bot.ping_timeout); } else if(bot.connected) { sprintf(time_str, "%ld", time(NULL)); irc_ping(time_str); waits(bot.ping_timeout); if(!recieved_ping) { irc_disconnect(); waits(3); if((i = irc_connect(bot.servaddr, bot.servport)) != 0) { printf("Failed to connect. ERROR %d\n\n", i); log_write("Connecting failed with code: %d", i); printf("Press Enter key to continue."); getchar(); clean_exit(1); } break; }
THREADFUNC(irc_fightfornick) {    while(1) {        if(mynickison) {            irc_ison(bot.nick);            waits(12);        }        else {            break;        }    }        mynickison = 0;            return 0;}