Jump to content

msn Conversation window problem.


Recommended Posts

Hello dears,

I am working on an autoresponder for msn.

I need my running script to detect the conversation's window and auto-respond it.

Problem: To make my script detect the msn-conversation's window, I need its title. But every msn contact has his own window title (F.E. Sucker <Sucker@hotmail.com>)

I have used autoit info to take the title, and it gets the same(email). The control ID is not shown(msn's privacy feature).

What I can see with autoit info is the "Class" of the window.

I try to use:

While 1
     If WinExists ("msn-title") then
          controlsend ("msn-title" , "This is an autoresponder. I will talk with you later.")
     Endif
Wend

That "msn-title" is what I seek!

Any help is very appreciated.

Link to comment
Share on other sites

  • Moderators

I believe MSN has its own auto-response option doesn't it?

You could use the search feature to see others that have faced your issue.

http://www.autoitscript.com/forum/index.ph...highlite=%2BMSN

P.S. - What's with "Hello dears"? Makes me feel like my grandmother is posting in here. (creepy)

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.

Link to comment
Share on other sites

It is not built in, but msn has a plugin called "messenger live plus". Google it to find link.

This has a built in auto responder, and allows for user made scripts (like nudges tool script) that are written in javascript

I use it. I like it.

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

Here ya go..! :)

Source :

#Include <String.Au3>
#Include <Date.Au3>
Opt ('WinTitleMatchMode','2')

$Msg = "Sorry, {Name}, I'm afk right now I will be back later."
$Log = @ScriptDir & '\Log.log'

While '1'
$Get = _GetMsnWindow ()
If $Get <> '-1' Then 
$Msg = StringReplace ($Msg, '{Name}', $Get['3'])
WinActivate ($Get['1'])
$Control = ControlGetFocus ($Get['1'])
$Before = ClipGet () 
ClipPut ($Msg)
ControlSend ($Get['1'], '', $Control, '{CtrlDown}{V}')
ControlSend ($Get['1'], '', $Control, '{Enter}')
ControlSend ($Get['1'], '', $Control, '{CtrlUp}')
_Log ('You got a message from ' & $Get['2'] & ':' & $Get['3'] & '.')
ClipPut ($Before)
WinClose ($Get['1'])
EndIf 
Sleep ('150')
WEnd

Func _GetMsnWindow ()
Local $Title, $Email, $Return
$Title = WinGetTitle ('@')
If StringInStr ($Title, '<') <> '0' And StringInStr ($Title, '>') <> '0' Then 
$Email = _StringReverse ($Title)
$Email = StringSplit ($Email, '<')
$Email = _StringReverse (StringReplace ($Email['1'], '>',''))
$Name = StringReplace ($Title, ' <' & $Email & '>','')
Dim $Return['4']
$Return['1'] = WinGetHandle ($Title)
$Return['2'] = $Email
$Return['3'] = $Name
Return $Return
Else 
Return '-1'
EndIf 
EndFunc

Func _Log ($iText)
FileWriteLine ($Log, '[' & _NowTime () & '] ' & $iText)
EndFunc

This will scan for a window with a "@" in the title if it finds one it will then check to see if it has a "<" and a ">" if it masses theses tests it marks it as a msn window... it then will return the handle of the window, the email on the contact, and the name of the contact.

This only works on the new msn where it says name <email>;

Notes :

$Msg is the reply *{Name} will be replaced with the contacts name :party:!

Also it will logs any "messages" it gets (Needed because it has to close the msg window) *$Log is the file at witch it is logged to

Sorry I can't give you more details but I'm in a hurry!

Hope it helps! :idea: ~Enjoy~

- John

Latest Projects :- New & Improved TCP Chat

Link to comment
Share on other sites

Ty guys.

I've tried to search it but I didn't find much information myself. I have searched and found many things, but not like this.

Most I thank John2006 for his source and his explanation.

I already have an autoresponder, but I really wanted to find out how to do it myself, to improve my scripting skills.

thx again John2006. :)

Edited by bilarasgr
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...