AutoHotKey Password

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JustBilly123
Posts: 4
Joined: 18 May 2020, 00:11

AutoHotKey Password

18 May 2020, 00:17

Hi i want to make a password thing but I'm bad at autohotkey (im new to this)
i wanna make it so if at any time i input a sequence of keys a function happens (run, start, send, ect)'

i wanna use the numpad keys but if that's not possible i can always rebind them, thank you for reading and plz consider helping
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: AutoHotKey Password

18 May 2020, 00:29

Code: Select all

Intro:
    MsgBox % "Welcome!"

Numpad1::
    Run, Notepad.exe
    Sleep, 1000
    Send, AHK rocks!
    Return
Numpad2::MsgBox % func("AHK rocks!")
Numpad3::SoundBeep
Numpad4::MouseMove, 0, 0
Numpad5::Goto, Intro

func(param) {
    Return SubString(param,1,-1) ", even more if you use its command reference!"
}
Click on the commands within this code box to get the magic of AHK! Happy scripting :)
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !
JustBilly123
Posts: 4
Joined: 18 May 2020, 00:11

Re: AutoHotKey Password

18 May 2020, 00:34

Hi sorry, i dont think u understand

i meant somethign like a password

so if i do Numpad1 then Numpad2 Then numpad 3 it will start youtube.com for example
anyways thanks for taking ur time to respond
User avatar
Hellbent
Posts: 2103
Joined: 23 Sep 2017, 13:34

Re: AutoHotKey Password

18 May 2020, 00:41

Perhaps something along these lines.

Code: Select all

::@Youtube::
	Run, www.Youtube.com
	return
Hotstrings:
https://www.autohotkey.com/docs/Hotstrings.htm
JustBilly123
Posts: 4
Joined: 18 May 2020, 00:11

Re: AutoHotKey Password

18 May 2020, 00:46

Hellbent wrote:
18 May 2020, 00:41
Perhaps something along these lines.

Code: Select all

::@Youtube::
	Run, www.Youtube.com
	return
Hotstrings:
https://www.autohotkey.com/docs/Hotstrings.htm
Hi that doesn't seem to work
User avatar
Hellbent
Posts: 2103
Joined: 23 Sep 2017, 13:34

Re: AutoHotKey Password

18 May 2020, 00:51

Works fine for me.

Have you tried typing @Youtube and then pressing space or enter?
JustBilly123
Posts: 4
Joined: 18 May 2020, 00:11

Re: AutoHotKey Password

18 May 2020, 00:52

Hellbent wrote:
18 May 2020, 00:51
Works fine for me.

Have you tried typing @Youtube and then pressing space or enter?
oh nevermind it worked, but is there a way i can do it with numpad keys?
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: AutoHotKey Password

18 May 2020, 01:00

Yes, there is. I provided you some sample code. Simply put some own effort into it. Happy scripting :)
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !
User avatar
Hellbent
Posts: 2103
Joined: 23 Sep 2017, 13:34

Re: AutoHotKey Password

18 May 2020, 01:02

Code: Select all

Numpad1 & Numpad2::
	Run, www.Youtube.Com
	return
User avatar
Hellbent
Posts: 2103
Joined: 23 Sep 2017, 13:34

Re: AutoHotKey Password

18 May 2020, 01:49

I don't know how much you plan on doing with it, but here is a little idea for grouping your functions so that you don't have a million key combos.

This of course can be replaced with something more like a tree menu or w/e the hell you call it.

Code: Select all

#SingleInstance, Force
List1 := "www.youtube.com|https://www.autohotkey.com/boards/viewtopic.php?f=76&t=76071|https://www.autohotkey.com/boards/viewforum.php?f=76"
List2 := "Blah Blah Blah 1|More Blah Blah|Some Other Blah Blah"
return

Numpad1 & Numpad2::
	Gui,1: New, +AlwaysOnTop
	Gui,1:Add,ListBox,xm ym w300 r15 vSelectedItem1 , % List1
	Gui,1:Add,Button,xm y+10 w300 r1 gItemSelectRun, Go
	Gui,1:Show,,Run It
	return

ItemSelectRun:
	GuiControlGet,SelectedItem1
	Gui,1:Destroy
	Try{
		run, % SelectedItem1
	}catch{
		msgbox, Failed to run
	}
	return

GuiClose:
	Gui,1:Destroy
	return

Numpad2 & Numpad3::
	Gui,2: New, +AlwaysOnTop
	Gui,2:Add,ListBox,xm ym w300 r15 vSelectedItem2 , % List2
	Gui,2:Add,Button,xm y+10 w300 r1 gItemSelectClip, Go
	Gui,2:Show,,Clip It
	return
	
ItemSelectClip:
	GuiControlGet,SelectedItem2
	Gui,2:Destroy
	ClipBoard := SelectedItem2
	SoundBeep, 500
	return
	
2GuiClose:
	Gui,2:Destroy
	return	
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: AutoHotKey Password

18 May 2020, 10:51

My noobish code works in AHK 32 Unicode :dance:
Caution: 14 year old code: https://autohotkey.com/board/topic/11138-crazy-scripting-secret-numeric-labels/

Press * (numpad mult) for half-a-second to trigger UI
Passwords:
1111 will start Notepad.exe
12345 will start Calc.exe
My Scripts and Functions: V1  V2
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: AutoHotKey Password

18 May 2020, 10:59

SKAN wrote:
18 May 2020, 10:51
My noobish code works in AHK 32 Unicode :dance:
Caution: 14 year old code: https://autohotkey.com/board/topic/11138-crazy-scripting-secret-numeric-labels/

Press * (numpad mult) for half-a-second to trigger UI
Passwords:
1111 will start Notepad.exe
12345 will start Calc.exe
Well, it's SKAN-code. Wouldn't have expected something different :mrgreen: :thumbup: :lol:
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: AutoHotKey Password

24 May 2020, 08:26

JustBilly123 wrote:plz consider helping
I want to... Let me know if you want a rewrite of my script per your needs.
Script won't be that complicated if the latest InputHook() is used.
My Scripts and Functions: V1  V2
User avatar
dmg
Posts: 287
Joined: 02 Oct 2013, 01:43
Location: "Twelve days north of Hopeless and a few degrees south of Freezing to Death"
Contact:

Re: AutoHotKey Password

24 May 2020, 09:09

This is probably far more complicated than you are looking for, but I wrote an app in AutoHotkey years ago that does this:
https://www.portablefreeware.com/index.php?id=2265

You set trigger codes and when you type them into a small prompt the app can execute programs, open files, load websites etc.
"My dear Mr Gyrth, I am never more serious than when I am joking."
~Albert Campion
------------------------------------------------------------------------
Website | Demo scripts | Blog | External contact
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: AutoHotKey Password

24 May 2020, 09:41

@dmg Very nice option. Thx for sharing it :)
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: imustbeamoron and 193 guests