Need help, again.

Get help with using AutoHotkey and its commands and hotkeys
TheBrohman
Posts: 13
Joined: 07 Dec 2015, 12:31

Need help, again.

08 Dec 2015, 21:05

Hello! I feel like I am asking alot of questions, but I need a bit help with my auto-login script.
The Gui and such works fine, but when I use my Key to enter the information into my game, it doesn't work. It just sends loads of tabs. Please help!

Code: Select all

Gui, +AlwaysOnTop
Gui, Font, cRed
Gui, Add, CheckBox, vAcc1 gAccs, Account 1
Gui, Add, CheckBox, vAcc2 gAccs, Account 2
Gui, Show, AutoSize x0 y0 NA, Accounts
return

;login (I removed the names and passwords due to security.)
name1 = 
pass1 = 

name2 = 
pass2 = 
return
	
Accs:
If (A_GuiControl="Acc1"){ ;if the control that launched this is the first one
 GuiControl,,Acc2,0 ;uncheck the second
 Account = 1
}
Else{ ;if not
 GuiControl,,Acc1,0 ;uncheck the first
 Account = 2
}
Return

Numpad0::
	if Account = 1
		Send, %name1%
		Sleep, 50
		Send, {TAB}
		Sleep, 50
		Send, %pass1%
	return
	if Account = 2
		Send, %name2%
		Sleep, 50
		Send, {TAB}
		Sleep, 50
		Send, %pass2%
	return
	if Account = 0
		Send, No account selected.

GuiClose:
ExitApp
User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: Need help, again.

08 Dec 2015, 21:10

name1, pass1, name2, pass2 are all kept with no values because they are not in the auto-execute section. The return above all of those variables ends that section. Remove it, and the variables get values.
TheBrohman
Posts: 13
Joined: 07 Dec 2015, 12:31

Re: Need help, again.

08 Dec 2015, 21:15

Ah I see. Now that I fixed that and I have changed it to:

Code: Select all

;login
name1 = 
pass1 = 

name2 = 
pass2 = 
return

Accs:
If (A_GuiControl="Acc1"){ ;if the control that launched this is the first one
 GuiControl,,Acc2,0 ;uncheck the second
 Account = 1
}
Else{ ;if not
 GuiControl,,Acc1,0 ;uncheck the first
 Account = 2
}
Return

Numpad0::
	if Account = 1
		Send, %name1%
		Sleep, 750
		Send, {TAB}
		Sleep, 750
		Send, %pass1%
	return
	if Account = 2
		Send, %name2%
		Sleep, 750
		Send, {TAB}
		Sleep, 750
		Send, %pass2%
	return
	if Account = 0
		Send, No account selected.
	return
	
But, when I use it, it will either say "<name1>(notab)<pass1>" on the Account 1, BUT on Account two it will say; "(tab)<pass1>" :S
TheBrohman
Posts: 13
Joined: 07 Dec 2015, 12:31

Re: Need help, again.

08 Dec 2015, 21:18

IGNORE THIS! It works on the game, it just didnt work in my notepad o.o
Thanks alot for the help :)

Edit: But still, on Account 2, it will say no username, but it will say the password for Account 1 :S
User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: Need help, again.

08 Dec 2015, 21:27

Oh yeah, the other error is you haven't put blocks for your if statements. Sorry for missing that before.
TheBrohman
Posts: 13
Joined: 07 Dec 2015, 12:31

Re: Need help, again.

08 Dec 2015, 21:29

I did :S But I figured out it cant be

if Account = 1{

but it has to be
if Account = 1
{

THanks alot again :) Now it is working fine! <3

Return to “Ask For Help”

Who is online

Users browsing this forum: Bad husband, Bing [Bot], Getfree, Google [Bot], Odlanir, RinkaDink and 161 guests