I would go with Perl... the way you're doing it, it seems like instead of having a *real* bot that has TCP connections to the MSN servers for itself, it just acts as a kind of automated script that runs on your computer, and automatically types in messages to send? This method is horribly inefficient, because you wouldn't be able to use that computer to do anything else while your bot is running. There's also the problem of unexpected windows opening up, such as something for Microsoft Updates, while your bot *thinks* it's typing in an MSN convo window... and if it "types" the wrong keys when the wrong window is up it could cause a few headaches for you.
So, go with a REAL bot that actually connects to the MSN servers on its own, not one that just automates things by actually interacting with the official MSN client. _________________ Current Site (2008) http://www.cuvou.com/
basically i just started finding this interesting and im pretty good at coding in VB which is why i didnt really want to learn another language from scratch and get all the neccesary stuff because i dont really have time to learn it
but i can connect to teh msn server through a VB control right?
so is it possible to send commands to the server using vb and a tcip (or whatever control it is, cant rember name sorry) control without the need for a msn window to be open?
thanks for the reply btw
if i have time i might try looking into perl
You can write code for the TCP/IP stuff, but that implies researching the MSN protocol to know what kinds of packets it sends and expects to receive back, and doing all that research would take a lot more time than it would to just learn Perl, considering Perl already has a module that handles the talking to the MSN server for you, and you only have to focus on what your bot *does*, not worry about all the technical details about *how* it does it (as far as the MSN protocol goes). _________________ Current Site (2008) http://www.cuvou.com/
CGI and Perl are both the same thing, just CGI is what it's called when you use it online.
You'll need to tweak the code a little bit to run on a web server. For one, the bot will have to run in a new process, not a CGI script directly... i.e. if bot.pl runs the bot, you wouldn't get very far by going to http://example.com/bot.pl to run it.
The reason being, CGI scripts aren't expected to run forever. They're expected to run long enough to do what they need to do and then send you a webpage (or other file type) and finish. CGI scripts that run forever tend to take up a whole lot of CPU, and eventually the server might kill it if it takes too long.
So, you'll probably want to make a kind of CGI front-end to start/stop the bot in a new process. A real simple way to start the bot....
start.cgi
Code:
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
# start the bot in a new process
system ("perl bot.pl &");
# send a webpage
print qq~Content-Type: text/html
<html>
<body>
The bot has been started.
</body>
</html>~;
That should do the trick... but then you won't be able to shut the bot down. So, you'd want to modify the template and have it write its own PID to a file, so that a "stop.cgi" could look up the PID and kill it if you need to.
Make sure it's okay with your web host to run a bot on their servers, though. _________________ Current Site (2008) http://www.cuvou.com/
Private Sub msn_OnTextReceived(ByVal pIMSession As Messenger.IMsgrIMSession, ByVal User As Messenger.IMsgrUser, ByVal bstrMsgHeader As String, ByVal bstrMsgText As String, pfEnableDefault As Boolean)
Select Case bstrMsgText
Case "hello"
User.SendText bstrMsgHeader, "[BOT]hello", MMSGTYPE_ALL_RESULTS
Case "goodbye"
User.SendText bstrMsgHeader, "[BOT]later", MMSGTYPE_ALL_RESULTS
End Select
End Sub
note you wont be able to see when it replys so just add a textbox set its ultiline property to true and when your bots function to reply to a messageis called add sumthing like 'text1.seltext = bstrmsgheader'
and useing it this way instead of sendkeys means you can do watever you want at the same time it is all behind the scenes
enjoy