Posts: 44
Threads: 14
Joined: Nov 2008
hi how can i make it so that if one function is running you cant run any other functions
such as if i have S1 runnign S2 cant run r any of the other 42 other Functions in this macro all S1 - S42
is this posible? and they need 2 be functions i cant chnage them to macros
Posts: 12,073
Threads: 140
Joined: Dec 2002
Function
SingleFunc
__Handle+ __mutex_singlefunction ;;if __Handle is unknown identifier, replace to int
if(!__mutex_singlefunction) __mutex_singlefunction=CreateMutex(0 0 0)
if(WaitForSingleObject(__mutex_singlefunction 0)=WAIT_TIMEOUT) end
Insert
at the beginning of each function, and it will end the function if some function that also has this line is running.
Posts: 44
Threads: 14
Joined: Nov 2008
do i need to put that line on the top ofall the functions like this below?
S1
__Handle+ __mutex_singlefunction ;;if __Handle is unknown identifier, replace to int
if(!__mutex_singlefunction) __mutex_singlefunction=CreateMutex(0 0 0)
if(WaitForSingleObject(__mutex_singlefunction 0)=WAIT_TIMEOUT) end
if(IsWindowVisible(child(15 "5" "Edit" win("New Text Document (7) - Notepad" "Notepad") 0x5)))
OnScreenDisplay "5"
S2
__Handle+ __mutex_singlefunction ;;if __Handle is unknown identifier, replace to int
if(!__mutex_singlefunction) __mutex_singlefunction=CreateMutex(0 0 0)
if(WaitForSingleObject(__mutex_singlefunction 0)=WAIT_TIMEOUT) end
if(IsWindowVisible(child(15 "10" "Edit" win("New Text Document (7) - Notepad" "Notepad") 0x5)))
OnScreenDisplay "10"
Posts: 12,073
Threads: 140
Joined: Dec 2002
No. Create function SingleFunc, and put just single word SingleFunc in each your function.
Posts: 44
Threads: 14
Joined: Nov 2008
so have a function called SingleFunc and put the code in it then in my other functions put SingleFunc on top line? like this
SingleFunc
__Handle+ __mutex_singlefunction ;;if __Handle is unknown identifier, replace to int
if(!__mutex_singlefunction) __mutex_singlefunction=CreateMutex(0 0 0)
if(WaitForSingleObject(__mutex_singlefunction 0)=WAIT_TIMEOUT) end
S1
SingleFunc
if(IsWindowVisible(child(15 "5" "Edit" win("New Text Document (7) - Notepad" "Notepad") 0x5)))
OnScreenDisplay "5"
S2
SingleFunc
if(IsWindowVisible(child(15 "10" "Edit" win("New Text Document (7) - Notepad" "Notepad") 0x5)))
OnScreenDisplay "10"
Posts: 12,073
Threads: 140
Joined: Dec 2002
Posts: 44
Threads: 14
Joined: Nov 2008
tyvm bro
your so smart
also ty for the fast replys