ReaImDown Posted May 31, 2007 Share Posted May 31, 2007 this script only works sometimes, its odd and picky lol $Sleep = Random(1 * 1000, 20 * 1000, 1) $RSleep = ($Sleep + Random(1 * 1000, 20 * 1000, 1)) $i = 1 Do If WinActive("Mozilla") Then If WinActive("Facebook") Then ;Sleep($RSleep) WinClose("Facebook") msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting") ElseIf WinActive("MySpace") Then ;Sleep($RSleep) WinClose("MySpace") msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting") EndIf EndIf If WinActive("Internet Explorer") Then If WinActive("Facebook") Then ;Sleep($RSleep) WinClose("Facebook") msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting") ElseIf WinActive("MySpace") Then ;Sleep($RSleep) WinClose("MySpace") msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting") EndIf EndIf Until $i = 0 [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Zedna Posted May 31, 2007 Share Posted May 31, 2007 This is strange: If WinActive("Mozilla") Then If WinActive("Facebook") Then If first If is true then second never be true! Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ReaImDown Posted May 31, 2007 Author Share Posted May 31, 2007 This is strange: If WinActive("Mozilla") Then If WinActive("Facebook") Then If first If is true then second never be true! figured, but how would I go about making it work? lol [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Zedna Posted May 31, 2007 Share Posted May 31, 2007 figured, but how would I go about making it work? lolLook at AdlibEnable() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
1905russell Posted May 31, 2007 Share Posted May 31, 2007 (edited) That Do.. Until seems to be the problem. This works for me. Opt("WinTitleMatchMode", 2) $Sleep = Random(1 * 1000, 20 * 1000, 1) $RSleep = ($Sleep + Random(1 * 1000, 20 * 1000, 1)) HotKeySet("{PAUSE}", "Doit") $i = 1 Do Until $i = 0 Func Doit() If WinActive("Mozilla") Then If WinActive("Facebook") Then ;Sleep($RSleep) WinClose("Facebook") MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting") ElseIf WinActive("MySpace") Then ;Sleep($RSleep) WinClose("MySpace") MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting") EndIf EndIf If WinActive("Internet Explorer") Then If WinActive("Facebook") Then ;Sleep($RSleep) WinClose("Facebook") MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting") ElseIf WinActive("MySpace") Then ;Sleep($RSleep) WinClose("MySpace") MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting") EndIf EndIf EndFunc ;==>Doit Edited June 1, 2007 by 1905russell Link to comment Share on other sites More sharing options...
ReaImDown Posted June 1, 2007 Author Share Posted June 1, 2007 (edited) ty...this works, guess I needed the opt Opt("WinTitleMatchMode", 2) $Sleep = Random(1 * 1000, 20 * 1000, 1) $RSleep = ($Sleep + Random(1 * 1000, 20 * 1000, 1)) $i = 1 Do If WinActive("Mozilla") Then If WinActive("Facebook") Then ;Sleep($RSleep) WinClose("Facebook") msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting") ElseIf WinActive("MySpace") Then ;Sleep($RSleep) WinClose("MySpace") msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting") EndIf EndIf If WinActive("Internet Explorer") Then If WinActive("Facebook") Then ;Sleep($RSleep) WinClose("Facebook") msgbox(0 , "Error,", "Internet Explorer has detected an error in the sites scripting") ElseIf WinActive("MySpace") Then ;Sleep($RSleep) WinClose("MySpace") msgbox(0 , "Error,", "Internet Explorer has detected an error in the sites scripting") EndIf EndIf Until $i = 0 Edited June 1, 2007 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] 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