1

Тема: AHK: Loop и Area в одном скрипте

Доброго времени суток, накидал себе такой скрипт и либо работает area либо loop, не могу понять как сделать чтоб они работали вместе.

Hours:= 0
Minutes:= 0
Seconds:= 0
Counter:= 0

Gui, +ToolWindow +AlwaysOnTop
Gui Font, s9, Verdana s13
Gui Add, Text, vHours x8 y56 w27 h23 +0x200 +Center, %Hours%
Gui Add, Text, x32 y56 w14 h23 +0x200 +Center, :
Gui Add, Text, vMinutes x40 y56 w27 h23 +0x200 +Center, %Minutes%
Gui Add, Text, x64 y56 w14 h23 +0x200 +Center, :
Gui Add, Text, vSeconds x72 y56 w27 h23 +0x200 +Center, %Seconds%
Gui Add, Text, x8 y8 w80 h23 +0x200, Отредаченно:
Gui Add, Text, VCounter x88 y8 w12 h23 +0x200 +Left, %Counter%
Gui Add, Text, x8 y32 w92 h23 +0x200 +Center, Активность:
Gui, Show,, WNh

area1 := {left: 747, top: 608, right: 883, bottom: 655}

#If area := MouseInArea(area1)
~LButton::
   if (area = 1) {
    GuiControlGet, Counter
    Counter := Counter + 1
    GuiControl,, Counter, %Counter%
    IniWrite, %Counter1%, data/WNh.egl, WNh, Counter
   }
Return

MouseInArea(areas*) {
   CoordMode, Mouse
   MouseGetPos, x, y
   for k, area in areas {
      if (x >= area.left && x <= area.right && y >= area.top && y <= area.bottom)
         Return k
	}
}

Loop, 
{
    Loop,60
    {
        Loop,60
        {
        GuiControlGet, Seconds
        Seconds := Seconds + 1
        GuiControl,, Seconds, %Seconds%
        sleep 1000
        }
    GuiControlGet, Minutes
    Minutes := Minutes + 1
    GuiControl,, Minutes, %Minutes%
     GuiControlGet, Seconds
     Seconds := Seconds = 0
     GuiControl,, Seconds, %Seconds%
    }
    GuiControlGet, Hours
    Hours := Hours + 1
    GuiControl,, Hours, %Hours%
     GuiControlGet, Minutes
     Minutes := Minutes = 0
     GuiControl,, Minutes, %Minutes%
}

2

Re: AHK: Loop и Area в одном скрипте

Пара примеров:

Gui, Show, w300 h300
Return

Loop {
   MsgBox, % A_Index
}
Gui, Show, w300 h300

~LButton::
   MsgBox, % A_ThisHotkey
   Return

Loop {
   MsgBox, % A_Index
}

Цикл выполняется? Как думаете, почему?

Разработка AHK-скриптов:
e-mail dfiveg@mail.ru
Telegram jollycoder