Jump to content

Toggle between two functions with one hotkey...


Xichael
 Share

Recommended Posts

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...