Sign in to follow this  
Followers 0
fred666777

Please Check My Code

5 posts in this topic

#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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0