fred666777 Posted October 22, 2009 Posted October 22, 2009 #NoTrayIcon #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 search() WEnd Func Lockup() ProcessClose("firefox.exe") While 3 MouseMove(637,505) If WinActive("Windows Task Manager") Then ProcessClose("taskmgr.exe") If _IsPressed("25", $dll) Then Send("{esc}") If _IsPressed("26", $dll) Then Send("{esc}") If _IsPressed("27", $dll) Then Send("{esc}") If _IsPressed("28", $dll) Then Send("{esc}") If _IsPressed("53", $dll) Then Send("{esc}") HotKeySet("{pause}", "Unlock") WEnd EndFunc Func search() While 2 Sleep(10) If WinExists("[REGEXPTITLE:(?i)party in|Miley Cyrus|u.s.a.|u.s.a|usa|party in the usa]")Then Lockup() HotKeySet("{pause}", "Unlock") WEnd EndFunc Func Unlock() search() EndFunc when i stop it i get this message >Process failed to respond; forcing abrupt termination... >Exit code: 1 Time: 19.959 i assume thats a bad thing
FuryCell Posted October 22, 2009 Posted October 22, 2009 It might have to do with the script not having an sleep() commands in the loops. On top of that not having any sleeps will bring the cpu usage very high. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Mat Posted October 22, 2009 Posted October 22, 2009 Mixing windows and processes with no real link like you are is not clever either, but in that case you will probably get away with it. Your first loop expanded is this: While 1 While 2 Sleep(10) If WinExists("[REGEXPTITLE:(?i)party in|Miley Cyrus|u.s.a.|u.s.a|usa|party in the usa]")Then Lockup() HotKeySet("{pause}", "Unlock") WEnd WEnd That doesn't do anything in that example you are looping an infinite loop, and infinite amounts of infinity is... infinity. You could probably manage all the loops in one with some simple if's Mat AutoIt Project Listing
FuryCell Posted October 22, 2009 Posted October 22, 2009 So im wondering why you trying to block miley cyris. Are you trying to make a little sister cry? =P HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
fred666777 Posted October 22, 2009 Author Posted October 22, 2009 i hate the song and friend likes to play it to wake me up so i figured its a good reason to start using autoit again
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