Results 1 to 2 of 2

Can't get the bot to enter any information.

This is a discussion on Can't get the bot to enter any information. within the AutoHotKey Help/Training forums, part of the General/Help category; So i have this bot set up to use a com browser but when i run it, it doesn't input ...

  1. #1
    deejannon is offline Banned
    Join Date
    Aug 2009
    Posts
    200

    Cool Can't get the bot to enter any information.

    So i have this bot set up to use a com browser but when i run it, it doesn't input any info it will just sit through the delays til it gets to the submit form. Any help? Here is my code so far. Also if any one could help me with adding the gmail trick and the addy trick that would be awesome.

    Code:
    SetTitleMatchMode, 2
    #Include Com.ahk
    Gui +LastFound
    Gui, Add, Edit, w110 varFirstname, First Name
    Gui, Add, Edit, w110 varLastname, Last Name
    Gui, Add, Edit, w110 varEmail, Gmail 
    Gui, Add, Edit, w110 varAddy, Address
    Gui, Add, Edit, w110 varCity, City
    Gui, Add, Edit, w110 varState, State
    Gui, Add, Edit, w110 varZip, Zip Code
    gui, show ; autosize - no specified w/h
    Gui, Add, Button, w110  , OK
    COM_AtLaxWinInit()  
    pwb:=COM_AtlAxGetControl(COM_AtlAxCreateContainer(WinExist(), 12, 200, 230, 200, "shell.explorer") )
    COM_Invoke(pwb, "Navigate", "http://www.nestle-abuelita.com/EN/Granulado/")
    
    Gui, Show, x400 y400 h379 w259, Bot
    Return
    
    ButtonOK:
    Gui, Submit, NoHide
    
    JS := "javascript:document.getElementById('ctl00_cphMainContent_txtFirstName').value='" varFirstname "';void(0)"
    JS1 := "javascript:document.getElementById('ctl00_cphMainContent_txtLastName').value='" varLastname "';void(0)"
    JS2 := "javascript:document.getElementById('ctl00_cphMainContent_txtEmail').value='" varEmail "';void(0)"
    JS3 := "javascript:document.getElementById('ctl00_cphMainContent_txtEmailConfirm').value='" varEmail "';void(0)"
    JS4 := "javascript:document.getElementById('ctl00_cphMainContent_txtAddress').value='" varAddy "';void(0)"
    JS5 := "javascript:document.getElementById('ctl00_cphMainContent_txtCity').value='" varCity "';void(0)"
    JS6 := "javascript:document.getElementById('ctl00$cphMainContent$ddlStates$ctl00').value='" varState "';void(0)"
    JS7 := "javascript:document.getElementById('ctl00_cphMainContent_txtZipcode').value='" varZip "';void(0)"
    JS8 := "javascript:document.forms[0].submit()"
    
    COM_Invoke(pwb, "Navigate", JS)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS1)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS2)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS3)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS4)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS5)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS6)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS7)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS8)
    Sleep, 100

  2.   Alt These ads help cover server costs and such.


  3. #2
    7usabball is offline Secret Undercover *****
    Join Date
    Jan 2009
    Posts
    1,462

    Default

    Code:
    #Include Com.ahk
    Gui +LastFound
    Gui, Add, Edit, w110 vvarFirstname, First Name
    Gui, Add, Edit, w110 vvarLastname, Last Name
    Gui, Add, Edit, w110 vvarEmail, Gmail 
    Gui, Add, Edit, w110 vvarAddy, Address
    Gui, Add, Edit, w110 vvarCity, City
    Gui, Add, Edit, w110 vvarState, State
    Gui, Add, Edit, w110 vvarZip, Zip Code
    gui, show ; autosize - no specified w/h
    Gui, Add, Button, w110  , OK
    COM_AtLaxWinInit()  
    pwb:=COM_AtlAxGetControl(COM_AtlAxCreateContainer(WinExist(), 12, 200, 230, 200, "shell.explorer") )
    COM_Invoke(pwb, "Navigate", "http://www.nestle-abuelita.com/EN/Granulado/")
    
    Gui, Show, x400 y400 h379 w259, Bot
    Return
    
    ButtonOK:
    Gui, Submit, NoHide
    
    JS := "javascript:document.getElementById('ctl00_cphMainContent_txtFirstName').value='" varFirstname "';void(0)"
    JS1 := "javascript:document.getElementById('ctl00_cphMainContent_txtLastName').value='" varLastname "';void(0)"
    JS2 := "javascript:document.getElementById('ctl00_cphMainContent_txtEmail').value='" varEmail "';void(0)"
    JS3 := "javascript:document.getElementById('ctl00_cphMainContent_txtEmailConfirm').value='" varEmail "';void(0)"
    JS4 := "javascript:document.getElementById('ctl00_cphMainContent_txtAddress').value='" varAddy "';void(0)"
    JS5 := "javascript:document.getElementById('ctl00_cphMainContent_txtCity').value='" varCity "';void(0)"
    JS6 := "javascript:document.getElementById('ctl00$cphMainContent$ddlStates$ctl00').value='" varState "';void(0)"
    JS7 := "javascript:document.getElementById('ctl00_cphMainContent_txtZipcode').value='" varZip "';void(0)"
    JS8 := "javascript:document.forms[0].submit()"
    
    COM_Invoke(pwb, "Navigate", JS)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS1)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS2)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS3)
    Sleep, 1000
    COM_Invoke(pwb, "Navigate", JS4)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS5)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS6)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS7)
    Sleep, 100
    COM_Invoke(pwb, "Navigate", JS8)
    Sleep, 100
    did a quick fix, i'm pretty sure it's fixed
    ▀█ █▄█ ▄█▀ ▐▀▌


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Facebook Bots | Admin Forum