Sign in to follow this  
Followers 0
PcExpert

MSN Bot

14 posts in this topic

Hello,

I was wondering if it's already possible to make an MSNBot in AutoIt, because I just read somewhere on the forum that someone was planning to make a MSN UDF, or it's already done, because I read that some months ago.

Thanks,

PcExpert

Share this post


Link to post
Share on other sites



You might want to take a look at This



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Thanks, the thing I tried is this:

Opt("WinTitleMatchMode", 2)

WinWaitActive(" - Gesprek")

Sleep(1000)

send("Hello {ENTER}")

But for me it was quite difficult to find out when the user types something back. I installed MSN Plus so I can give the users custom names. I've done that. But now I've still got one problem: Howto know when to read the conversation history file. The filename is not difficult. Only WHEN to read it. Does somebosy have an idea for that?

Share this post


Link to post
Share on other sites

For now the bot only works with Windows Messenger, because I can't figure out how to read the text when using MSN Messenger 7.5.

Share this post


Link to post
Share on other sites

i dont use MSN and i hate MSN messenger , but is there a chance that theres a log chat option, and i think MSN uses well TCP of course so im sure you can use those to monitor it and check for incoming packets, and yeah :D thats if you know how to do that stuff

Share this post


Link to post
Share on other sites

just out of curiosity can autoit send and recive packets?


Share this post


Link to post
Share on other sites

but is there a chance that theres a log chat option

By default, this option is enabled.

The logs are found at:

C:\Documents And Settings\<Username>\My Documents\My Recieved Files\

Then go to the folder that starts with the first portion of your Windows Live! Passport. For example my passport is nfwu@xxxxxxx.com (replace the x's with hotmail), and my folder is called nfwu888931311.

In that folder, you'll see another folder called history. Open it.

There you will find the logs. For example, when I chat with Chris, the log file is called chris95219506119844.xml

Enjoy!

#)

Share this post


Link to post
Share on other sites

Thanks, but how does the Bot know then he has to read the history? If I use Windows Messenger I can get the text that is typed by the user with the window info tool. But Ican't do it like that way with Windows Live Messenger or MSN Messenger.

Share this post


Link to post
Share on other sites

Try communicating directly using the MSN Messenger protocol instead then.

#)

Like he knows what your talking about :D

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Hi all!

I have fixed the the first reply. This is the code:

Opt("WinTitleMatchMode", 2)

While 1
If WinExists(" - Gesprek") Then
ControlSend(" - Gesprek", "", 1, "hey, hoe gaat het? {ENTER}")
WinClose(" - Gesprek")
EndIf
WEnd
 oÝ÷ Ø­"¶k¬¶·vØ^­êeÉúèØ^ºÇ«Ju׶¬r^jëh×6WinWait(" - Gesprek")
WinActivate(" - Gesprek")
$txt = WinGetText(" - Gesprek")
If $txt = "goed" Then
ControlSend(" - Gesprek", "", 1, "OK, das mooi! {ENTER}")
WinClose(" - Gesprek")
Else
ControlSend(" - Gesprek", "", 1, "Oow, das jammer {ENTER}")
WinClose(" - Gesprek")
EndIf

But the reply part (the second part) doesn't work, if the users says "goed" then it reply's with this: Hey, hoe gaat het?. What's wrong?

Edited by PcExpert

Share this post


Link to post
Share on other sites

because you put the winwait in a loop and never added an exitloop, (autoit doesnt support multi threading) and you cant do more then 1 thing at once, unless you made a loop and put multiple functions in it i think thats one way, plus your searching for the same window to be active thats going to be a lil hard to do unless you go about getting the amount of control ID's on the page and then see if there are that many.

maybe? using ur code itll just wait for it then send the whose there then close the window, then call the thing and wait for the window to exist(the person to reply)

Opt("WinTitleMatchMode", 2)
While 1
    If WinExists(" - Gesprek") Then
        ControlSend(" - Gesprek", "", 1, "hey, hoe gaat het? {ENTER}")
        WinClose(" - Gesprek")
        Message()
    EndIf
WEnd
Func Message()
WinWait(" - Gesprek")
WinActivate(" - Gesprek")
If WinGetText(" - Gesprek") = "goed" Then
ControlSend(" - Gesprek", "", 1, "OK, das mooi! {ENTER}"); it has a control id of x)?
WinClose(" - Gesprek")
Else
ControlSend(" - Gesprek", "", 1, "Oow, das jammer {ENTER}")
WinClose(" - Gesprek")
EndIf
Endfunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0