nowayhome2 Posted August 11, 2009 Share Posted August 11, 2009 (edited) #include <WindowsConstants.au3> GUICreate("Please Input Question", 260, 50, 193, 125, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) $i = GUICtrlCreateInput("Enter Question Here", 16, 8, 185, 21) $b = GUICtrlCreateButton("OK", 216, 16, 33, 25, 0) GUISetState(@SW_SHOW) $s_URL = "http://nick761.mango12.com/oodles/api.php?clue=" & $i while 1 If GUIGetMsg() = $b Then $WinHttpReq = ObjCreate("WinHttp.WinHttpRequest.5.1") $WinHttpReq.Open("GET", $s_URL ,false) $WinHttpReq.Send() $c = $WinHttpReq.ResponseText MsgBox(1,"Answer", $c) endif wendi want it to add the question at the end of the line for example the user types in "what is my name" it would sendhttp://nick761.mango12.com/oodles/api.php?clue=what is my namebut it does not all it it sends is http://nick761.mango12.com/oodles/api.php?clue=and returns with the answerjapan which is the default answer if you just type in http://nick761.mango12.com/oodles/api.php?clue= Edited August 11, 2009 by nowayhome2 Link to comment Share on other sites More sharing options...
Malkey Posted August 11, 2009 Share Posted August 11, 2009 (edited) #include <WindowsConstants.au3> GUICreate("Please Input Question", 260, 50, 193, 125, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) $i = GUICtrlCreateInput("Enter Question Here", 16, 8, 185, 21) $b = GUICtrlCreateButton("OK", 216, 16, 33, 25, 0) GUISetState(@SW_SHOW) $s_URL = "http://nick761.mango12.com/oodles/api.php?clue=" & $i while 1 If GUIGetMsg() = $b Then $WinHttpReq = ObjCreate("WinHttp.WinHttpRequest.5.1") $WinHttpReq.Open("GET", $s_URL ,false) $WinHttpReq.Send() $c = $WinHttpReq.ResponseText MsgBox(1,"Answer", $c) endif wend i want it to add the question at the end of the line for example the user types in "what is my name" it would send http://nick761.mango12.com/oodles/api.php?clue=what is my name but it does not all it it sends is http://nick761.mango12.com/oodles/api.php?clue= and returns with the answer japan which is the default answer if you just type in http://nick761.mango12.com/oodles/api.php?clue= You were sending the controlid of the input control, and not the data from within the input control. (See GUICtrlCreateInput in help file, or, double click on GUICtrlCreateInput in autoit script box below.) ; #include <WindowsConstants.au3> GUICreate("Please Input Question", 260, 50, 193, 125, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE)) $i = GUICtrlCreateInput("Enter Question Here", 16, 8, 185, 21) $b = GUICtrlCreateButton("OK", 216, 16, 33, 25, 0) GUISetState(@SW_SHOW) While 1 If GUIGetMsg() = $b Then $WinHttpReq = ObjCreate("WinHttp.WinHttpRequest.5.1") $s_URL = "http://nick761.mango12.com/oodles/api.php?clue=" & GUICtrlRead($i) $WinHttpReq.Open("GET", $s_URL, False) $WinHttpReq.Send() $c = $WinHttpReq.ResponseText MsgBox(1, "Answer", $c) EndIf WEnd ; Edit: Make that single click on GUICtrlCreateInput in script. Edited August 11, 2009 by Malkey Link to comment Share on other sites More sharing options...
nowayhome2 Posted August 11, 2009 Author Share Posted August 11, 2009 You were sending the controlid of the input control, and not the data from within the input control. (See GUICtrlCreateInput in help file, or, double click on GUICtrlCreateInput in autoit script box below.) ; #include <WindowsConstants.au3> GUICreate("Please Input Question", 260, 50, 193, 125, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE)) $i = GUICtrlCreateInput("Enter Question Here", 16, 8, 185, 21) $b = GUICtrlCreateButton("OK", 216, 16, 33, 25, 0) GUISetState(@SW_SHOW) While 1 If GUIGetMsg() = $b Then $WinHttpReq = ObjCreate("WinHttp.WinHttpRequest.5.1") $s_URL = "http://nick761.mango12.com/oodles/api.php?clue=" & GUICtrlRead($i) $WinHttpReq.Open("GET", $s_URL, False) $WinHttpReq.Send() $c = $WinHttpReq.ResponseText MsgBox(1, "Answer", $c) EndIf WEnd ; Edit: Make that single click on GUICtrlCreateInput in script. thank you so much >_< that did the trick and i see what i did wrong now thanks for helping me out 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