Making a username:password prompt.

Get help with using AutoHotkey and its commands and hotkeys
Wabafit
Posts: 8
Joined: 08 Feb 2017, 09:37

Making a username:password prompt.

17 Feb 2017, 04:30

Hello. I need some help with making an account prompt (Username and Password). Not registration, just a login. This would prevent the actual script from opening unless the correct username and password are written. For example, it would hide the script's gui and stop all of it's functions until the username and password are written correctly. Thanks.
Last edited by Wabafit on 17 Feb 2017, 06:28, edited 2 times in total.
Wabafit
Posts: 8
Joined: 08 Feb 2017, 09:37

Re: Making an account system

17 Feb 2017, 06:21

For reference, this is my code:

Code: Select all

Run, "C:\Users\wabaf\AppData\Local\Discord\app-0.0.297\Discord.exe"
#NoTrayIcon
#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process, Priority, , A
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
Gui, Show, w200 h100, nviconfig2.0.exe
Gui, Color, 006666
gui, font,, Consolas
Gui, add, text, x40 y20 w200 h20, Toggle = Right Control
Gui, add, text, x40 y40 w200 h20, Self Destruct = F7
RCtrl::Hotkey, ~lbutton up, Toggle
~lbutton up::
sleep % random(98,175)
click
return
sleep % random(95,176)
click
return
sleep % random(113,159)
click
return
sleep % random(120,164)
click
return
sleep % random(95,176)
click
return
sleep % random(98,175)
click
return
sleep % random(120,164)
click
return
sleep % random(95,176)
click
Random(min,max) {
random,result,%min%,%max%
return result
}
F7::
{
ExitApp
}
return
GuiClose:
{
ExitApp
}
I know it's really messy but I'm not trying to optimize it at the moment. I found https://autohotkey.com/board/topic/9290 ... in-script/ but when I tried applying that to my script, it wouldn't show the GUI of my actual script but instead only the gui of the username and password-thingy. I do want that same username:password setup, though. I'm new to AHK so plz no bully me :lol:
Swannie
Posts: 30
Joined: 02 Feb 2016, 13:24

Re: Making a username:password prompt.

21 Feb 2017, 14:34

Hi, Maybe this is what you`re looking for ? ( Just convert it to your needs)


#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
#SingleInstance, Ignore
SetWorkingDir, %A_Scriptdir%
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.


;***********************************************************************
;Create folder with name "New Folder" on Desktop to be deleted by this script
;***********************************************************************

InputBox, uName, User`?, Enter your USERNAME, Hide
If uName = Swannie
{
}
else
{
Msgbox, 48, Error, Incorrect USERNAME !`nApplication will Exit
ExitApp
}


InputBox, uPass, Password`?, Enter your PASSWORD, HIDE
if upass = Tenbob
{
FileRemoveDir, C:\Users\Gerrit Swanepoel\Desktop\New Folder
}
else
{
MsgBox, 48, Error, Incorrect PASSWORD ! `n Application will Exit
ExitApp
}


Esc::ExitApp
Swannie
Posts: 30
Joined: 02 Feb 2016, 13:24

Re: Making a username:password prompt.

28 Feb 2017, 08:27

Instead of "FileRomoveDir"in my script, you have to type in : Run, C:\Users\wabaf\AppData\Local\Discord\app-0.0.297\Discord.exe


Your exe will not run until the password and login are correct (both).....and obviously you have to choose your own password and login :mrgreen:

NB: NO inverted commas at all !!!


No worries of being bullied on this forum when asking legit questions for help. :dance:

( I still remember when my very first script did not work, i was so scared to ask, i PM`d a guy and he corrected my script without any fuss and since then i really enjoyed AHK ) :bravo:

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Flipeador, jamesldnaylor, roikl289, Sam_, supersonic23 and 141 guests