J
J
Jasee Cambatch2020-01-05 15:36:01
Macros
Jasee Cambatch, 2020-01-05 15:36:01

How to redirect the received ID further into the code?

The first part of the script is the window and gets its id .
The second part should work in this script, tell me how to take the ID from the first part and paste it in place of% id1%

WinGet, id, list,,, Program Manager
Loop, %id%
{
    this_id := id%A_Index%
    WinActivate, ahk_id %this_id%
    WinGetClass, this_class, ahk_id %this_id%
    WinGetTitle, this_title, ahk_id %this_id%
    MsgBox, 3, 
    , Обход всех окон`n`n%a_index% из %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nПродолжить?
    IfMsgBox No, break
  IfMsgBox Yes, id%A_index%=id1 ; взять значение this_id и вставить в "ahk_id"
  IfMsgBox Cancel, exitapp
}
    

msgbox, ( 1-2-3-4+W ) Aegis Prime  3150ms  F6"Start", F7"Pause".
vk75::
Loop 
If isKeyPressed :=!isKeyPressed

{
  
    

         {      
         ControlSend,, {vk5	7 Down}, ahk_class TargemWindow ahk_id%id1% ; вот сюда , 
         ControlSend,, {vk31 Down}, ahk_class TargemWindow ahk_id%id1% ; вот сюда		
       KeyWait vk75
       Sleep 3150
       ControlSend,, {vk31 Up}, ahk_class TargemWindow ahk_id%id1% ; вот сюда
       ControlSend,, {vk57 Up}, ahk_class TargemWindow ahk_id%id1% ; вот сюда
         } 
 
        {
        ControlSend,, {vk57 Down}, ahk_class TargemWindow ahk_id%id1% ; вот сюда
    ControlSend,, {vk32 Down}, ahk_class TargemWindow ahk_id%id1% ; вот сюда
    KeyWait vk75
    Sleep 3150		
    ControlSend,, {vk32 Up}, ahk_class TargemWindow ahk_id%id1% ; вот сюда
    ControlSend,, {vk57 Up}, ahk_class TargemWindow	ahk_id%id1% 	; вот сюда
        }
   
        {
        ControlSend,, {vk57 Down}, ahk_class TargemWindow ahk_id%id1% ; вот сюда
    ControlSend,, {vk33 Down}, ahk_class TargemWindow ahk_id%id1%  ; вот сюда     		
      KeyWait vk75
    Sleep 3150
    ControlSend,, {vk33 Up}, ahk_class TargemWindow ahk_id%id1% 
    ControlSend,, {vk57 Up}, ahk_class TargemWindow ahk_id%id1% 
        }  
        {     
        ControlSend,, {vk57 Down}, ahk_class TargemWindow ahk_id%id1% 
    ControlSend,, {vk34 Down}, ahk_class TargemWindow ahk_id%id1% 		
        KeyWait vk75
    Sleep 3150
    ControlSend,, {vk34 Up}, ahk_class TargemWindow ahk_id%id1% 
    ControlSend,, {vk57 Up}, ahk_class TargemWindow	ahk_id%id1%  	
        }	
}
   
   
   
return
vk76::Pause

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Korben5E, 2020-06-16
@Korben5E

you just declare a variable in a file and access it from where you need it.
I have a counter for 2 functions.

^#c::
cc=1
while(cc > 0)
................
return

#c::
cc:=0
return

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question