Jump to content

Switcher


Go to solution Solved by SOLVE-SMART,

Recommended Posts

2 minutes ago, ioa747 said:

and it's not what we want?

 

xDD ❤️ 

That's what we want, 

 

But is it possible to have Red Icon after (Click on script / Start script)?

And it's turning blue after first ESC -> Then numlock gives It's a simply question, 

And after second ESC it's red again 😎

Link to comment
Share on other sites

last shot

#include <misc.au3>

Local $Enabled, $SleepTime

$Enabled = True
Enabled()

;************************************************
While 1
    Sleep($SleepTime)
WEnd
;************************************************

Exit

;----------------------------------------------------------------------------------------
Func start() ;
    While $Enabled
        Sleep(10)
        If _IsPressed("90") Then     ; 90 NUM LOCK key
;~          ConsoleWrite(":")

            Sleep(50)
            Send("Its")
            Sleep(200)
            Send("a simply")
            Sleep(200)
            Send("text")
            Sleep(150)


        EndIf
    WEnd
EndFunc   ;==>start
;----------------------------------------------------------------------------------------
Func Enabled()
    If $Enabled = True Then
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico")
        $Enabled = False
        $SleepTime = 1000
    Else
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico")
        $Enabled = True
        $SleepTime = 10
        HotKeySet("{ESC}", "Enabled")
        start()
    EndIf
EndFunc   ;==>Enabled

 

I know that I know nothing

Link to comment
Share on other sites

No, no :D 

Func Enabled()
    If $Enabled = True Then
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico")
        $Enabled = False
        $SleepTime = 1000
    Else
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico")
        $Enabled = True
        $SleepTime = 10
        HotKeySet("{ESC}", "Enabled")
        start()
    EndIf
EndFunc   ;==>Enabled

 

You just changed icon red to True and Blue to False 

 

I wish to have True = Blue, False = Red

But after script start, program is as Red = $Enable = False, So Numlock is dezactive untill i press ESC first time. 

Link to comment
Share on other sites

No I didn't change the icons

i change  the start status in line 6

$Enabled = True and then call Enabled()

which means that it starts off and you have to press esc to be activated

PS

If you don't want it and you want to start activated just comment the line 6 to

; $Enabled = True

Edited by ioa747

I know that I know nothing

Link to comment
Share on other sites

hmm you have right wait..

HotKeySet("{ESC}", "Enabled")  come out of the if statement

Func Enabled()
    If $Enabled = True Then
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico")
        $Enabled = False
        $SleepTime = 1000
    Else
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico")
        $Enabled = True
        $SleepTime = 10
        start()
    EndIf
    HotKeySet("{ESC}", "Enabled")
EndFunc   ;==>Enabled

 

Edited by ioa747

I know that I know nothing

Link to comment
Share on other sites

#include <misc.au3>

Local $Enabled, $SleepTime
start()
Enabled()

While 1
    Sleep($SleepTime)
WEnd

Func start() ;
    While $Enabled
        Sleep(10)
        If _IsPressed("90") Then     ; 90 NUM LOCK key
            Sleep(50)
            Send("Its")
            Sleep(200)
            Send("a simply")
            Sleep(200)
            Send("text")
            Sleep(150)
        EndIf
    WEnd
EndFunc   ;==>start

Func Enabled()
    if $Enabled = True Then
        start()
        $Enabled = False
        $SleepTime = 1000
    Else
        $Enabled = True
        $SleepTime = 10
        HotKeySet("{ESC}", "Enabled")
        

    EndIf


EndFunc

That gives good results at beggiining.

 

NumLock is dezactive untill i press ESC

Then is active and gives It's a simply text.

 

But... can't dezactive numlock with next ESC 🙈

Link to comment
Share on other sites

I changed the name so as not to be confused

#include <misc.au3>

Local $HotKeyActive, $SleepTime

$HotKeyActive = True
Enabled()

;************************************************
While 1
    Sleep($SleepTime)
WEnd
;************************************************

Exit

;----------------------------------------------------------------------------------------
Func start() ;
    While $HotKeyActive
        Sleep(10)
        If _IsPressed("90") Then     ; 90 NUM LOCK key
;~          ConsoleWrite(":")

            Sleep(50)
            Send("Its")
            Sleep(200)
            Send("a simply")
            Sleep(200)
            Send("text")
            Sleep(150)


        EndIf
    WEnd
EndFunc   ;==>start
;----------------------------------------------------------------------------------------
Func Enabled()
    If $HotKeyActive = True Then
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico")
        $HotKeyActive = False
        $SleepTime = 1000
    Else
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico")
        $HotKeyActive = True
        $SleepTime = 10
        start()
    EndIf
    HotKeySet("{ESC}", "Enabled")
EndFunc   ;==>Enabled

 

Edited by ioa747
rename the $Enabled to $HotKeyActive

I know that I know nothing

Link to comment
Share on other sites

1 minute ago, ioa747 said:

 

#include <misc.au3>

Local $Enabled, $SleepTime

$Enabled = True
Enabled()

;************************************************
While 1
    Sleep($SleepTime)
WEnd
;************************************************

Exit

;----------------------------------------------------------------------------------------
Func start() ;
    While $Enabled
        Sleep(10)
        If _IsPressed("90") Then     ; 90 NUM LOCK key
;~          ConsoleWrite(":")

            Sleep(50)
            Send("Its")
            Sleep(200)
            Send("a simply")
            Sleep(200)
            Send("text")
            Sleep(150)


        EndIf
    WEnd
EndFunc   ;==>start
;----------------------------------------------------------------------------------------
Func Enabled()
    If $Enabled = True Then
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico")
        $Enabled = False
        $SleepTime = 1000
    Else
        TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico")
        $Enabled = True
        $SleepTime = 10
        start()
    EndIf
    HotKeySet("{ESC}", "Enabled")
EndFunc   ;==>Enabled

 

Wow it's trully working!! 😎

 

i wish someone gonna help you with whatever you need someday 💯

 

Have a good night going study that code xD

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...