View Full Version : VB.net Sockets
Markpyro
12-16-2006, 11:03 PM
I need a tutorial or code sample or VB.net sockets in use- I want to make a really simple IRC bot that can connect to a server and record the text, but in getting there, I need to figure out how to connect in the first place. I've been through Google and it hasn't helped- nothing works, the code I get from tutorials gives me tons of errors.
It's really frustrating when I cant find something simple >.>
-MP
http://pyrom.net/sigs/manual/hr.png
http://pyrom.net/sigs/manual/sigimage.png
*http://pyrom.net/test/blamecountimage.php*http://pyrom.net/test/lastblameimage.php*
http://pyrom.net/test/blameclick.png (http://pyrom.net/test/blame.php)
Modred
12-16-2006, 11:37 PM
I can't help you with the socket programming, but I did find a tutorial for .NET socket programming that looks pretty good (http://www.ondotnet.com/pub/a/dotnet/2002/10/21/sockets.htm). I don't currently have VB.NET available on this computer, otherwise I would go in and try some of the code from that tut and let you know how it came out.
If you need help with the IRC protocol and such then I'd be glad to help. I've been going through all of this trying to get a bot up and working in Python. You might find the following links useful:
RFC 1459 - The IRC Protocol (http://www.irchelp.org/irchelp/rfc/rfc.html)
CTCP Specification (http://www.irchelp.org/irchelp/rfc/ctcpspec.html)
If you can figure out how to actually get a socket working to a server, identifying yourself usually starts with sending a NICK command first, then a USER command to fill in your userinfo. I could share some of the Python code that I'm using, but that wouldn't help much unless you know Python. Sorry I can't be of more help.
Oh, and don't forget to terminate every command you send with a carriage return and a linefeed. In C, Python, Javascript, and most languages I've used, it would be \r\n. I'm sure you can figure out what I mean if you don't know already.
Markpyro
12-21-2006, 2:57 PM
I hate sounding like an idiot, but I cant get anything to work. All the examples I'm given don't work, they say they do but I paste the code and I get loads of errors. I don't understand why it would be more complicated. Bah, I'm giving up.
http://pyrom.net/sigs/manual/hr.png
http://pyrom.net/sigs/manual/sigimage.png
*http://pyrom.net/test/blamecountimage.php*http://pyrom.net/test/lastblameimage.php*
http://pyrom.net/test/blameclick.png (http://pyrom.net/test/blame.php)
Modred
12-21-2006, 3:38 PM
I'm downloading VB Express as I type this. I'll try to get some code working, then post it here to give you a base to start on.
I found http://msmvps.com/blogs/plenderj/rss.aspx?Tags=.NET+VB+IRC&AndTags=1. It's a bot written in VB.Net. It compiled just fine in my freshly installed VB Express 2005, and looks like it might be helpful.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.