Jump to content

Trying to make a sentence finisher/completer


Ignacio
 Share

Recommended Posts

Hello, and good day
Im trying to make a sentence autocompleter so that when you type certain words (or commands) the scripts, and im in need of help/pointers

Spoiler
#include<Misc.au3>

Global $UnPaused
Global $vcounter = 0
Global $cString = "llo",  $vstringer0 = ""


HotKeySet("{f8}", "Terminate")


While 1
    Sleep(100)
    ToolTip("F8 to close",0,0)
    if _IsPressed(54) Then ;t key supposed to be the slash key but doesnt works for some reason
        $vcounter = 1
        $vstringer0 = "/"

        EndIf




    if $vcounter = 1 Then
        If  _IsPressed(48) then  ;h key
        $vcounter = 2
        $vstringer0 = $vstringer0 & "h"
EndIf

        EndIf
    if $vcounter = 2 Then
        if _IsPressed(45) then ; e key
            $vcounter = 3
            $vstringer0 = $vstringer0 & "e"
            EndIf

            EndIf
    If $vcounter = 3 Then
        Send($cString)
        Send("{enter}")
        $vcounter = 0
        EndIf




WEnd




Func Terminate()
    Exit 0
EndFunc

 

That is what i have at the time and the issues i have currently is that:
- I cant find an easy way to reset the counter to 0 in case a different letter from those are pressed ( tried NOT _ispressed but i think i got it wrong)

-Is there another way to detect the key press that _ispressed? (i couldnt find it so far), since i feel like it is too clunky ( although maybe that is just me and my way to code)

- for some reason the hex code (6F) for the / (divide nume pad) isnt working for me

 

Im thinking of making a text file with some words to use them as variables/comparations  (so that at least removes the need of a variable for the words in the script) and make the script make a temporal text file to save the input and then compare it with the other one. But i dont know if that is a good approach.

Thanks for your time and patience.

Link to comment
Share on other sites

12 hours ago, mikell said:

May I suggest googling "autoit autocomplete" ? there are many threads on the forum about this subject

Amazing how a little wording can change all the results.
Found this thread (for reference)

Spoiler

 

Now i just need to figure how to make it work with any window
 

Link to comment
Share on other sites

I found out that that topic of capturing keyboard keypresses is not viewed very well here. Altough I did find older topics that show how to do just that.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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

×
×
  • Create New...