Jump to content

Recommended Posts

Posted
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 😎

Posted

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

Posted (edited)

idk if you joking cuz of my newbi skills or just don't get what i mean xD

anyway appreciate for your time

 

 

 

Edited by SevenScript
Posted (edited)

I just help I want :)

with

Thank you for your time gonna live with what i have 

i thought you were tired, and for that i say last shot

I apologize if I said something I should not

Edited by ioa747

I know that I know nothing

Posted

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. 

Posted (edited)

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

Posted (edited)

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

Posted
#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 🙈

Posted (edited)

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

Posted
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

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
  • Recently Browsing   0 members

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