Jump to content

Working with IE


 Share

Recommended Posts

here is my coding for this. i had to change the link because it is a sensitve link.

I want to add a loop to where it will open the link and wait for a period of time then close it. and loop that.

#include <guiconstants.au3>
Dim $ItemIWantTrueToAct = 3
$MainGUI = GUICreate('MyGUI', 400, 300)
$Button = GUICtrlCreateButton('First Class Solitare', 100, 10, 150, 30)

GUISetState()
While 1
    $MainMsg = GUIGetMsg()
    Select
    Case $MainMsg = $GUI_EVENT_CLOSE
        Exit
   Case $MainMsg = $Button  
      Run("C:\Program Files\Mozilla Firefox\firefox.exe")
     WinWait('Mozilla')
      MouseClick("left", 245, 65, 5)
      send('http://www.pogo.com{ENTER}')
       Sleep(10000)
    EndSelect
WEnd
I am really starting to learn how to piece together the puzzle that is AutoIt. [u]ComboBox RadioButton Help.au3[/u]
Link to comment
Share on other sites

  • Moderators

I just glanced at this... but just so you know... this won't work: send('http://www.pogo.com{ENTER}') when using a send and a enter you have to seperate the string send command from the enter command.

Send('Text' & '{ENTER}') as an example.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

um... NO? I mean... I believe you're :lmao: mistaken...

Yeh, I thought about it after I posted... just figured I'd leave my idiotic response up there!!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yeh, I thought about it after I posted... just figured I'd leave my idiotic response up there!!

Oh, so when people can talk about how you're never wrong, you can correct them? Good idea, but looking at your posts for the day, i'd say any one would be example enough... :lmao: Sorry, i don't mean to pick, you know i have nothing but respect for your abilities. You were kind of asking for it today though... sleepy bastard.
Link to comment
Share on other sites

here is my latest problem

Case $MainMsg = $Button2
            Run("C:\Program Files\Mozilla Firefox\firefox.exe")
            WinWait('Mozilla')
            MouseClick("left", 250, 90, 1)
            Send('http://www.pogo.com/room/connect.jsp?game=popfu&site=pogop&apid&auto=PlayNow{ENTER}')
            Do
            Sleep(3600000)
            MouseClick("left", 780, 100, 1)
            Send('{lctr}{lshift}R')
            Until('{ESCAPE}')

i want this to loop till the user presses the Esc key.

also i would like to add a place where the user could define the sleep time.

Edited by HHCory
I am really starting to learn how to piece together the puzzle that is AutoIt. [u]ComboBox RadioButton Help.au3[/u]
Link to comment
Share on other sites

here is my latest problem

Case $MainMsg = $Button2
            Run("C:\Program Files\Mozilla Firefox\firefox.exe")
            WinWait('Mozilla')
            MouseClick("left", 250, 90, 1)
            Send('http://www.pogo.com/room/connect.jsp?game=popfu&site=pogop&apid&auto=PlayNow{ENTER}')
            Do
            Sleep(3600000)
            MouseClick("left", 780, 100, 1)
            Send('{lctr}{lshift}R')
            Until('{ESCAPE}')

i want this to loop till the user presses the Esc key.

also i would like to add a place where the user could define the sleep time.

Hate to be a stick in the mud, and I'm not sure why no one has suggested this, but wouldn't this be easier?

Global $DumpOut = 0
; This mode is less prone to errors when screen resolution is different than what you use to determine coordinates - not important to this thread?
AutoItSetOption ( 'MouseCoordMode', 2 )
Run('"C:\Program Files\Mozilla Firefox\firefox.exe" http://www.pogo.com/room/connect.jsp?game=popfu&site=pogop&apid&auto=PlayNow' )
Do
  Sleep ( 250 )
Until WinExists ( 'Club Pogo' )
WinActivate ( 'Club Pogo' )
; Set Optios-->CoordMode-->Client in AutoIt Window Info to get coordinates
MouseClick ( 'left', 457, 492 ); This clicks the Sign In button on the page above for me
HotKeySet ( '{Esc}', "MyExitLoop" )
While 1
    MsgBox ( 0, @ScriptName, 'Now?' )
    If $DumpOut = 1 Then ExitLoop
WEnd
$DumpOut = 0    
Func MyExitLoop()
    $DumpOut = 1
EndFunc

Hope this helps.

Link to comment
Share on other sites

maybe this could help

WinGetHandle

WinGetHandle

--------------------------------------------------------------------------------

Retrieves the internal handle of a window.

WinGetHandle ( "title" [, "text"] )

Parameters

title The title of the window to read. See Title special definition.

text [optional] The text of the window to read.

Return Value

Success: Returns handle to the window.

Failure: Returns "" (blank string) and sets @error to 1 if no window matches the criteria.

Remarks

This function is for use with the advanced WinTitleMatchMode options that allow you to use classnames and handles to specify windows rather than "title" and "text".

Once you have obtained the handle you can access the required window even if its title changes.

8)

NEWHeader1.png

Link to comment
Share on other sites

Do
  Sleep ( 250 )
Until WinExists ( 'Club Pogo' )
WinActivate ( 'Club Pogo' )

this wont work in this situation. most users will already be signed in. once a user is signed in then the name of the window changes to the user name and the room information. Which will be different for every user/ loop.

Do
            Run('"C:\Program Files\Mozilla Firefox\firefox.exe" http://www.pogo.com/room/connect.jsp?game=popfu&site=pogop&apid&auto=PlayNow' )
            Sleep (30000)
            Until (Escape)
                         HotKeySet ( '{Esc}', "MyExitLoop" )

this would work for me better but i dont think this is the right code to exit loop

I am really starting to learn how to piece together the puzzle that is AutoIt. [u]ComboBox RadioButton Help.au3[/u]
Link to comment
Share on other sites

if you use runwait then what will close the window? Sorry to be such a NOOOOOB.

I under stand that runwait will pause the auto till the window is closed. what i need is something that will close the window in a user defined amount of time. then loop the whole prosses till the use hits Esc.

I am really starting to learn how to piece together the puzzle that is AutoIt. [u]ComboBox RadioButton Help.au3[/u]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...