Juzzz Posted March 13, 2009 Share Posted March 13, 2009 (edited) The idea came by the father of my Girlfriend who sometimes forget to shutdown his work PC at his work with msn live messenger online.He does not have remote access to it, so i thought i try something with AutoIT.I am just starting with this script language so don't blame me on mistakes the idea on paper was:every day on 18:00 hours an script is going to run.that script wait till some one say something on msn live messenger.he compares the word that is send and looks if its the same as "shutdownplz".if thats true, shutdown the pc.scripttime:you only need to click the start script, and it needs an password.startscript:FileCopy(@ScriptDir & "\Msn_shutdown_pc.exe", "C:\AutoIT_Juzzz\", 8) Run(@ComSpec & " /c " & 'schtasks /Create /SC DAGELIJKS /st 18:00:00 /TN shutdownPC /TR C:\AutoIT_Juzzz\Msn_shutdown_pc.exe')oÝ÷ Ù°¶æ¥±È©·öÚºÚ"µÍÛÝN^[ÝH]HÈ]HHÜ[Û ][ÝÜÙYH^HÝÛÛØ][Û[H]ÈÛÝØ][Û][ÝÈÑÂBXØ]ÙH[ÝHÛÌÎNÝØ[HØÜXYHÝXXHÚ]ÝÛÛÛ[X[[H ÌÍÐÛÚ[HBBBBBBBBBBBBBBBNÕØZ]Ü[ÛÛØ][ÛYÚ[^ÝÊ ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊH[Ð]]ÐÝ B[ÙBÛY L B[YÑ[[ÈÐ]]ÐÝ BYÝÚ[XÝ]J ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊH[BBBNÒYÝXÝ]]HHÚ[ÝÂÚ[XÝ]]J ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊB[YYÝÚ[Ù]Ý]J ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊHHÌ[BNÒYÝX^[Z^HHÚ[ÝÈ ÙÈÝÛÜÈÜYKBÚ[Ù]Ý]J ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝË ][ÝÉ][ÝËÕ×ÓPVSRVJB[Y ÌÍÔÜÈHÚ[Ù]ÜÊ ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊBBBBBNÑÙ]HÚ[ÝÈÝ[ÜÚ][Û[ÝÙPÛXÚÊ ][ÝÜ[XI][ÝË ÌÍÔÜÖÌJÌÌ ÌÍÔÜÖÌWJÌÌK BBNÓ[ÝÙZÛXÚÈHÚ[ÝÈÜÚ][Û [ÈJH]Ý[ ÈÌÙ[ ][Ý×I][ÝÊBÙ[ ][Ý×É][ÝÊBBBBBBBBBBBBBNÐÛÜHHÚÛH^ ÌÍÐÛHÛÙ] BYÝ[ÔYÑ^ ÌÍÐÛ ][ÝÜÚ]ÝÛ][ÝÊHHYHÜÝ[ÔYÑ^ ÌÍÐÛ ][ÝÜÚ]ÝÛÜ][ÝÊHHYH[BNÓÛÚÜÈYHÚÛH^ÛÛ]Z[ÈHÜXÚYXÈÛÜ[ÛÛTÜXÈ [È ][ÝÈØÈ ][ÝÈ [È ÌÎNÜÚ]ÝÛÈY]ÌXÈ ][ÝÐÛÛ]ÈÚ]ÝÛY]]ÛX]XÛHH]]ÒU*R^][ÝÉÌÎNË ][ÝÉ][ÝËÕ×ÒQJHÔÚ]ÝÛÈHÂÚ[ÛÜÙJ ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊB[ÙBÚ[ÛÜÙJ ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊBBBBBBNÒQHÛÛ]Ø][ÛÙÈÝÛÛZ[HÜXÚYXÈÛÜÛÜÙHHÚ[ÝÝÂ[Y[[Msn_shutdown_pc.zip Edited March 14, 2009 by Juzzz Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 13, 2009 Share Posted March 13, 2009 Hi, I guess it is easier to use TeamViewer or just use a script that runs as a task ... Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
jennico Posted March 13, 2009 Share Posted March 13, 2009 (edited) i think this is a sweet idea, if it's working. (maybe i'll try it one day) good idea anyway. one could really use this e.g. for remotely observating his home by using the webcam. hmmmmmm...... interesting. j. but: mustn't the conversation window be opened before ? how can you manage this ? alternatively, you could search the small popup notice window down on the right when someone's "knocking the door". Edited March 13, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted March 13, 2009 Share Posted March 13, 2009 has been done before, more or less. look here Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
James Posted March 13, 2009 Share Posted March 13, 2009 Would be good if MSN had some sort of proper API. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
jennico Posted March 13, 2009 Share Posted March 13, 2009 yes, but autoit was natively made for this kind of window manipulation. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
Juzzz Posted March 14, 2009 Author Share Posted March 14, 2009 got a new script its added as an edit but here it is again: ;note: you have to have the option "see my last conversation in a new coversation" OFF ; cause you don't want the script read the last maby shutdown command. Dim $Clip While 1 ;Wait for an conversation If WinExists("[CLASS:IMWindowClass]") Then _AutoBot() Else Sleep(1000) EndIf WEnd Func _AutoBot() If Not WinActive("[CLASS:IMWindowClass]") Then ;If not activate the window WinActivate("[CLASS:IMWindowClass]") EndIf If Not WinGetState("[CLASS:IMWindowClass]") = 32 Then ;If not maximize the window (does not work for me..) WinSetState("[CLASS:IMWindowClass]", "", @SW_MAXIMIZE) EndIf $Pos = WinGetPos("[CLASS:IMWindowClass]") ;Get the window curent position MouseClick("primary", $Pos[0]+300, $Pos[1]+300, 1, 20) ;Mouseklick the window position (x & y) at curent + 300px send("^a") send("^c") ;Copy the whole text $Clip = ClipGet() If StringRegExp($Clip, "shutdownplz") = True Or StringRegExp($Clip, "shutdownplz/r") = True Then ;Looks if the whole text comtains a specific word Run(@ComSpec & " /c " & 'shutdown -s -f -t 30 -c "Computer is shutdowned automaticly by AutoIT ©Juzzz"', "", @SW_HIDE) ;Shutdowns the pc WinClose("[CLASS:IMWindowClass]") Else WinClose("[CLASS:IMWindowClass]") ;IF the comversation does not contain the specific word, close the windoww EndIf EndFunc Link to comment Share on other sites More sharing options...
yehia Posted March 14, 2009 Share Posted March 14, 2009 (edited) would be far away better if we can get microsoft active accessibility dll call working in autoit tried it before but had to do that dll call via basic Edited March 14, 2009 by yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
Zenhari Posted June 26, 2009 Share Posted June 26, 2009 hi sir, can u help me to write this script via yahoo! messenger? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now