wolf1600u Posted April 18, 2015 Share Posted April 18, 2015 Hi, I need a login form for access to main page of my program, i have that code but i think this is incorrect or need some line of code to fix this problem, expandcollapse popup; ; BEGIN LOGIN AUTHENTICATION ; #include <GUIConstantsEx.au3> #include <EditConstants.au3> #NoTrayIcon Opt('WinTitleMatchMode', 2) Opt('GUIOnEventMode', 1) Opt('GUICloseOnESC', 0) Global $AuthFlag = 1 Global $LoginForm = GUICreate("Login", 220, 112) Global $UsernameLabel = GUICtrlCreateLabel("Username", 5, 10, 80, 22) Global $UsernameInput = GUICtrlCreateInput("", 90, 8, 121, 26) Global $PasswordLabel = GUICtrlCreateLabel("Password", 5, 45, 78, 22) Global $PasswordInput = GUICtrlCreateInput("", 90, 43, 121, 26, $ES_PASSWORD) Global $LoginButton = GUICtrlCreateButton("Login", 5, 78, 207, 25) GUISetFont(12, 400, 0, "Arial") GUISetOnEvent($GUI_EVENT_CLOSE, "LoginFormClose") GUICtrlSetCursor(-1, 0) GUICtrlSetOnEvent(-1, "LoginButton_Click") GUISetIcon(@ScriptDir & "\Icons\cocbot.ico") GUISetState(@SW_SHOW) While $AuthFlag Sleep(250) WEnd Func LoginButton_Click() GUICtrlSetState($LoginButton, 128) GUICtrlSetData($LoginButton, "Authenticating...") If Login(StringStripWS(GUICtrlRead($UsernameInput), 3), StringStripWS(GUICtrlRead($PasswordInput), 3)) Then $AuthFlag = 0; GUIDelete($LoginForm) Else MsgBox(262160, "Error", "Invalid username and/or password. Please ensure that you are using your http://www.parsitek.com forum credentials.") EndIf GUICtrlSetState($LoginButton, 64) GUICtrlSetData($LoginButton, "Login") GUICtrlSetState($UsernameInput, 256) EndFunc Func Login($Username, $Password) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") Local $POSTData = "u=" & $Username & "&p=" & $Password $oHTTP.Open("POST", "http://parsitek.com/wpp/wp-login.php", True) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($POSTData) If $oHTTP.Status <> 200 Then MsgBox(262160, "Error", "There was an issue authenticating with ClashBot, please report this to a developer.") Return False EndIf Return $oHTTP.ResponseText <> "#denied#" EndFunc Func LoginFormClose() Exit EndFunc ; ; END LOGIN AUTHNENTICATION ; please help me to fix this problem dears , thanks a lot Link to comment Share on other sites More sharing options...
Kinshima Posted April 18, 2015 Share Posted April 18, 2015 (edited) Hello, Maybe a WaitForResponse() below your Send helps. $oHTTP.Send($POSTData) $oHTTP.WaitForResponse() P.S. you have posted in the wrong section and have you read the >forum rules? Edited April 18, 2015 by Kinshima Link to comment Share on other sites More sharing options...
wolf1600u Posted April 18, 2015 Author Share Posted April 18, 2015 Hello, Maybe a WaitForResponse() below your Send helps. $oHTTP.Send($POSTData) $oHTTP.WaitForResponse() P.S. you have posted in the wrong section and have you read the >forum rules? i'm so sorry , i try this but not work , when i insert this code, application can open without correct username and password! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2015 Moderators Share Posted April 18, 2015 wolf1600u,Welcome to the AutoIt forum. But please pay attention to where you post - the "Examples" section where you started this thread is clearly marked: "This is NOT a general support forum!". I have moved it for you, but would ask you to be more careful in future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
232showtime Posted April 18, 2015 Share Posted April 18, 2015 (edited) gotcha... at line 57 MsgBox(262160, "Error", "There was an issue authenticating with ClashBot, please report this to a developer." he's creating login form for CoC Bot... at line 25 GUISetIcon(@ScriptDir & "\Icons\cocbot.ico") Edited April 18, 2015 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
wolf1600u Posted April 18, 2015 Author Share Posted April 18, 2015 wolf1600u, Welcome to the AutoIt forum. But please pay attention to where you post - the "Examples" section where you started this thread is clearly marked: "This is NOT a general support forum!". I have moved it for you, but would ask you to be more careful in future. M23 thanks Melba23, i'm so sorry about this Link to comment Share on other sites More sharing options...
wolf1600u Posted April 18, 2015 Author Share Posted April 18, 2015 gotcha... at line 57 MsgBox(262160, "Error", "There was an issue authenticating with ClashBot, please report this to a developer." he's creating login form for CoC Bot... yes , can you help me for fix this problem? Link to comment Share on other sites More sharing options...
232showtime Posted April 18, 2015 Share Posted April 18, 2015 im afraid not, you need to read the forum rules ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
wolf1600u Posted April 18, 2015 Author Share Posted April 18, 2015 im afraid not, you need to read the forum rules why?! Link to comment Share on other sites More sharing options...
232showtime Posted April 18, 2015 Share Posted April 18, 2015 Launching, automation or script interaction with games or game servers, regardless of the game.'?do=embed' frameborder='0' data-embedContent>> ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
wolf1600u Posted April 18, 2015 Author Share Posted April 18, 2015 it just easy login page ! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2015 Moderators Share Posted April 18, 2015 wolf1600u, it just easy login page !Even so, it is still gaming interaction - thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts