epicfail Posted September 29, 2009 Share Posted September 29, 2009 hi i wanted to know how i would use _IEFormElementGetObjByName and _IEFormElementSetValue in this script to fill in user names of websites expandcollapse popup#NoTrayIcon #Include <INet.au3> #Include <String.au3> Global $oIE = ObjCreate("Shell.Explorer.2") Global $ini = @ScriptDir & "\swb.ini" Global $read_height = IniRead($ini, "Display", "Height", "") Global $read_width = IniRead($ini, "Display", "Width", "") Global $read_homepage = IniRead($ini, "Settings", "Homepage", "") Global $read_starthomepage = IniRead($ini, "Settings", "StartHomepage", "") If $read_height = "" Then IniWrite($ini, "Display", "Height", "600") IniWrite($ini, "Display", "Width", "800") $read_height = 600 $read_width = 800 EndIf If $read_starthomepage = "" Then $read_starthomepage = "1" $read_homepage = "www.autoitscript.com/forum" EndIf $iniread = IniRead($ini, "URL", "LAST URL", " ") If $read_starthomepage = "0" Then $read_homepage = $iniread $gui_main = GUICreate("", $read_width, $read_height + 20, -1, -1, 0x04000000 + 0x00CF0000) $file_menu = GUICtrlCreateMenu("File") $fm_newwind = GUICtrlCreateMenuItem("New Window", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_open = GUICtrlCreateMenuItem("Open", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_print = GUICtrlCreateMenuItem("Print", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_savas = GUICtrlCreateMenuItem("Save As", $file_menu) $fm_SaveSource = GUICtrlCreateMenuItem("Save Source", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_exit = GUICtrlCreateMenuItem("Exit", $file_menu) $view_menu = GUICtrlCreateMenu("View") $vm_status = GUICtrlCreateMenuItem("Status Bar", $view_menu) GUICtrlSetState(-1, 1) $tool_menu = GUICtrlCreateMenu("Tools") $tm_pref = GUICtrlCreateMenuItem("Preferences", $tool_menu) $tm_sep = GUICtrlCreateMenuItem("", $tool_menu) $tm_ru = GUICtrlCreateMenuItem("Random URL", $tool_menu) $tm_sep = GUICtrlCreateMenuItem("", $tool_menu) $tm_gu = GUICtrlCreateMenuItem("Get Current URL", $tool_menu) $about_menu = GUICtrlCreateMenu("About") $am_about = GUICtrlCreateMenuItem("About", $about_menu) $gui_iewindow = GUICtrlCreateObj($oIE, 0, 0, $read_width, $read_height - 45) GUICtrlSetResizing($gui_iewindow, 0x0001) $address_bar_label = GUICtrlCreateLabel("Enter Address: ", 0, 562, 85, -1) $address_bar_input = GUICtrlCreateInput($read_homepage, 76, 559, 200, -1) $address_bar_go = GUICtrlCreateButton("Go >>", 280, 557, 50, -1, 0x0001) $address_bar_stop = GUICtrlCreateButton("Stop", 330, 557, 50, -1) $address_bar_back = GUICtrlCreateButton("Back", 380, 557, 50, -1) $address_bar_forward = GUICtrlCreateButton("Forward", 430, 557, 50, -1) $address_bar_refresh = GUICtrlCreateButton("Refresh", 480, 557, 50, -1) $address_bar_home = GUICtrlCreateButton("Home", 530, 557, 50, -1) $address_bar_speak = GUICtrlCreateButton("Speak", 580, 557, 50, -1) $status_bar = GUICtrlCreateLabel("Loading: " & $read_homepage & "...", 0, 584, $read_width, $read_height, BitOR(11, 0x1000)) GUISetState() AnimateTitle($gui_main, "Simple Web Browser 3.0 - Created by Justin Reno", 100) $oIE.Navigate ($read_homepage) $gui_pref = GUICreate("Preferences", 298, 230, 359, 233) $group1 = GUICtrlCreateGroup("Settings", 16, 16, 265, 170) $label_home = GUICtrlCreateLabel("Homepage:", 32, 40, 59, 17) $input_add = GUICtrlCreateInput($read_homepage, 96, 40, 161, 21) $label_start = GUICtrlCreateLabel("On Startup:", 32, 80, 58, 17) $combo_startup = GUICtrlCreateCombo("", 96, 80, 161, 25) If $read_starthomepage = "0" Then GUICtrlSetData(-1, "Start with Homepage|Start with Last Visited", "Start with Last Visited") Else GUICtrlSetData(-1, "Start with Homepage|Start with Last Visited", "Start with Homepage") EndIf #cs $pref_Status_Status = GUICtrlCreateLabel("Display Width", 32, 110, 58, 71) $pref_width_input = GUICtrlCreateInput($read_width, 80, 115, 58, 20) $pref_height_label = GUICtrlCreateLabel("Display Height", 32, 140, 58, 71) $pref_height_input = GUICtrlCreateInput($read_height, 80, 145, 58, 20) #ce $button_apply = GUICtrlCreateButton("Apply", 120, 190, 75, 25, 0) $button_close = GUICtrlCreateButton("Close", 208, 190, 75, 25, 0) GUISetState(@SW_HIDE, $gui_pref) While 1 WinSetTitle($gui_main, "", "Simple Web Browser 3.0 - Created by Justin Reno - " & $oIE.locationURL ()) If $oIE.Busy () Then $url = $oIE.LocationURL () _StatusChange("Loading: " & $url & "...") Else _StatusChange("Done.") EndIf $msg = GUIGetMsg(1) Switch $msg[0] Case - 3 $update = $oIE.LocationURL () IniWrite($ini, "URL", "LAST URL", $update) FileDelete(@TempDir & "\SWBHelpFile.exe") Exit ;File Menu Case $fm_newwind ShellExecute(@ScriptFullPath) Case $fm_open Local $file = FileOpenDialog("Simple Web Browser 3.0 : Select file", @ScriptDir, "All Files (*.*)") If @error <> 1 Then _StatusChange("Loading: " & $file & "...") $oIE.Navigate ($file) EndIf Case $fm_print $oIE.document.parentwindow.Print () Case $fm_savas $oIE.document.execCommand ("SaveAs") Case $fm_SaveSource $IE = _INetGetSource("" & $update & "") FileWrite(@DesktopDir & "\websource.html", $IE) MsgBox(0, "Simple Web Browser 3.0", "Saved to desktop as websource.html") Case $fm_exit $update = $oIE.LocationURL () IniWrite($ini, "URL", "LAST URL", $update) Exit ;View Menu Case $vm_status $size = WinGetPos("Simple Web Browser") If BitAND(GUICtrlRead($vm_status), 1) = 4 Then GUICtrlSetState($vm_status, 4) GUICtrlSetState($status_bar, 32) WinMove("Simple Web Browser", "", $size[0], $size[1], $size[2], $size[3] - 15) Else GUICtrlSetState($vm_status, 1) GUICtrlSetState($status_bar, 16) WinMove("Simple Web Browser", "", $size[0], $size[1], $size[2], $size[3] + 15) EndIf Case $tm_pref GUISetState(@SW_SHOW, $gui_pref) Case $tm_ru _Random() Case $tm_gu $update = $oIE.LocationURL () MsgBox(0, "Simple Web Browser 3.0", "URL:" & $update & "") ClipPut($update) Case $button_close GUISetState(@SW_HIDE, $gui_pref) Case $button_apply ;$getwidth = GUICtrlRead($pref_width_input) ;$getheight = GUICtrlRead($pref_height_input) ;IniWrite($ini, "Display", "Width", $getwidth) ;IniWrite($ini, "Display", "Height", $getheight) $gethome = GUICtrlRead($input_add) $getstarthome = GUICtrlRead($combo_startup) If $getstarthome = "Start with Homepage" Then IniWrite($ini, "Settings", "StartHomepage", "1") Else IniWrite($ini, "Settings", "StartHomepage", "0") EndIf IniWrite($ini, "Settings", "Homepage", $gethome) GUISetState(@SW_HIDE, $gui_pref) _StatusChange("Configuration written successfully.") sleep(1000) ;About Menu Case $am_about FileDelete(@TempDir & "\SWBHelpFile.exe") InetGet("http://h1.ripway.com/mrreno/SWBHelpFile.exe", @TempDir & "\SWBHelpFile.exe", 1, 0) ShellExecute(@TempDir & "\SWBHelpFile.exe") ;Address Bar Buttons Case $address_bar_go $addy = GUICtrlRead($address_bar_input) _StatusChange("Loading: " & $addy & "...") $oIE.Navigate ($addy) _StatusChange("Done.") Case $address_bar_stop $oIE.Stop () Case $address_bar_back $oIE.GoBack () Case $address_bar_forward $oIE.GoForward () Case $address_bar_refresh $oIE.document.execCommand ("Refresh") Case $address_bar_home $read_homepageini = IniRead($ini, "Settings", "Homepage", "") $oIE.Navigate ($read_homepageini) GUICtrlSetData($address_bar_input, $read_homepage) Case $address_bar_speak Dim $voice = ObjCreate("Sapi.SpVoice") Speak($oIE.document.selection.createRange.text & @CR, 0, 100) EndSwitch WEnd Func _StatusChange($message) GUICtrlSetData($status_bar, $message) EndFunc ;==>_StatusChange Func Speak($text, $Rate, $Volme) $voice.Rate = $Rate $voice.Volume = $Volme $voice.Speak($text) EndFunc ;==>Speak Func _Random() $Ranpg = Random(1, 18, 1) Switch $Ranpg Case 1 $oIE.Navigate ("www.google.com") Case 2 $oIE.Navigate ("www.youtube.com") Case 3 $oIE.Navigate ("www.justinreno.tk") Case 4 $oIE.Navigate ("www.autoitscript.com") Case 3 $oIE.Navigate ("www.autoitscript.com/forum") Case 6 $oIE.Navigate ("www.answers.com") Case 7 $oIE.Navigate ("www.swbforum.tk") Case 8 $oIE.Navigate ("http://www.youtube.com/watch?v=0dBu5X3TvNw") Case 9 $oIE.Navigate ("http://www.youtube.com/watch?v=PSYxT9GM0fQ") Case 10 $oIE.Navigate ("www.familyguy.com") Case 11 $oIE.Navigate ("www.jareno18forums.tk") Case 12 $oIE.Navigate ("about:blank") Case 13 $oIE.Navigate ("www.msn.com") Case 14 $oIE.Navigate ("www.microsoft.com") Case 15 $oIE.Navigate ("www.apple.com") Case 16 $oIE.Navigate ("http://www.youtube.com/watch?v=nsCXZczTQXo") Case 17 $oIE.Navigate ("http://www.youtube.com/watch?v=qmVn6b7DdpA") Case 18 $oIE.Navigate ("http://www.youtube.com/watch?v=O7txeOlujTc") EndSwitch EndFunc ;==>_Random Func AnimateTitle($hGUI, $sTitle, $iBuf) $sTitle = StringSplit($sTitle, "") For $i = $iBuf To 0 Step - 1 WinSetTitle($hGUI, "", _StringRepeat(" ", $i) & $sTitle[1]) Next Local $s For $i = 1 To $sTitle[0] $s &= $sTitle[$i] WinSetTitle($hGUI, "", $s) Sleep(5) Next EndFunc ;==>AnimateTitle Link to comment Share on other sites More sharing options...
Mecrazycoder Posted September 29, 2009 Share Posted September 29, 2009 (edited) hi i wanted to know how i would use _IEFormElementGetObjByName and _IEFormElementSetValue in this script to fill in user names of websites expandcollapse popup#NoTrayIcon #Include <INet.au3> #Include <String.au3> Global $oIE = ObjCreate("Shell.Explorer.2") Global $ini = @ScriptDir & "\swb.ini" Global $read_height = IniRead($ini, "Display", "Height", "") Global $read_width = IniRead($ini, "Display", "Width", "") Global $read_homepage = IniRead($ini, "Settings", "Homepage", "") Global $read_starthomepage = IniRead($ini, "Settings", "StartHomepage", "") If $read_height = "" Then IniWrite($ini, "Display", "Height", "600") IniWrite($ini, "Display", "Width", "800") $read_height = 600 $read_width = 800 EndIf If $read_starthomepage = "" Then $read_starthomepage = "1" $read_homepage = "www.autoitscript.com/forum" EndIf $iniread = IniRead($ini, "URL", "LAST URL", " ") If $read_starthomepage = "0" Then $read_homepage = $iniread $gui_main = GUICreate("", $read_width, $read_height + 20, -1, -1, 0x04000000 + 0x00CF0000) $file_menu = GUICtrlCreateMenu("File") $fm_newwind = GUICtrlCreateMenuItem("New Window", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_open = GUICtrlCreateMenuItem("Open", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_print = GUICtrlCreateMenuItem("Print", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_savas = GUICtrlCreateMenuItem("Save As", $file_menu) $fm_SaveSource = GUICtrlCreateMenuItem("Save Source", $file_menu) $fm_sep = GUICtrlCreateMenuItem("", $file_menu) $fm_exit = GUICtrlCreateMenuItem("Exit", $file_menu) $view_menu = GUICtrlCreateMenu("View") $vm_status = GUICtrlCreateMenuItem("Status Bar", $view_menu) GUICtrlSetState(-1, 1) $tool_menu = GUICtrlCreateMenu("Tools") $tm_pref = GUICtrlCreateMenuItem("Preferences", $tool_menu) $tm_sep = GUICtrlCreateMenuItem("", $tool_menu) $tm_ru = GUICtrlCreateMenuItem("Random URL", $tool_menu) $tm_sep = GUICtrlCreateMenuItem("", $tool_menu) $tm_gu = GUICtrlCreateMenuItem("Get Current URL", $tool_menu) $about_menu = GUICtrlCreateMenu("About") $am_about = GUICtrlCreateMenuItem("About", $about_menu) $gui_iewindow = GUICtrlCreateObj($oIE, 0, 0, $read_width, $read_height - 45) GUICtrlSetResizing($gui_iewindow, 0x0001) $address_bar_label = GUICtrlCreateLabel("Enter Address: ", 0, 562, 85, -1) $address_bar_input = GUICtrlCreateInput($read_homepage, 76, 559, 200, -1) $address_bar_go = GUICtrlCreateButton("Go >>", 280, 557, 50, -1, 0x0001) $address_bar_stop = GUICtrlCreateButton("Stop", 330, 557, 50, -1) $address_bar_back = GUICtrlCreateButton("Back", 380, 557, 50, -1) $address_bar_forward = GUICtrlCreateButton("Forward", 430, 557, 50, -1) $address_bar_refresh = GUICtrlCreateButton("Refresh", 480, 557, 50, -1) $address_bar_home = GUICtrlCreateButton("Home", 530, 557, 50, -1) $address_bar_speak = GUICtrlCreateButton("Speak", 580, 557, 50, -1) $status_bar = GUICtrlCreateLabel("Loading: " & $read_homepage & "...", 0, 584, $read_width, $read_height, BitOR(11, 0x1000)) GUISetState() AnimateTitle($gui_main, "Simple Web Browser 3.0 - Created by Justin Reno", 100) $oIE.Navigate ($read_homepage) $gui_pref = GUICreate("Preferences", 298, 230, 359, 233) $group1 = GUICtrlCreateGroup("Settings", 16, 16, 265, 170) $label_home = GUICtrlCreateLabel("Homepage:", 32, 40, 59, 17) $input_add = GUICtrlCreateInput($read_homepage, 96, 40, 161, 21) $label_start = GUICtrlCreateLabel("On Startup:", 32, 80, 58, 17) $combo_startup = GUICtrlCreateCombo("", 96, 80, 161, 25) If $read_starthomepage = "0" Then GUICtrlSetData(-1, "Start with Homepage|Start with Last Visited", "Start with Last Visited") Else GUICtrlSetData(-1, "Start with Homepage|Start with Last Visited", "Start with Homepage") EndIf #cs $pref_Status_Status = GUICtrlCreateLabel("Display Width", 32, 110, 58, 71) $pref_width_input = GUICtrlCreateInput($read_width, 80, 115, 58, 20) $pref_height_label = GUICtrlCreateLabel("Display Height", 32, 140, 58, 71) $pref_height_input = GUICtrlCreateInput($read_height, 80, 145, 58, 20) #ce $button_apply = GUICtrlCreateButton("Apply", 120, 190, 75, 25, 0) $button_close = GUICtrlCreateButton("Close", 208, 190, 75, 25, 0) GUISetState(@SW_HIDE, $gui_pref) While 1 WinSetTitle($gui_main, "", "Simple Web Browser 3.0 - Created by Justin Reno - " & $oIE.locationURL ()) If $oIE.Busy () Then $url = $oIE.LocationURL () _StatusChange("Loading: " & $url & "...") Else _StatusChange("Done.") EndIf $msg = GUIGetMsg(1) Switch $msg[0] Case - 3 $update = $oIE.LocationURL () IniWrite($ini, "URL", "LAST URL", $update) FileDelete(@TempDir & "\SWBHelpFile.exe") Exit ;File Menu Case $fm_newwind ShellExecute(@ScriptFullPath) Case $fm_open Local $file = FileOpenDialog("Simple Web Browser 3.0 : Select file", @ScriptDir, "All Files (*.*)") If @error <> 1 Then _StatusChange("Loading: " & $file & "...") $oIE.Navigate ($file) EndIf Case $fm_print $oIE.document.parentwindow.Print () Case $fm_savas $oIE.document.execCommand ("SaveAs") Case $fm_SaveSource $IE = _INetGetSource("" & $update & "") FileWrite(@DesktopDir & "\websource.html", $IE) MsgBox(0, "Simple Web Browser 3.0", "Saved to desktop as websource.html") Case $fm_exit $update = $oIE.LocationURL () IniWrite($ini, "URL", "LAST URL", $update) Exit ;View Menu Case $vm_status $size = WinGetPos("Simple Web Browser") If BitAND(GUICtrlRead($vm_status), 1) = 4 Then GUICtrlSetState($vm_status, 4) GUICtrlSetState($status_bar, 32) WinMove("Simple Web Browser", "", $size[0], $size[1], $size[2], $size[3] - 15) Else GUICtrlSetState($vm_status, 1) GUICtrlSetState($status_bar, 16) WinMove("Simple Web Browser", "", $size[0], $size[1], $size[2], $size[3] + 15) EndIf Case $tm_pref GUISetState(@SW_SHOW, $gui_pref) Case $tm_ru _Random() Case $tm_gu $update = $oIE.LocationURL () MsgBox(0, "Simple Web Browser 3.0", "URL:" & $update & "") ClipPut($update) Case $button_close GUISetState(@SW_HIDE, $gui_pref) Case $button_apply ;$getwidth = GUICtrlRead($pref_width_input) ;$getheight = GUICtrlRead($pref_height_input) ;IniWrite($ini, "Display", "Width", $getwidth) ;IniWrite($ini, "Display", "Height", $getheight) $gethome = GUICtrlRead($input_add) $getstarthome = GUICtrlRead($combo_startup) If $getstarthome = "Start with Homepage" Then IniWrite($ini, "Settings", "StartHomepage", "1") Else IniWrite($ini, "Settings", "StartHomepage", "0") EndIf IniWrite($ini, "Settings", "Homepage", $gethome) GUISetState(@SW_HIDE, $gui_pref) _StatusChange("Configuration written successfully.") sleep(1000) ;About Menu Case $am_about FileDelete(@TempDir & "\SWBHelpFile.exe") InetGet("http://h1.ripway.com/mrreno/SWBHelpFile.exe", @TempDir & "\SWBHelpFile.exe", 1, 0) ShellExecute(@TempDir & "\SWBHelpFile.exe") ;Address Bar Buttons Case $address_bar_go $addy = GUICtrlRead($address_bar_input) _StatusChange("Loading: " & $addy & "...") $oIE.Navigate ($addy) _StatusChange("Done.") Case $address_bar_stop $oIE.Stop () Case $address_bar_back $oIE.GoBack () Case $address_bar_forward $oIE.GoForward () Case $address_bar_refresh $oIE.document.execCommand ("Refresh") Case $address_bar_home $read_homepageini = IniRead($ini, "Settings", "Homepage", "") $oIE.Navigate ($read_homepageini) GUICtrlSetData($address_bar_input, $read_homepage) Case $address_bar_speak Dim $voice = ObjCreate("Sapi.SpVoice") Speak($oIE.document.selection.createRange.text & @CR, 0, 100) EndSwitch WEnd Func _StatusChange($message) GUICtrlSetData($status_bar, $message) EndFunc ;==>_StatusChange Func Speak($text, $Rate, $Volme) $voice.Rate = $Rate $voice.Volume = $Volme $voice.Speak($text) EndFunc ;==>Speak Func _Random() $Ranpg = Random(1, 18, 1) Switch $Ranpg Case 1 $oIE.Navigate ("www.google.com") Case 2 $oIE.Navigate ("www.youtube.com") Case 3 $oIE.Navigate ("www.justinreno.tk") Case 4 $oIE.Navigate ("www.autoitscript.com") Case 3 $oIE.Navigate ("www.autoitscript.com/forum") Case 6 $oIE.Navigate ("www.answers.com") Case 7 $oIE.Navigate ("www.swbforum.tk") Case 8 $oIE.Navigate ("http://www.youtube.com/watch?v=0dBu5X3TvNw") Case 9 $oIE.Navigate ("http://www.youtube.com/watch?v=PSYxT9GM0fQ") Case 10 $oIE.Navigate ("www.familyguy.com") Case 11 $oIE.Navigate ("www.jareno18forums.tk") Case 12 $oIE.Navigate ("about:blank") Case 13 $oIE.Navigate ("www.msn.com") Case 14 $oIE.Navigate ("www.microsoft.com") Case 15 $oIE.Navigate ("www.apple.com") Case 16 $oIE.Navigate ("http://www.youtube.com/watch?v=nsCXZczTQXo") Case 17 $oIE.Navigate ("http://www.youtube.com/watch?v=qmVn6b7DdpA") Case 18 $oIE.Navigate ("http://www.youtube.com/watch?v=O7txeOlujTc") EndSwitch EndFunc ;==>_Random Func AnimateTitle($hGUI, $sTitle, $iBuf) $sTitle = StringSplit($sTitle, "") For $i = $iBuf To 0 Step - 1 WinSetTitle($hGUI, "", _StringRepeat(" ", $i) & $sTitle[1]) Next Local $s For $i = 1 To $sTitle[0] $s &= $sTitle[$i] WinSetTitle($hGUI, "", $s) Sleep(5) Next EndFunc ;==>AnimateTitle Below script works for me #include <IE.au3> $oIE = _IECreate ("http://www.gmail.com") $oForm = _IEFormGetObjByName ($oIE, "gaia_loginform") $oQuery = _IEFormElementGetObjByName ($oForm, "Email") _IEFormElementSetValue ($oQuery, "Username") _IEFormSubmit ($oForm) Here gaia_loginform is the form login ID. Edited September 29, 2009 by Mecrazycoder [size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent] Link to comment Share on other sites More sharing options...
epicfail Posted September 29, 2009 Author Share Posted September 29, 2009 yeah but i dont want to use the IE.au3 include i want to use the script i have just want to know how to get the IE.au3 func to work with the web script i have 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