Jump to content

Very simple MSN script


Zompy
 Share

Recommended Posts

My first real script, though, i think it's nice

HotKeySet("{F1}", "Mail")

HotKeySet("{F2}", "Pass")

Func Mail()

;Enter your mail under this

Send(" XX@XX.XX")

EndFunc

Func Pass()

;Enter your password under this

Send("XXXXXX")

EndFunc

Run ("C:\Program Files\Windows Live\Messenger\msnmsgr.exe")

Winwaitactive ("Windows Live Messenger")

Send ("{F1}")

Sleep ("10")

Send ("{TAB}")

Sleep ("10")

Send ("{F2}")

Sleep ("10")

Send ("{ENTER}")

Winwaitactive ("Windows Live Messenger")

Link to comment
Share on other sites

  • Developers

What should this do in your oppinion ? sleep("10")

Also why set hotkeys and use a Send() in stead of sending the needed info directly?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

My first real script, though, i think it's nice

HotKeySet("{F1}", "Mail")

HotKeySet("{F2}", "Pass")

Func Mail()

;Enter your mail under this

Send(" XX@XX.XX")

EndFunc

Func Pass()

;Enter your password under this

Send("XXXXXX")

EndFunc

Run ("C:\Program Files\Windows Live\Messenger\msnmsgr.exe")

Winwaitactive ("Windows Live Messenger")

Send ("{F1}")

Sleep ("10")

Send ("{TAB}")

Sleep ("10")

Send ("{F2}")

Sleep ("10")

Send ("{ENTER}")

Winwaitactive ("Windows Live Messenger")

It didn't work good without the sleep, so i give it a little sleep so it could TAB better.

The hotkeys, well, thats actually for when your using lonegr scripts, if i want to imporve this script later on

and it is getting better, it's more Handy to use that then to edit all the script.

Also if you use that multiple times you've got toe dit it multiple tims, now only Once.

Link to comment
Share on other sites

  • Developers

It didn't work good without the sleep, so i give it a little sleep so it could TAB better.

The hotkeys, well, thats actually for when your using lonegr scripts, if i want to imporve this script later on

and it is getting better, it's more Handy to use that then to edit all the script.

Also if you use that multiple times you've got toe dit it multiple tims, now only Once.

Sleep() takes a number as parameter not a string. So you probably want to do something like Sleep(50)

As far as the HotKeys. I don't really understand what your explanation has to do with using hotkeys.

Just put the Emailaddress and password in a variable at the start of the script and use these variables in the Send() command further on in your script.

$Email = "XX@XX.XX"
$password = "XXXXXX"
;
Run ("C:\Program Files\Windows Live\Messenger\msnmsgr.exe")
Winwaitactive ("Windows Live Messenger")
Send ($Email)
Sleep (50)
Send ("{TAB}")
Sleep (50)
Send ($password)
Sleep (50)
Send ("{ENTER}")
;

Ideally you would use Control() commands to enter the information in the login screen.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

just a hint for future reference YOU MIGHT get a better and nicer response to your scripts if you used

Example
for your code.... and nice manipulation, but where is the WHILE WEND..... and good luck making it better! :P

EDIT

saw your winwait() sorry never mind the while wend!

Edited by CodyBarrett
Link to comment
Share on other sites

  • Developers

just a hint for future reference YOU MIGHT get a better and nicer response to your scripts if you used ....

:P ... are you telling me I wasn't nice enough in my responses or they were not good? Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

haha nope.. just that sometimes people get annoyed with the lack of proper code brackets.. there are quit afew posts where ive seen people yelling at the new scripters... i thought i would give a hint :P

Link to comment
Share on other sites

heres an idea

use controlclick(). it helps reduse problems. its simple enought to get the control ID useing "autoit window info.exe"

also included the hotkey, don't really need it tho. F2

hotkeyset("{F2}","imafoo")

Global $Email = "XX@XX.XX"
Global $password = "XXXXXX"

func imafoo()
Run ("C:\Program Files\Windows Live\Messenger\msnmsgr.exe")
Winwaitactive ("Windows Live Messenger")
controlclick("","",<ID NUMBER>);get id of email box
Send ($Email)
Sleep (50)
controlclick("","",<ID NUMBER>);get id of password box
Send ($password)
Sleep (50)
controlclick("","",<ID NUMBER>);get id of login button
exit
endfunc

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

No offense, but there's nothing simple about WLM controls... :D There a few object oriented functions that could do the job better though, I've been doing a little testing myself... :o

99% of your control classes are going to return "DirectUIHWND" with an irrelevant ControlID... I say Irrelevant because the "DirectUIHWND" isn't going to give you anything better than a Control that covers the entire Messenger window... :( . Making a specific controlclick() or other control related task somewhat difficult... :D

http://www.autoitscript.com/forum/index.php?showtopic=10339

Some work for WLM, and some don't... After looking at MSDN for literally hours, among other resources, I did manage to find an 'AutoSignin' function, as well as a 'Signin', but I've not had the chance to test them... :P

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

As shown in your first post you are using "Windows Live Messenger". As I stated above, control clicks aren't going to help you with WLM unless you use coordinates, if your going to use Coordinates you might as well use 'MouseClick()' because your not going to be able to set the text using Control Commands.

If your doing this on a personal level, you can try something like this...

ControlClick("Windows Live Messenger","","[CLASS:DirectUIHWND]","Primary",1,247,240)oÝ÷ Ù8Z·
+Çè¬Æ¢Ýv­zÆî·¥j+zØZX¤z§¢Ü(®Gè¯*.jÂ7ök.­ì«Þv'ßz·§¶Ç+yéëzÊ%ºØ¨Æ§uØ}êÞÚÞ«b½ç(¢·b«^±Û¶b}÷«zw²)躹²Ç§êìþØ^ë?z×¢¹¶¡×nÞrXËazë®v¦yøÚ'1ë,zx­6¤x*+©èßÛvø¬y©Ý$jÚ®¢Ð.-Z)Ý£'~®¢Ûh¢[ajܲ)Üç^Â+aÊ«ëh"ا²Ö¥«b¢r-Â)emæ ­æ­éijëh×6ShellExecute(@ProgramFilesDir & "\AutoIt3\AutoIt3.chm")
Run(@ProgramFilesDir & "\AutoIt3\Au3Info.exe")

This is some powerful code, try running it if you get into any trouble...

Edited by BinaryBrother

SIGNATURE_0X800007D NOT FOUND

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...