Sign in to follow this  
Followers 0
ColdDeath

Sleep on loading

5 posts in this topic

Hello,

I'm a Firefox user, and AutoIt v3 user. I'm new to the forum, this is my first post, hope you can help me! Al the question are related to Firefox:

Q1:

The time of loading of pages is bugging me out, I put the script on sleep for a few seconds, and when I need to click something, the page is useally loaded, but not always.

I've tried searching around with Window Info, but the windows doesn't change from title or anything. The only thing that changes is the Statusbar, but that information isn't given in Window Info... So my question, is it possible to make a "winwaitactive" command on the firefox status bar?

Q2:

Script 1

While $bLoop = 1

$text = InputBox("Planet Checker", "Input land value")

If $text < "850" Then

$answer = MsgBox(4, "Too bad", "The number was under 850!")

Else

$answer = MsgBox(4, "Congratz", "The number was over 850!")

WEnd

Script 2

Send ("866{Enter}")

It tried combining it like this

While $bLoop = 1

$text = InputBox("Planet Checker", "Input land value")

Send ("866{Enter}")

If $text < "850" Then

$answer = MsgBox(4, "Too bad", "The number was under 850!")

Else

$answer = MsgBox(4, "Congratz", "The number was over 850!")

WEnd

But that doesnt work, only when inputbox has been filled in it will execute the send command. Any suggestions?

Q3:

Script 1

While $bLoop = 1

winactivate ("AutoIt Forums")

sleep (5000)

WEnd

Script 2

While $bLoop = 1

if winactive ("There's no internet") =1 Then

Send ("{F}5")

WEnd

How can I combine the control script (Script 2) with the main script (Script 1) without spamming the control script on every line in the main script?

Greetings,

ColdDeath

Share this post


Link to post
Share on other sites



Hello,

I'm a Firefox user, and AutoIt v3 user. I'm new to the forum, this is my first post, hope you can help me! Al the question are related to Firefox:

Q1:

The time of loading of pages is bugging me out, I put the script on sleep for a few seconds, and when I need to click something, the page is useally loaded, but not always.

I've tried searching around with Window Info, but the windows doesn't change from title or anything. The only thing that changes is the Statusbar, but that information isn't given in Window Info... So my question, is it possible to make a "winwaitactive" command on the firefox status bar?

Q2:

Script 1

While $bLoop = 1

$text = InputBox("Planet Checker", "Input land value")

If $text < "850" Then

$answer = MsgBox(4, "Too bad", "The number was under 850!")

Else

$answer = MsgBox(4, "Congratz", "The number was over 850!")

WEnd

Script 2

Send ("866{Enter}")

It tried combining it like this

While $bLoop = 1

$text = InputBox("Planet Checker", "Input land value")

Send ("866{Enter}")

If $text < "850" Then

$answer = MsgBox(4, "Too bad", "The number was under 850!")

Else

$answer = MsgBox(4, "Congratz", "The number was over 850!")

WEnd

But that doesnt work, only when inputbox has been filled in it will execute the send command. Any suggestions?

Q3:

Script 1

While $bLoop = 1

winactivate ("AutoIt Forums")

sleep (5000)

WEnd

Script 2

While $bLoop = 1

if winactive ("There's no internet") =1 Then

Send ("{F}5")

WEnd

How can I combine the control script (Script 2) with the main script (Script 1) without spamming the control script on every line in the main script?

Greetings,

ColdDeath

Welcome to the forums ColdDeath :mellow:

You have managed to totally confuse me at your first attempt!

Apart from the last script, where to send F5 you should use

Send("{F5}")

I can't offer much help because I don't understand what you want to do.

Can you concentrate on the scripts 1 and 2 and explain what you want to happen?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Welcome to the forums ColdDeath :mellow:

You have managed to totally confuse me at your first attempt!

Apart from the last script, where to send F5 you should use

Send("{F5}")

I can't offer much help because I don't understand what you want to do.

Can you concentrate on the scripts 1 and 2 and explain what you want to happen?

Okay try to put it as simple as possible

Question 1:

When a page is loading, and I'm using Firefox by the way, under you can read which page he's currently loading. When he's done loading, you can read "Done".

It's known that not every page uses the same time to load, and not everytime my internet connection is as fast as the previous attempt, etc, etc, etc.

So, is there a way that my scripts executes a command as soon as the page is done loading?

Question 2:

In script 1: I've made an inputbox to check the data I just collected

In script 2: I insert the data I just collected (in this case it's 866)

In script 3: I tried to combine it, so that I get the inputbox and insert the data.

That didn't work, what happens is: Inputbox asks to fill in the data, and waits till I've filled it in. When I've filled in the data it executes the send command.

I want an inputbox, and directly send the data, so it can be checked.

Question 3:

Script 1

While $bLoop = 1

winactivate ("AutoIt Forums")

sleep (5000)

WEnd

Script 2

While $bLoop = 1

if winactive ("There's no internet") =1 Then

Send ("{F}5")

WEnd

Script 2 is a monitor script, so script one doesn't faile. Now if I want just 1 script it will be like this:

While $bLoop = 1

winactivate ("AutoIt Forums")

if winactive ("There's no internet") =1 Then

Send ("{F5}")

Else

sleep (5000)

if winactive ("There's no internet") =1 Then

Send ("{F}5")

Else

EndIf

EndIf

WEnd

Okay in this case the script is a bit to small, but you probly get the point. I get a massive text file!

Hope I made it clear!

Greetings,

ColdDeath

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

These are the real scripts, it's based on a website that requires logging. So I thought it would be best not to show them...

Okay, so these 3 scripts are infact Question 2.

;Planet Checker.au3
$bLoop = 1

While $bLoop = 1
    
    $text = InputBox("Planet Checker", "Input land value")
    
        If $text < "850" Then
                
            $text = InputBox("Planet Checker", "Input Planet Name")
                
                If $text <> "X" Then
                    MouseClick  ( "left", 287, 330 )
                    Sleep       ( 8000 )
                    MouseClick  ( "left", 423, 325 )
                    Sleep       ( 8000 )
                    MouseClick  ( "left", 784, 420 )
                    Sleep       ( 8000 )
                    MouseClick  ( "left", 624, 503 )
                    ShellExecute("C:\Documents and Settings\Roelofs\Bureaublad\Scripts\Explorer.au3","","","Run")
                Else
                    ShellExecute("C:\Documents and Settings\Roelofs\Bureaublad\Scripts\X-planet.au3","","","Run")
                EndIf
        Else
            ShellExecute("C:\Documents and Settings\Roelofs\Bureaublad\Scripts\Explorer.au3","","","Run")
        EndIf
WEndoÝ÷ Ù«­¢+ØíáÁ±½ÉÈ)M±À ÈÔÀÀ¤((]¥¹Ñ¥ÙÑ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤(%]¥¹]¥ÑÑ¥Ù Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤((5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÈØä°ÐÄÔ¤)M±À ÐÀÀÀ¤(((%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÌäÔ¤($%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÐÀÀ¤($$%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÐÀÔ¤($$$%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÐÄÀ¤($$$$%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÐÄÔ¤($$$$$%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÐÈÀ¤($$$$$$%5½ÕÍ
±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜÜà°ÐÈÔ¤)M±À àÀÀÀ¤((%5½ÕÍ
±¥­É ÅÕ½Ðí±ÐÅÕ½Ðì°ÐÐÄ°ÌÈÄ°ÜØà°ÌÈĤ)M±À ÔÀÀ¤(%M¹ ÅÕ½ÐìyÅÕ½Ðì¤)M±À ÔÀÀ¤(((%]¥¹Ñ¥ÙÑ ÌäíA±¹Ð
¡­ÈÌäì¤(%]¥¹]¥ÑÑ¥Ù ÌäíA±¹Ð
¡­ÈÌäì¤(%͹ ÅÕ½ÐìyØÅÕ½Ðì¤($)M±À ÔÀÀ¤($%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤)M±À ÔÀ¤($$%M¹ ÅÕ½Ðíí 
-MA
ôÅÕ½Ðì¤)M±À ÔÀ¤($$$%M¹ ÅÕ½Ðíí1QôÅÕ½Ðì¤($$$%M¹ ÅÕ½Ðíí1QôÅÕ½Ðì¤($$$%M¹ ÅÕ½Ðíí1QôÅÕ½Ðì¤)M±À ÔÀ¤($$$$%M¹ ÅÕ½Ðíí   
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤)M±À ÔÀÀ¤($$$$$%M¹ ÅÕ½Ðíí9QIôÅÕ½Ðì¤($$$$$$(]¥¹Ñ¥ÙÑ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤(%]¥¹]¥ÑÑ¥Ù Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤($((%5½ÕÍ
±¥­É ÅÕ½Ðí±ÐÅÕ½Ðì°ÐÌØ°ÌÀаÜØà°ÌÀФ)M±À ÔÀÀ¤(%M¹ ÅÕ½ÐìyÅÕ½Ðì¤)M±À ÔÀ¤(((%]¥¹Ñ¥ÙÑ ÌäíA±¹Ð
¡­ÈÌäì¤(%]¥¹]¥ÑÑ¥Ù ÌäíA±¹Ð
¡­ÈÌäì¤(%M¹ ÅÕ½ÐìyØÅÕ½Ðì¤)M±À ÔÀÀ¤($%M¹ ÅÕ½Ðíí 
-MA
ôÅÕ½Ðì¤)M±À ÔÀ¤($$%M¹ ÅÕ½Ðíí 
-MA
ôÅÕ½Ðì¤($$%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤($$%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤($$%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤($$%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤($$%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤)M±À ÔÀ¤($$%M¹ ÅÕ½Ðíí1QôÅÕ½Ðì¤)M±À ÔÀ¤($$$$%M¹ ÅÕ½Ðíí  
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤($$$$%M¹ ÅÕ½Ðíí    
-MA
ôÅÕ½Ðì¤)M±À ÔÀÀ¤($$$$$%M¹ ÅÕ½Ðíí9QIôÅÕ½Ðì¤)á¥ÐoÝ÷ Ù«­¢+Øì`µÁ±¹Ð)]¥¹Ñ¥ÙÑ$ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤)]¥¹]¥ÑÑ¥Ù$ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí1ÐÅÕ½Ðì°ÈØä°ÐÄФ)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí1ÐÅÕ½Ðì°ÜÜÜ°ÐÄܤ)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí1ÐÅÕ½Ðì°ÈØä°ÐÄФ)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí1ÐÅÕ½Ðì°ÜÜÜ°ÐÄܤ)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÈÜаÐàȤ)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÐÈà°ÐÈÔ¤)M±À$$$ àÀÀÀ¤)$$$ ÅÕ½ÐìÄÅÕ½Ðì¤)M±À$$$ ÔÀÀ¤)$$$ ÅÕ½Ðíí¹ÑÉôÅÕ½Ðì¤)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÈÜаÐÌÀ¤)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ØÈÄ°ÌÄĤ)M±À$$$ àÀÀÀ¤)5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ØÌä°ÐÄà¤)M±À$$$ àÀÀÀ¤)]¡¥±ÀÌØí1½½ÀôÄ)]¥¹Ñ¥ÙÑ$ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤(%]¥¹]¥ÑÑ¥Ù$ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐØÀ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐØÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐÜÀ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐÜÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐàÀ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐàÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐäÀ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÐäÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÔÀÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÔÄÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÔÈÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÔÌÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÔÐÔ¤(%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°Øäà°ÔÔÔ¤($%M±À àÀÀÀÀ¤($%%]¥¹Ñ¥ÙÑ ÅÕ½Ðí5½é¥±±¥É½àÅÕ½Ðì¤ôÄQ¡¸($$%]¥¹Ñ¥ÙÑ$ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤($$%]¥¹]¥ÑÑ¥Ù$ Ìäì¡M¤±Ñ¥
½¹ÅÕÍд5½é¥±±¥É½àÌäì¤($$%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÈÜаÐàȤ($$%M±À$$$ àÀÀÀ¤($$%5½ÕÍ
±¥¬$$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÐÌÀ°àÔÀ¤($$%M±À$$$ àÀÀÀ¤($$%M¹$$$ ÅÕ½ÐìØÐÀÅÕ½Ðì¤($$%M¹$$$ ÅÕ½Ðíí¹ÑÉôÅÕ½Ðì¤($$%M¡±±áÕÑ$ ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈíI½±½ÌÀäÈí   ÕÉÕ±ÀäÈíMÉ¥ÁÑÌÀäÈíáÁ±½ÉȹÔÌÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíIÕ¸ÅÕ½Ðì¤($$%á¥Ñ1½½À($%¹%(%]¹)á¥Ð

Hope it helps!!!

ColdDeath

Edited by ColdDeath

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr
HotKeySet("{ESC}", "OnAutoItExit")
$iChildprocessId = _Childprocess()
While Sleep(5000)
    WinActivate("AutoIt Forums")
WEnd
Func OnAutoItExit($iChildprocessId = $iChildprocessId)
    If $iChildprocessId Then ProcessClose($iChildprocessId)
    Exit
EndFunc   ;==>OnAutoItExit
Func _Childprocess()
    If $CmdLine[0] = 0 Then Return Run("""" & @AutoItExe & """    """ & @ScriptFullPath & """ Childprocess")
    While Sleep(500)
        If WinActive("There's no internet") Then Send("{F5}")
    WEnd
EndFunc   ;==>_Childprocess

I have no idea what u have done here... Could you explain it step by step?

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