User Control Panel
Advertisements

HELP US, HELP YOU!

Using VB messages

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Visual Basic
View unanswered posts
Author Message
ShadowHarlequin
Newbie
Newbie


Joined: 08 Jun 2007
Posts: 8


PostPosted: Sat Jun 09, 2007 2:36 pm    Post subject: Using VB messages Reply with quote

Hi ive read the tutorials and got them working one way or another (i had to change some stuff)

But i cant work out how to do the following
* Auto respond to messages
* Use send keys to send SHIFT+ENTER (new line)

Any help would be awesome, im basically trying to set up an ftp bot for tutorials

Thanks guys Smile
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Sat Jun 09, 2007 3:46 pm    Post subject: Reply with quote

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/
Back to top
ShadowHarlequin
Newbie
Newbie


Joined: 08 Jun 2007
Posts: 8


PostPosted: Sat Jun 09, 2007 6:31 pm    Post subject: Reply with quote

thanks Smile

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 Smile
if i have time i might try looking into perl
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Jun 11, 2007 8:09 pm    Post subject: Reply with quote

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/
Back to top
ShadowHarlequin
Newbie
Newbie


Joined: 08 Jun 2007
Posts: 8


PostPosted: Sat Jun 16, 2007 8:05 pm    Post subject: Reply with quote

thanks i got perl and im trying to get some templates to run (its a bit iffy but does kinda work)

just need to find out how to run them from a webserver now :S can you do that or do you have to convert it to cgi?
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Sun Jun 17, 2007 4:54 pm    Post subject: Reply with quote

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/
Back to top
-DeadRabit-
Newbie
Newbie


Joined: 07 Apr 2007
Posts: 9

Reputation: 4.5Reputation: 4.5Reputation: 4.5Reputation: 4.5
votes: 1

PostPosted: Wed Oct 24, 2007 12:09 pm    Post subject: Reply with quote

auto responder.

Code:

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Visual Basic All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group