duplicate function

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
choui
Posts: 2
Joined: 05 Mar 2018, 15:50

duplicate function

05 Mar 2018, 16:02

Is it possible to have a function running two times simultaneously?
Would like for my script to not stop eachother progress bars

i.e pressing 1 then 2 doesn't stop progress bar 1

Any help is very appreciated

Code: Select all

1::MyProgress(7600, 200)
2::MyProgress(4300, 250)

MyProgress(seconds, pos){
	static tick,sec,step
	key:=A_ThisHotKey ":"
	tick:=A_TickCount,   sec:=seconds,   step:=1000/sec
	Progress, % key "b" "R0-" 1000 "y" pos "cb800080"
	SetTimer,Update,10
	Return
	Update:
		If (sec<A_TickCount-tick)
			SetTimer,Update,Off
		Progress, % A_ThisHotKey ":"  (A_TickCount-tick)*step
	Return
}

ESC::ExitApp
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: duplicate function

05 Mar 2018, 17:19

You're looking for multi threading and AHK_L can't quite do it normally. AHK_H on the other hand (With a bit of some files and DLLs) it can do multi-threading.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: GEOVAN, RussF and 181 guests