The following codes in version 5.3.0 do not work properly if block.
Code: Select all
DPManualStart:
WinActivate, DP
Sleep, 333
Input, KEY, L1, , A,B,C,E,F,G,I,i,P,Y,T
If KEY = A
{
Departman := "A"
}
Else
{
If KEY = B
{
Departman := "B"
}
Else
{
If KEY = C
{
Departman := "C"
}
Else
{
If KEY = E
{
Departman := "E"
}
Else
{
If KEY = F
{
Departman := "F"
}
Else
{
If KEY = G
{
Departman := "G"
}
Else
{
If KEY = I
{
Departman := "I"
}
Else
{
If KEY = i
{
Departman := "I"
}
Else
{
If KEY = P
{
Departman := "P"
}
Else
{
If KEY = Y
{
Departman := "Y"
}
Else
{
If KEY = T
{
Departman := "T"
}
Else
{
If KEY != A,B,C,E,F,G,I,Y,P,i,T
{
MsgBox, 48, SELECT DEPARTMAN..!, (A-B-C-E-G-I-P-Y) SELECT..!
Goto, DPManualStart
}
}
}
}
}
}
}
}
}
}
}
}
Send, {Control Down}{o}{Control Up}
Sleep, 100
DepartmanDeployCursor:
If A_CaretX !=
{
Sleep, 200
Send, {Tab}
Sleep, 200
SendRaw, %Departman%+OFFICE
Sleep, 200
Sleep, 300
Loop
{
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, D:\Macros\PMC_images\DPAddButon.png
CenterImgSrchCoords("D:\Macros\PMC_images\DPAddButon.png", FoundX, FoundY)
If ErrorLevel = 0
Click, %FoundX%, %FoundY% Left, 1
Sleep, 200
}
Until ErrorLevel = 0
Sleep, 300
Loop
{
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, D:\Macros\PMC_images\DPWaiting.png
CenterImgSrchCoords("D:\Macros\PMC_images\DPWaiting.png", FoundX, FoundY)
Sleep, 200
}
Until ErrorLevel = 0
If ErrorLevel = 0
{
}
}
Else
{
Goto, DepartmanDeployCursor
}
Sleep, 300
Loop
{
CoordMode, Pixel, Window
ImageSearch, PersonDeployX, PersonDeployY, 0, 0, 1920, 1080, D:\Macros\PMC_images\DPPersonDeploy.png
CenterImgSrchCoords("D:\Macros\PMC_images\DPPersonDeploy.png", PersonDeployX, PersonDeployY)
If ErrorLevel = 0
Click, %PersonDeployX%, %PersonDeployY% Left, 1
Sleep, 300
}
Until ErrorLevel = 0
Sleep, 300
Loop, 2
{
Click, Rel PersonDeployX, PersonDeployY Left, 1
Sleep, 100
}
Sleep, 300
PersonDeployCursor:
Sleep, 300
If A_CaretX !=
{
Sleep, 200
Send, {Tab 2}
Sleep, 200
SendRaw, %Departman%
Sleep, 200
Sleep, 500
Loop
{
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, D:\Macros\PMC_images\DPAddButon.png
CenterImgSrchCoords("D:\Macros\PMC_images\DPAddButon.png", FoundX, FoundY)
If ErrorLevel = 0
Click, %FoundX%, %FoundY% Left, 1
Sleep, 300
}
Until ErrorLevel = 0
Sleep, 300
Loop
{
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, D:\Macros\PMC_images\DPPersonWaiting.png
CenterImgSrchCoords("D:\Macros\PMC_images\DPPersonWaiting.png", FoundX, FoundY)
Sleep, 200
}
Until ErrorLevel = 0
If ErrorLevel = 0
{
}
Click, %FoundX%, %FoundY% Left, 1
Sleep, 10
}
Else
{
Goto, PersonDeployCursor
}
CoordMode, Pixel, Window
ImageSearch, RedX, RedY, 0, 0, 1920, 1080, D:\Macros\PMC_images\DPRedButon.png
CenterImgSrchCoords("D:\Macros\PMC_images\DPRedButon.png", RedX, RedY)
Sleep, 200
If ErrorLevel = 0
{
RedX += 30
Click, %RedX%, %RedY% Left, 1
Sleep, 10
}