nonplayablecharacter Posted September 13, 2008 Share Posted September 13, 2008 (edited) so i'll just get right to the point...on a browser based game there is a game for hangman...the source for the pages html lists the buttons for hangman as "<input type=submit name=guess value=a>" with no specific link attached to the button...so i'm curious if autoit can interact with that button directly without mouse...i'm almost positive that the page for hangman has it's own script to moniter which button (a-z) is pressed (<script type="text/javascript">)...the only other alternative i have is sending mosue clicks to the screen while it's minimized (i want it to work in the background thats why i need either direct interactions or a minimized screen click)....i tried searching but the first page of threads were all unrelated completely so any way to do either would help...also a not too complicated, small commands will be more helpful so i can get and understand PS:if anyone thinks the source of the html page may be helpful then ash me for it and ill put it...also i may imbed the page in a gui fyi Edited September 13, 2008 by nonplayablecharacter You can always count on me for the dumb questions ;)My Scripts:Rikku Link to comment Share on other sites More sharing options...
Szhlopp Posted September 13, 2008 Share Posted September 13, 2008 so i'll just get right to the point...on a browser based game there is a game for hangman...the source for the pages html lists the buttons for hangman as "<input type=submit name=guess value=a>" with no specific link attached to the button...so i'm curious if autoit can interact with that button directly without mouse...i'm almost positive that the page for hangman has it's own script to moniter which button (a-z) is pressed (<script type="text/javascript">)...the only other alternative i have is sending mosue clicks to the screen while it's minimized (i want it to work in the background thats why i need either direct interactions or a minimized screen click)....i tried searching but the first page of threads were all unrelated completely so any way to do either would help...also a not too complicated, small commands will be more helpful so i can get and understand PS:if anyone thinks the source of the html page may be helpful then ash me for it and ill put it...also i may imbed the page in a gui fyi Sounds to me like you're going to have to learn how to use the IE functions=) There are IE commands like: _IEAction ($oSubmit, "click") Start looking through the help file. Here is a simple example of how to grab the elements(I used this. Wasn't made to look pretty). expandcollapse popup#include <IE.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> ; $webAdd = "https://www.###.com" $gui1 = GUICreate("Form1", 471, 214, 193, 125) $List1 = GUICtrlCreateList("", 0, 0, 185, 188, $WS_BORDER + $WS_VSCROLL + $WS_TABSTOP + $LBS_NOTIFY) $webaddr = GUICtrlCreateInput($webAdd, 197, 10, 250, 21) $field = GUICtrlCreateInput("", 198, 44, 250, 21) $Button1 = GUICtrlCreateButton("Set field", 256, 86, 108, 38, 0) GUISetState(@SW_SHOW) $oIE = _IECreate ($webAdd, 0, 0) FindUserName($oIE) _IEQuit($oIE) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button1 $oIE = _IECreate ($webAdd) ;FindUserName($oIE) $selitem = _GUICtrlListBox_GetCurSel($list1) $seltext = _GUICtrlListBox_GetText($list1, $selitem) $formNum = Int(StringLeft($seltext, 2)) $oForm = _IEFormGetCollection ($oIE, $formNum) $IEelements = _IEFormElementGetCollection ($oForm, $selitem) _IEFormElementSetValue($IEelements, GUICtrlRead($field)) EndSwitch WEnd Func FindUserName($oIE) $oForms = _IEFormGetCollection ($oIE) $iNumForms = @extended For $A = 0 to $iNumForms - 1 $oForm = _IEFormGetCollection ($oIE, $A) $ocollection = _IEFormElementGetCollection ($oForm) $Elecount = @extended Global $IEelements[Int($Elecount)] For $I = 0 to $Elecount - 1 $IEelements[$I] = _IEFormElementGetCollection ($oForm, $I) _GUICtrlListBox_AddString($list1, $A & " " & $I + 1 & ") " & $IEelements[$I].name) Next Next EndFunc Feel free to post back here with IE questions. It can be a big confusing sometimes RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' 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