Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi Functions
#1
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
#2
Function SingleFunc
Code:
Copy      Help
__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

Code:
Copy      Help
SingleFunc

at the beginning of each function, and it will end the function if some function that also has this line is running.
#3
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"
#4
No. Create function SingleFunc, and put just single word SingleFunc in each your function.
#5
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"
#6
yes
#7
tyvm bro Big Grin your so smart Big Grin also ty for the fast replys Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)