• Welcome to Valhalla Legends Archive.
 

IRC Client help

Started by Severance, August 15, 2007, 07:49 PM

Previous topic - Next topic

Severance

Well, ive decided that I would like to have visual basic as a language that I could fairly understand. So ive decided to try to program my own IRC client to get the hang of using the winsock control. So far, I have got the program able to connect to a given server on a given port with a given nickname, and it is able to join channels and send messages throughout the channel. The only thing that I cant figure out how to do now is tell the textbox to display incomming chat messages,  and display the userlist in another text box. I have come up with the code :
winsock.SendData "PRIVMSG" & " " & txtChannel & vbCrLf for the sending of the messages. But would receiving the messages use the same PRIVMSG command, only using GetData instead of SendData work? I hope I worded this right, but any help would be appreciated a lot.

l2k-Shadow



Private Sub Winsock_DataArrival(ByVal bytesTotal as Long)
Dim Data As String
Winsock.GetData Data, vbString, bytesTotal
' Data should hold your incoming message.
End Sub
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Severance

Wow, didnt realize that would display messages too, thanks. But I have one more problem. I want to have two forms for this client. The first form is where the winsock is, and it has all the connection info and stuff. The seccond form is where the chatting goes down, with the userlist and such. My problem is, I do not know how to just display incomming messages in the seccond form. One again I would appreciate if anybody could assist me in this matter, thanks.

l2k-Shadow


FormName.Text1.Text = "Hello"


lol
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Severance

Lol, I know that, but do you know how to put incomming chat messages into the text box?

Severance

Oh nvm, misunderstood for a sec. I got it now though. Thanks for the help.

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Severance

Thanks, I was looking for something like that.

brew

For the output, that simple one-liner isn't going to be enough. I recommend you create a sort of an "AppendText" subroutine which does exactly that, appends the text you want to a multilined textbox. This can easily be done with the .SelStart, .SelText, and .SelLength properties. If you really have trouble with that, too, you should just use debug.print for now, or debug.append. Either works great. It seems that if you are having this much trouble with outputting data, you should work on this before creating a winsock application. Although it does kind of seem as if VB6 isn't your first programming language you've learned.... is this true?
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Severance

Well actually Im new to programming in general. I usually work with web design and fairly understand the language of php. But people have told me that you should start with VB if you want to learn application programming.

rabbit

No.  Wrong.  Fail.  Start with C.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Severance

Is that an easier language?

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Barabajagal

No, VB is probably the easiest language to learn in existence, as well as the most common. The BASIC series was designed as an educational, or introductory language. However, most programmers never move beyond it now because all the other languages are 'too hard', and in reality, VB can do pretty much whatever most programmers want (although not in the most efficient or best ways). C is a more powerful, faster, and universal language. If you have enough willpower, take a VB class and learn VB... use it for 2 years or so, and when you've mastered the basics of application programming, learn another language such as PowerBASIC, C, C++, Java (if you want easy multi-os applications/web applets), etc...

Severance

Sounds good, Ill try to keep all that in mind. Thanks.