Sure, here it is:
$ie = ObjCreate("InternetExplorer.Application")
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $bot = GUICreate("Bot", 226, 139, -1, -1)
Global $startie = GUICtrlCreateButton("Start IE", 32, 24, 155, 25)
Global $startloop = GUICtrlCreateButton("Start Loop", 32, 56, 75, 25)
Global $pauseloop = GUICtrlCreateButton("Pause Loop", 112, 56, 75, 25)
GUICtrlSetOnEvent($startie, 'StartIE')
GUICtrlSetOnEvent($startloop, 'startloop')
GUICtrlSetOnEvent($pauseloop, 'Pauseloop')
GUISetOnEvent($GUI_EVENT_CLOSE, 'ExitApp')
Opt('GUIOnEventMode', 1)
GUISetState(@SW_SHOW)
Global $var = 0
;function to start internet explorer and get website ready
Func StartIE()
With $ie
.visible = true
.navigate("http://cleverbot.com")
While($ie.busy)
Sleep(500)
WEnd
EndWith
EndFunc
While 1
With $ie
;while loop to interact with the website
While $var = 1
While($ie.busy)
Sleep(500)
WEnd
Sleep(5000)
$sayitbutton = .document.getElementsByTagName("input")
For $b in $sayitbutton
if $b.value = "think for me" Then
$b.click()
EndIf
Next
;finds the text in html
$span = .document.getElementsByTagName("span")
For $text In $span
If $text.value = " " Then
Sleep(50)
MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text
EndIf
Next
WEnd
EndWith
WEnd
;starts the loop
Func startloop()
$var = 1
EndFunc
;pauses the loop
Func Pauseloop()
$var = 2
EndFunc
;exits the app
Func ExitApp()
Opt('GUIOnEventMode', 0)
GUIDelete($bot)
Exit
EndFunc