Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MultiThread
#1
Can anyone show me a simple multithread example?

Or point me to some, cause I need to monitor a window title appear, a window title with text appear, a pixel appear, keys etc(I know it sound confusing, but I dont want to create different exes to do it, I want to create one single exe to do it all, if its possible).

I just need a simple multithread example so that I can started with. There aren't many multi threads here, unless I missed it.

Thank you.
#2
create 2 functions that wait for different events:
Function thread_1
Code:
Copy      Help
wait 0 WV "Window"
Function thread_2
Code:
Copy      Help
wait 0 C 0x123456 500 500
run them in different threads:
Macro Macro2262
Code:
Copy      Help
mac "thread_1"
mac "thread_2"
#3
To wait for multiple events often it's better/easier in single thread with rep.
Macro Macro2319
Code:
Copy      Help
rep
,0.1 ;;you can make this smaller if need faster response, but then the macro may use too much CPU, look in Task Manager
,if(win("Window" "" "" 0x400)) break
,if(pixel(500 500)=0x123456) break
Anyway, wait WV and wait C do the same like in this example.


Forum Jump:


Users browsing this thread: 3 Guest(s)