skitt Posted June 11, 2009 Posted June 11, 2009 Ok, so this is like, my 6th script maybe ever made. What its supposed to do. pop the a GUI when the usernames and passwords are all in, you press login, and it starts the script to log in on all the clients. the checkbox is supposed to arrange the windows on my desktop how i wanted them to. its to login into a game on 5 clients total. So, i have no doubt that alot of it is wrong. i finished it about 3 hours ago, and have just gotten error after error and working them out, then getting more. and so on and so forth. Its a bit messy. :/ Any help would be greatly appreciated. expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Auto 5 acc login", 625, 445, 189, 124) $login = GUICtrlCreateButton("Login", 448, 88, 137, 33, $WS_GROUP) $Checkbox1 = GUICtrlCreateCheckbox("", 8, 16, 17, 17) $Label1 = GUICtrlCreateLabel("Organize windows", 32, 16, 90, 17) AutoItSetOption("WinTitleMatchMode", 4) $Char1 = GUICtrlCreateCombo("1st Char Selection", 224, 64, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char2 = GUICtrlCreateCombo("2nd Char Selection", 16, 247, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char3 = GUICtrlCreateCombo("3rd Char Selection", 16, 345, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char4 = GUICtrlCreateCombo("5th Char Selection", 282, 345, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char5 = GUICtrlCreateCombo("4th Char Selection", 282, 247, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $User1 = GUICtrlCreateInput("", 176, 104, 217, 21) $Pass1 = GUICtrlCreateInput("", 176, 136, 217, 21) $pass3 = GUICtrlCreateInput("", 16, 313, 217, 21) $user3 = GUICtrlCreateInput("", 16, 284, 217, 21) $pass5 = GUICtrlCreateInput("", 282, 313, 217, 21) $user5 = GUICtrlCreateInput("", 282, 284, 217, 21) $pass4 = GUICtrlCreateInput("", 282, 212, 217, 21) $user4 = GUICtrlCreateInput("", 281, 183, 217, 21) $pass2 = GUICtrlCreateInput("", 16, 212, 217, 21) $user2 = GUICtrlCreateInput("", 16, 183, 217, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ## ;functions Func Login1() send("{LWIN}") sleep(200) send("C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe") sleep(100) send("{enter}") WinWaitActive("L2.Net v370") global $handle = WinGetHandle("[ACTIVE]") controlclick($handle, "File", 330046) ControlClick($handle, "Login", "", "Left", 1, 128, 24) ControlClick($handle, "OOG", 199230) ControlClick($handle, "", 133674) ControlClick($handle, "", "", "left", 1, 413, 207) ControlClick($handle, "", 264710) Send($user1) ControlClick($handle, "", 133732) Send($pass1) ControlClick($handle, "", 199344) ControlClick($handle, "", 133786) ControlClick($handle, "", 133752) ControlClick($handle, "", 133704) ControlClick($handle, "", 133766) ControlClick($handle, "", 330046) ControlClick($handle, "","" , "left", 1, 155, 38) EndFunc Func Login2() send("{LWIN}") sleep(200) send("C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe") sleep(100) send("{enter}") WinWaitActive("L2.Net v370") global $handle2 = WinGetHandle("[ACTIVE]") controlclick($handle2, "File", 330046) ControlClick($handle2, "Login", "", "Left", 1, 128, 24) ControlClick($handle2, "OOG", 199230) ControlClick($handle2, "", 133674) ControlClick($handle2, "", "", "left", 1, 413, 207) ControlClick($handle2, "", 264710) Send($user2) ControlClick($handle2, "", 133732) Send($pass2) ControlClick($handle2, "", 199344) ControlClick($handle2, "", 133786) ControlClick($handle2, "", 133752) ControlClick($handle2, "", 133704) ControlClick($handle2, "", 133766) ControlClick($handle2, "", 330046) ControlClick($handle2, "","" , "left", 1, 155, 38) EndFunc Func Login3() send("{LWIN}") sleep(200) send("C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe") sleep(100) send("{enter}") WinWaitActive("L2.Net v370") global $handle3 = WinGetHandle("[ACTIVE]") controlclick($handle3, "File", 330046) ControlClick($handle3, "Login", "", "Left", 1, 128, 24) ControlClick($handle3, "OOG", 199230) ControlClick($handle3, "", 133674) ControlClick($handle3, "", "", "left", 1, 413, 207) ControlClick($handle3, "", 264710) Send($user3) ControlClick($handle3, "", 133732) Send($pass3) ControlClick($handle3, "", 199344) ControlClick($handle3, "", 133786) ControlClick($handle3, "", 133752) ControlClick($handle3, "", 133704) ControlClick($handle3, "", 133766) ControlClick($handle3, "", 330046) ControlClick($handle3, "","" , "left", 1, 155, 38) EndFunc Func Login4() send("{LWIN}") sleep(200) send("C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe") sleep(100) send("{enter}") WinWaitActive("L2.Net v370") global $handle4 = WinGetHandle("[ACTIVE]") controlclick($handle4, "File", 330046) ControlClick($handle4, "Login", "", "Left", 1, 128, 24) ControlClick($handle4, "OOG", 199230) ControlClick($handle4, "", 133674) ControlClick($handle4, "", "", "left", 1, 413, 207) ControlClick($handle4, "", 264710) Send($user4) ControlClick($handle4, "", 133732) Send($pass4) ControlClick($handle4, "", 199344) ControlClick($handle4, "", 133786) ControlClick($handle4, "", 133752) ControlClick($handle4, "", 133704) ControlClick($handle4, "", 133766) ControlClick($handle4, "", 330046) ControlClick($handle4, "","" , "left", 1, 155, 38) EndFunc Func Login5() send("{LWIN}") sleep(200) send("C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe") sleep(100) send("{enter}") WinWaitActive("L2.Net v370") global $handle5 = WinGetHandle("[ACTIVE]") controlclick($handle5, "File", 330046) ControlClick($handle5, "Login", "", "Left", 1, 128, 24) ControlClick($handle5, "OOG", 199230) ControlClick($handle5, "", 133674) ControlClick($handle5, "", "", "left", 1, 413, 207) ControlClick($handle5, "", 264710) Send($user5) ControlClick($handle5, "", 133732) Send($pass5) ControlClick($handle5, "", 199344) ControlClick($handle5, "", 133786) ControlClick($handle5, "", 133752) ControlClick($handle5, "", 133704) ControlClick($handle5, "", 133766) ControlClick($handle5, "", 330046) ControlClick($handle5, "","" , "left", 1, 155, 38) EndFunc Func Organize() If StringRegExp($user1, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then winmove($handle, "", 197, 294) EndIf If StringRegExp($user2, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then WinMove($handle2, "", 199, 26) EndIf If StringRegExp($user3, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then WinMove($handle3, "", 127, 52) EndIf If StringRegExp($user4, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then WinMove($handle4, "", 55, 77) EndIf If StringRegExp($user5, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then WinMove($handle5, "", -14, 735) EndIf EndFunc func Login() If StringRegExp($user1, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then Login1() EndIf sleep(500) If StringRegExp($user2, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then Login2() EndIf sleep(500) If StringRegExp($user3, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then Login3() EndIf sleep(500) If StringRegExp($user4, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then Login4() EndIf sleep(500) If StringRegExp($user5, '[abcdefghijklmnopqrstuvwxyz]') = 1 Then Login5() EndIf sleep(500) If $checkboxer == 1 Then organize() EndIf EndFunc GUICtrlSetOnEvent($Button1, "login") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Login() Case $checkbox1 $checkboxer = 1 EndSwitch WEnd
stampy Posted June 11, 2009 Posted June 11, 2009 I don't understand what this is suppose to do: send("{LWIN}") sleep(200) send("C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe") sleep(100) send("{enter}") What problems are you actually having with the script?
skitt Posted June 11, 2009 Author Posted June 11, 2009 that presses the windows key, types that line, then presses enter, which opens the program. I did this because Run() wouldn't work :/ so that would be another problem. problems=login button not working, getting warnings about $handle's and shit.
nitekram Posted June 11, 2009 Posted June 11, 2009 that presses the windows key, types that line, then presses enter, which opens the program. I did this because Run() wouldn't work :/ so that would be another problem. problems=login button not working, getting warnings about $handle's and shit.Where is GUICtrlSetOnEvent($Button1, "login") - $button1 defined? 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow."  WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI  CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
Valuater Posted June 11, 2009 Posted June 11, 2009 *** NOT TESTED *** expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> AutoItSetOption("WinTitleMatchMode", 4) Global $handle[6], $User[6], $Pass[6] Global $File = "C:\Users\Blake\Desktop\l2 stuff\L2 net\L2NET.exe" ; ---- GUI ----- #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Auto 5 acc login", 625, 445, 189, 124) $login = GUICtrlCreateButton("Login", 448, 88, 137, 33, $WS_GROUP) $Checkbox1 = GUICtrlCreateCheckbox("", 8, 16, 17, 17) $Label1 = GUICtrlCreateLabel("Organize windows", 32, 16, 90, 17) $Char1 = GUICtrlCreateCombo("1st Char Selection", 224, 64, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char2 = GUICtrlCreateCombo("2nd Char Selection", 16, 247, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char3 = GUICtrlCreateCombo("3rd Char Selection", 16, 345, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char4 = GUICtrlCreateCombo("5th Char Selection", 282, 345, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $Char5 = GUICtrlCreateCombo("4th Char Selection", 282, 247, 145, 25) GUICtrlSetData(-1, "Char 1|Char 2|Char 3|Char 4|Char 5|Char 6|Char 7") $User1 = GUICtrlCreateInput("", 176, 104, 217, 21) $Pass1 = GUICtrlCreateInput("", 176, 136, 217, 21) $pass3 = GUICtrlCreateInput("", 16, 313, 217, 21) $user3 = GUICtrlCreateInput("", 16, 284, 217, 21) $pass5 = GUICtrlCreateInput("", 282, 313, 217, 21) $user5 = GUICtrlCreateInput("", 282, 284, 217, 21) $pass4 = GUICtrlCreateInput("", 282, 212, 217, 21) $user4 = GUICtrlCreateInput("", 281, 183, 217, 21) $pass2 = GUICtrlCreateInput("", 16, 212, 217, 21) $user2 = GUICtrlCreateInput("", 16, 183, 217, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ## ; ------ Loop ---------------- While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $login Login() Case $Checkbox1 $checkboxer = _IsChecked($Checkbox1) ToolTip($checkboxer, 10, 10, "Tester", 1) EndSwitch WEnd ; ------ Functions ------------ Func LogOn($count) $Run_File = FileGetShortName($File) Run($Run_File) WinWaitActive("L2.Net v370") $handle = WinGetHandle("[ACTIVE]") ControlClick($handle, "File", 330046) ControlClick($handle, "Login", "", "Left", 1, 128, 24) ControlClick($handle, "OOG", 199230) ControlClick($handle, "", 133674) ControlClick($handle, "", "", "left", 1, 413, 207) ControlClick($handle, "", 264710) Send($User1) ControlClick($handle, "", 133732) Send($Pass1) ControlClick($handle, "", 199344) ControlClick($handle, "", 133786) ControlClick($handle, "", 133752) ControlClick($handle, "", 133704) ControlClick($handle, "", 133766) ControlClick($handle, "", 330046) ControlClick($handle, "", "", "left", 1, 155, 38) $handle[$count] = $handle EndFunc ;==>LogOn Func Organize() For $x = 1 To UBound($User) - 1 If StringRegExp($User[$x], '[abcdefghijklmnopqrstuvwxyz]') = 1 Then If $x = 1 Then WinMove($handle[1], "", 197, 294) If $x = 2 Then WinMove($handle[2], "", 199, 26) If $x = 3 Then WinMove($handle[3], "", 127, 52) If $x = 4 Then WinMove($handle[4], "", 55, 77) If $x = 5 Then WinMove($handle[5], "", -14, 735) EndIf Next EndFunc ;==>Organize Func Login() For $x = 1 To UBound($User) - 1 If StringRegExp($User[$x], '[abcdefghijklmnopqrstuvwxyz]') = 1 Then LogOn($x) Sleep(500) Next If $checkboxer Then organize() EndIf EndFunc ;==>Login Func _IsChecked($control) Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked 8)
skitt Posted June 12, 2009 Author Posted June 12, 2009 I believe it would of worked well if the Run cmd would work. but it still won't run l2net.exe . and yes that is the exact directory. and caps and all.
Valuater Posted June 12, 2009 Posted June 12, 2009 Try replacing this functions... Func LogOn($count) If FileExists($File) Then $Run_File = FileGetShortName($File) Run($Run_File, @WorkingDir) Else MsgBox(4096, "Error", "The File was not found. ", 5) Return EndIf WinWaitActive("L2.Net v370") $handle = WinGetHandle("[ACTIVE]") ControlClick($handle, "File", 330046) ControlClick($handle, "Login", "", "Left", 1, 128, 24) ControlClick($handle, "OOG", 199230) ControlClick($handle, "", 133674) ControlClick($handle, "", "", "left", 1, 413, 207) ControlClick($handle, "", 264710) Send($User1) ControlClick($handle, "", 133732) Send($Pass1) ControlClick($handle, "", 199344) ControlClick($handle, "", 133786) ControlClick($handle, "", 133752) ControlClick($handle, "", 133704) ControlClick($handle, "", 133766) ControlClick($handle, "", 330046) ControlClick($handle, "", "", "left", 1, 155, 38) $handle[$count] = $handle EndFunc ;==>LogOn 8)
skitt Posted June 12, 2009 Author Posted June 12, 2009 (edited) C:\Users\Blake\Desktop\Tutz\carpettest.au3 (112) : ==> Variable used without being declared.: If $checkboxer Then If ^ ERROR >Exit code: 1 Time: 44.707 yu. psst check my auto vent comment post also. Edited June 12, 2009 by skitt
stampy Posted June 12, 2009 Posted June 12, 2009 $checkboxer needs defined first. The only place it is ever set is in one of the case statements. So when the other case is true it goes to use $checkboxer and it's not been defined/declared.
Valuater Posted June 12, 2009 Posted June 12, 2009 (edited) I must have erased that... hmmm replace this Global $handle[6], $User[6], $Pass[6] with this Global $handle[6], $User[6], $Pass[6], $checkboxer = False Edited June 12, 2009 by Valuater
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