Before I get into my dilemma, yes I know what lacewing is. No, I don't want to use it. I specifically want to connect to an IRC server. I've already scoured tDC, Clickteam, and Google for event examples to relatively no avail. Each tutorial or example seem to do things in a different order, and unfortunately none of them seem to work when applied to Moosock and MMF2.
From what I understand, I'm supposed to select a socket, connect to the IRC server, accept on receive, pass received messages to something like the Rich Text Object, test for a connection, then send the server information. I think I'm a little hung up on the information part because I continually get disconnected after "Checking Identity".
Some tutorials say I need to send "NICK $nickname$" first. Others say I need to send "USER $username$ $localhost$ $server$ :$realname$" first. During testing, I was able to get as far as the "PING: 39849023" responses, but I can't figure out how to reply with "PONG: 39849023" to confirm the connection and allow me to join a channel. Usually the "PING" goes without a response and I get disconnected again.
This is what I've got:
Start of Frame:
MooSock -> Select socket at index 0;
Connect Button Clicked:
MooSock -> Connect to "irc.dal.net" on port 6667;
MooSock On Received:
MooSock -> Accept;
Rich Text Object -> Set text to GetText$( "Rich Edit Object", 0, GetNChars( "Rich Edit Object" ))+RecvLine$( "MooSock" )+NewLine$;
MooSock On Connect:
MooSock -> Send Text Line "NICK " +Edittext$("Username_Editbox");
MooSock -> Send Text Line "USER "+Edittext$( "Username" )+" "+GetLocalIP$( "MooSock" )+" MMFclient"+" :Grim Client";
MooSock on Disconnect:
Rich Text Object -> GetText$( "Rich Edit Object", 0, GetNChars( "Rich Edit Object" ))+"Disconnected!"+NewLine$;
Compare two General Values: Left$(RecvLine$( "MooSock" ), 4)="PING":
MooSock -> Send Text Line "PONG"+Right$(RecvLine$( "MooSock" ), Len(RecvLine$( "MooSock" ))-4);
Rich Text Object -> GetText$( "Rich Edit Object", 0, GetNChars( "Rich Edit Object" ))+"PONG"+Right$(RecvLine$( "MooSock" ), Len(RecvLine$( "MooSock" ))-4)+NewLine$;
Disconnect Button Clicked:
MooSock -> Disconnect.
What am I doing wrong here? Anybody mind cluing me in?
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?