Sign in to follow this  
Followers 0
nonplayablecharacter

html stuff

2 posts in this topic

#1 ·  Posted (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 by nonplayablecharacter

You can always count on me for the dumb questions ;)My Scripts:Rikku

Share this post


Link to post
Share on other sites



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).

#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 :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0