Xichael Posted February 24, 2008 Posted February 24, 2008 I'd like to write a script that will run one function upon pressing an assigned hotkey, then run a different function upon a second pressing. How would I achieve this?
Achilles Posted February 24, 2008 Posted February 24, 2008 Global $det HotKeySet('a', '_Function') While 1 Sleep(200) WEnd Func _Function() If $det then _FuncOne() Else _FuncTwo() EndIf $det = Not $det EndFunc Func _FuncOne() Msgbox(0, '', 'Hello!') EndFunc Func _FuncTwo() Msgbox(0, '', 'Goodbye!') EndFunc My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
jokke Posted February 24, 2008 Posted February 24, 2008 Looks like im too late to post but well here it is.... HotKeySet("+!d", "multifunc") ;Shift-Alt-d Global $lastfunc = 0 While 1 Sleep(25) ;take some off the cpu load... WEnd Func multifunc() If $lastfunc = 0 Or $lastfunc = 1 Then func_2() $lastfunc = 2 Else func_1() $lastfunc = 1 EndIf EndFunc Func func_1() ConsoleWrite("Func 1..." & @CRLF) EndFunc Func func_2() ConsoleWrite("Func 2..." & @CRLF) EndFunc UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Xichael Posted February 24, 2008 Author Posted February 24, 2008 (edited) Thanks, works like a charm... Here's what I've made with it. Edited February 24, 2008 by Xichael
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now