Hi again, simply question about my stupid macro ... can i improve it into one more "professional way" ?
Code: Select all
;###########################################################################
!^+j::
GG_1:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -1210, 193, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3C4B58 or Res = 0x3C4B58){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x470 y167, 1,,,, NA
}
)")
GG_1:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_2:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -650, 193, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3C4B58 or Res = 0x3C4B58){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x470 y167, 2,,,, NA
}
)")
GG_2:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_Alex:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -90, 193, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3C4B58 or Res = 0x3C4B58){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x470 y167, Alex,,,, NA
}
)")
GG_Alex:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_3:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -1210, 559, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3C4B58 or Res = 0x3C4B58){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x470 y167, 3,,,, NA
}
)")
GG_3:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_4:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -650, 559, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3C4B58 or Res = 0x3C4B58){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x470 y167, 4,,,, NA
}
)")
GG_4:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_5:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -90, 559, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3C4B58 or Res = 0x3C4B58){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x470 y167, 5,,,, NA
}
)")
GG_5:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_Buldrain:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -1332, 888, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3D4C59 or Res = 0x3D4C59){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x348 y130, Buldrain,,,, NA
}
)")
GG_Buldrain:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_miniLuigi:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -917, 888, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3D4C59 or Res = 0x3D4C59){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x348 y130, miniLuigi,,,, NA
}
)")
GG_miniLuigi:="" ; Stop execution in thread and free resources.
; #############################################################################################
GG_Empy:=AhkThread("
(
CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
Loop
{
PixelGetColor, Res, -502, 888, RGB ; Colore sfondo fine pacchetti
if(Res = 0x3D4C59 or Res = 0x3D4C59){ ; checks if PACCHETTO are OFF
Sleep 2000
break ; Terminate the loop
}
Sleep 500
ControlClick, x348 y130, Empy,,,, NA
}
)")
GG_Empy:="" ; Stop execution in thread and free resources.
Return