Jump to content

Recommended Posts

Posted

#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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...