JReinn Posted November 16, 2008 Share Posted November 16, 2008 I want to make a bot like this, so you can type your URL into input1 and it visits the website you've typed, and input2 for how many times. My code looks like this, but it visits "3" instead of the input. It works if you do quotes, but not If I do with Input. Should I refresh the "Inputs" ? expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> HotKeySet("{F8}",'Visit') #Region ### START Koda GUI section ### Form=d:\program files\autoit3\scite\koda\forms\winner_dk's website visit bot.kxf $Form1 = GUICreate("WinneR_DK's Website visit bot", 418, 192, 193, 125) $Input1 = GUICtrlCreateInput("http://www.Google.com/", 16, 32, 385, 21) $Label1 = GUICtrlCreateLabel("Website", 184, 8, 43, 17) $Label2 = GUICtrlCreateLabel("Visits", 192, 64, 28, 17) $Input2 = GUICtrlCreateInput("10", 160, 88, 97, 21) $Button1 = GUICtrlCreateButton("Visit Youtube.com!", 120, 160, 177, 25, 0) $Label4 = GUICtrlCreateLabel("F8 to visit the website!", 152, 112, 109, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $oIE = _IECreate() _IENavigate($oIE, "http://www.Youtube.com") EndSwitch WEnd Func Visit() $oIE = _IECreate() For $i = 1 To $Input2 _IENavigate($oIE, $Input1);Website ToolTip("Page: " & $Input1 & " Times Loaded: " & $i, 0, 1) Sleep(1000) Send("{F5}",0) Next EndFunc Link to comment Share on other sites More sharing options...
Pain Posted November 16, 2008 Share Posted November 16, 2008 Use GuiCtrlRead($Input1) to obtain the information from the input box. Link to comment Share on other sites More sharing options...
ahha Posted November 16, 2008 Share Posted November 16, 2008 Pain is correct. As the documentation says GUICtrlCreateInput Returns the identifier (controlID) of the new control. Not the input. To obtain the value of the control see GUICtrlRead. Link to comment Share on other sites More sharing options...
JReinn Posted November 16, 2008 Author Share Posted November 16, 2008 Oh it works now! 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