Jump to content

Winactivate not working


rizaru_desu
 Share

Recommended Posts

Hi All,

I'm having a problem where the script use winactivate("program") does not workIt must not be an issue with the window title, does this just happen sometimes with certain type of windows with autoit or is there maybe a common explanation as to why it does this or some work around to get it to work?

#include<ImageSearch2015.au3>

HotKeySet("{F1}", "Start")
HotKeySet("{ESC}", "myExit");

$x1 = 0
$y1 = 0
$x2 = 0
$y2 = 0
$x3 = 0
$y3 = 0
$x4 = 0
$y4 = 0
$x5 = 0
$y5 = 0
$x6 = 0
$y6 = 0
$x7 = 0
$y7 = 0
$x8 = 0
$y8 = 0

While (1)
    Sleep(1)
WEnd

Func Start()
While(1)
    WinActivate("Point Blank")
    ;FIND PUBLIC SERVER
    $resultPS= _ImageSearch("Image/Public Server.PNG",1,$x1,$y1,0)
    if $resultPS=1 Then
    MouseClick("LEFT",$x1,$y1,10)
    Sleep(500)
        ;PUBLIC ENTER
        $resultPE= _ImageSearch("Image/Public Enter.PNG",1,$x2,$y2,0)
        if $resultPE=1 Then
        MouseClick("LEFT",$x2,$y2,10)
        Sleep(500)
            ;SERVER 430
            $result430= _ImageSearch("Image/Server 430.PNG",1,$x3,$y3,0)
            if $result430=1 Then
            MouseClick("LEFT",$x3,$y3,10)
            Sleep(500)
                ;SERVER 430 ENTER
                $result430E= _ImageSearch("Image/430 Enter.PNG",1,$x4,$y4,0)
                if $result430E=1 Then
                MouseClick("LEFT",$x4,$y4,10)
                Sleep(500)
                EndIf
            EndIf
        EndIf
    EndIf
    $resultabsen= _ImageSearch ("Image/Event.PNG", 1, $x5,$y5,0)
    If $resultabsen=1 Then
        $resultcek= _ImageSearch ("Image/Kehadiran.PNG", 1, $x6,$y6,0)
        If $resultcek=1 Then
        MouseClick("LEFT",$x6,$y6,10)
        Sleep(500)
            $resultrecaive= _ImageSearch ("Image/Menerima.PNG", 1, $x7,$y7,0)
            If $resultrecaive=1 Then
            MouseClick("LEFT",$x7,$y7,10)
            Sleep(500)
            Send("{ENTER}")
            Sleep(500)
                $resulttutup= _ImageSearch ("Image/Tutup.PNG", 1, $x8,$y8,0)
                If $resulttutup=1 Then
                MouseClick("LEFT",$x7,$y7,10)
                Sleep(500)
                EndIf
            EndIf
        EndIf
    EndIf
WEnd
EndFunc

Func myExit()
Exit
EndFunc

Thank..

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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