Akselj Posted February 17, 2009 Author Share Posted February 17, 2009 Hey,This is my first VB tut so please be nice :cheesy:I guess many of you have seen that the auto-login is broken…. Well, here's the fix.First, go to frmLogin and find picLogin. Double-click it and you will find this code:```Private Sub picLogin_Click() If LenB(frmLogin.txtPassword.Text) <> 0 Then frmLogin.Check1.Value = Checked Else frmLogin.Check1.Value = Unchecked End If Me.Visible = False frmLogin.Visible = TrueEnd Sub```Change it to look like this:```Private Sub picLogin_Click()If ReadINI("CONFIG", "Auto", App.Path & "\config.ini") = 0 Then If LenB(frmLogin.txtPassword.Text) <> 0 Then frmLogin.Check1.Value = Checked Else frmLogin.Check1.Value = Unchecked End If frmLogin.Visible = True Me.Visible = FalseElse If AllDataReceived Then If LenB(frmLogin.txtName.Text) < 6 Then Call MsgBox("Your username must be at least three characters in length.") Exit Sub End If If LenB(frmLogin.txtPassword.Text) < 6 Then Call MsgBox("Your password must be at least three characters in length.") Exit Sub End If Call WriteINI("CONFIG", "Account", frmLogin.txtName.Text, (App.Path & "\config.ini")) Call MenuState(MENU_STATE_LOGIN) Me.Visible = False End IfEnd IfEnd Sub```That's it. Now you have working auto-login for your game!Hop this is usefull,AkselJ Link to comment Share on other sites More sharing options...
Jarvis Posted February 17, 2009 Share Posted February 17, 2009 Good tutorial. This will definitely be helpful, and it is greatly appreciated! Link to comment Share on other sites More sharing options...
Drag0n Posted February 17, 2009 Share Posted February 17, 2009 This works greatly for me. Link to comment Share on other sites More sharing options...
Akselj Posted February 17, 2009 Author Share Posted February 17, 2009 Thanks for the compliments, guys. I appreciate it :) Link to comment Share on other sites More sharing options...
Fred Posted March 1, 2009 Share Posted March 1, 2009 Good Job :D Link to comment Share on other sites More sharing options...
Akselj Posted March 2, 2009 Author Share Posted March 2, 2009 Thanks :) Link to comment Share on other sites More sharing options...
Guest Posted March 2, 2009 Share Posted March 2, 2009 nice!! Link to comment Share on other sites More sharing options...
Akselj Posted March 2, 2009 Author Share Posted March 2, 2009 Thanks :) Link to comment Share on other sites More sharing options...
Alpha Posted March 30, 2009 Share Posted March 30, 2009 Isn't picLogin in frmMainMenu? I saw it and added the code and it works awesomely, it logs you in without having to use a button :D.-Alpha Link to comment Share on other sites More sharing options...
Pasketi Posted June 8, 2009 Share Posted June 8, 2009 Testing myself… But the picLogin is really in frmMainMenu... Not found from frmLogin Link to comment Share on other sites More sharing options...
Harris6310 Posted June 8, 2009 Share Posted June 8, 2009 I added this to my EE2.8 that im making. Its realy usefull. Link to comment Share on other sites More sharing options...
anasky Posted June 11, 2009 Share Posted June 11, 2009 Uhhm, you forgot to add the cancel button:```Private Sub Label1_Click() AutoLogin = ReadINI("CONFIG", "Auto", (App.Path & "\config.ini")) If AutoLogin = 1 Then Call WriteINI("CONFIG", "Auto", 0, (App.Path & "\config.ini")) Me.Visible = False frmMainMenu.Visible = True End IfEnd Sub```Also, make Label1 visible. Link to comment Share on other sites More sharing options...
Akselj Posted June 11, 2009 Author Share Posted June 11, 2009 Well, I simply deleted it as I never got it to work. Link to comment Share on other sites More sharing options...
kranky65 Posted June 11, 2009 Share Posted June 11, 2009 AkselJ ,It does work you just need to fix the bug in modGameEditor. They have the true and false swaped for the frmChars.Label1.Visible```Public Sub MainMenuInit() frmLogin.txtName.Text = Trim$(ReadINI("CONFIG", "Account", App.Path & "\config.ini")) frmLogin.txtPassword.Text = Trim$(ReadINI("CONFIG", "Password", App.Path & "\config.ini")) If frmLogin.Check1.Value = 0 Then frmLogin.Check2.Value = 0 End If If ConnectToServer = True And AutoLogin = 1 Then frmMainMenu.picAutoLogin.Visible = True frmChars.Label1.Visible = False Else frmMainMenu.picAutoLogin.Visible = False frmChars.Label1.Visible = True End IfEnd Sub```I also added a line to the Sub Label1_Click to uncheck the auto-login box on the frmLogin.```Private Sub Label1_Click() AutoLogin = ReadINI("CONFIG", "Auto", (App.Path & "\config.ini")) If AutoLogin = 1 Then Call WriteINI("CONFIG", "Auto", 0, (App.Path & "\config.ini")) Call TcpDestroy frmLogin.Check2 = 0 Me.Visible = False frmMainMenu.Visible = True End IfEnd Sub```Completely works now but not sure that you should be sent back to the MainMenu.Enjoy,Kranky65P.S. Thanks for all of your great fixes.Edit1: Added Call Tcp Destroy to Sub Label Click1 because it would hang when you tried to login again. Link to comment Share on other sites More sharing options...
Akselj Posted June 11, 2009 Author Share Posted June 11, 2009 @kranky65:> Completely works now but not sure that you should be sent back to the MainMenu.Thanks man, I'll add it up there :D@kranky65:> P.S. Thanks for all of your great fixes.No problem :)–AkselJ Link to comment Share on other sites More sharing options...
Kimimaru Posted June 23, 2009 Share Posted June 23, 2009 In order to get this to work, do we just have to do whatever it says on the first post? The other posts with code make this slightly confusing for me because I don't know exactly what to edit. Link to comment Share on other sites More sharing options...
Akselj Posted June 24, 2009 Author Share Posted June 24, 2009 Just do what it says in the first post the others are for fixing the cancel button. Link to comment Share on other sites More sharing options...
Kimimaru Posted June 24, 2009 Share Posted June 24, 2009 Oh, okay. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now