Jump to content

Noob Question


Recommended Posts

i am a complete noob to scripting and such but im trying to learn.. im having a problem with a user function ive made

my script goes like this

#include <ie.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://website.com", 0)
_IEPopUps()
>-----<  Rest of my code below this

Then my function at the bottom
Func _IEPopUps()
      $title = WinGetTitle("", "")
           If $title = "Security Alert" Then
           Msgbox(0,"Value of", $title)
           EndIf
EndFunc

well the problem im having is that when it goes to the function that works fine and it displays the msgbox (which is just for testing) but the problem is the script closes after the function is complete it wont continue the script.

I have looked through other user defined functions and i just dont get what im not doing ?

can anyone help?

Link to comment
Share on other sites

  • Moderators

You'll need to use a loop:

#include <ie.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://website.com", 0)
_IEPopUps()
>-----<  Rest of my code below this
AdlibEnable('_IEPopUps', 1000); Check the function every 1 second
While 1
    Sleep(2000)
WEnd
Then my function at the bottom
Func _IEPopUps()
      $title = WinGetTitle("", "")
           If $title = "Security Alert" Then
           Msgbox(0,"Value of", $title)
           EndIf
EndFunc
Forgot to say "And" maybe AdlibEnable() Edited by SmOke_N

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

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