Jump to content

Need help to triger it once, but do it over an over


Recommended Posts

Hi i managed to do very simple code :) but it keeps triggering even if it shoudnt do it, i mean keeps opening that link on new windows

While 1
WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
        If PixelGetColor( 170, 388 ) <> 0x373827 Then
        ShellExecute("mylink")
    EndIf
Wend

maybe some advise?

Link to comment
Share on other sites

Hi i managed to do very simple code :) but it keeps triggering even if it shoudnt do it, i mean keeps opening that link on new windows

While 1
WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
        If PixelGetColor( 170, 388 ) <> 0x373827 Then
        ShellExecute("mylink")
    EndIf
Wend

maybe some advise?

Your while loop never ends so it's going to keep doing it. Perhaps after you do the ShellExecute("mylink") you should get out of your loop.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

you can exit the While loop with ExitLoop, im not sure what the rest of ur code looks like but u might want to set the WinWait and Winwaitactive above your while loop also.

While 1
    WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
    WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
    If PixelGetColor( 170, 388 ) <> 0x373827 Then
        ShellExecute("mylink")
        ExitLoop
    EndIf
Wend
Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

um what you mean get out, if i remove while loop it trigger once then ends :/

I guess I don't understand what you are wanting. A s long as If PixelGetColor( 170, 388 ) <> 0x373827 is true it's going to keep opening that link over and over in that loop. Maybe you want a sleep command in there to space it out. Or maybe close the "Take it Easy" window so it won;t do it until that window pops up again.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

hehe thanks for fast replies it works ^^ this forum is best :)

Fast, but are we helping? I think we both are a little unclear of what you want to I don't know if we've done you any good.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

um thats weird it works but its exits after triggers one time :/

i just want that it trigger if there is specified text (picture), and hit f5 (since i coudntn manage to do it, i decided to use shellexecute)

heres a screen

Posted Image

Edited by lolifox
Link to comment
Share on other sites

i just want that it trigger if there is specified text (picture), and hit f5 (since i coudntn manage to do it, i decided to use shellexecute)

Send("{F5}")

Should be all you need to hit F5. This would replace ShellExecute("mylink"). that should refresh the screen instead of opening a new link.

Edited by muncherw
Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

hehe i managed to get it work :)

WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
    If PixelGetColor(139, 366) <> 0x0267CB And PixelGetColor(153, 314) <> 0xFEF1B0  Then
        Send("{F5}")
    EndIf
    
While 1
    Sleep(100000)
WEnd

thanks all who helped me and this forum, ill be long member to this (ask many newbie questions too muttley )

Edited by lolifox
Link to comment
Share on other sites

hehe i managed to get it work :)

WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")
WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")
    If PixelGetColor(139, 366) <> 0x0267CB And PixelGetColor(153, 314) <> 0xFEF1B0  Then
        Send("{F5}")
    EndIf
    
While 1
    Sleep(100000)
WEnd

thanks all who helped me and this forum, ill be long member to this (ask many newbie questions too muttley )

Glad it's working, however:

While 1
    Sleep(100000)
WEnd

That will just sleep forever.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

um arent that code suppose to be to keep script active?

While 1
    Sleep(100000)
WEnd
Sure the script will be alive but it won't do anything. When you enter that while loop it does the sleep command. It goes to the wend command and sees that it should repeat because nothting has told it not too so it starts over and sleeps again. It will just keep sleeping over and over again.
Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

heh no wonder it keeps alive after clicking once, and then dont do anything second time, then it should have trigger option, hmm im out of ideas, how to make code work only once and keep it alive till i make it stop, i meant only once at that time and just wait for trigger

Edited by lolifox
Link to comment
Share on other sites

heh no wonder it keeps alive after clicking once, and then dont do anything second time, then it should have trigger option, hmm im out of ideas, how to make code work only once and keep it alive till i make it stop, i meant only once at that time and just wait for trigger

CODE

While 1

WinWait("Take easy, Keep your eyes be relax - Mozilla Firefox","")

WinWaitActive("Take easy, Keep your eyes be relax - Mozilla Firefox","")

If PixelGetColor(139, 366) <> 0x0267CB And PixelGetColor(153, 314) <> 0xFEF1B0 Then

Send("{F5}")

EndIf

Sleep(100000)

WEnd

This might be more what you are looking for. It refreshes the screen then does your sleep command. After that it will start the process all over again.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

hmm it trigers and hits F5 like crazy (if i set it to lower value on sleep, if not it just trigers after sleep time is over) :/ it must be my setting with pixels, can i ask for syntax on color because from what i have seen in examples there is different ways to determinate it like ex : <> , >= and so on (what each means, i coudnt find it on autoit help), and one more thing can i set that it could trigger the whole picture like this

Posted Image

or can it trigger the word in the specified place?

Edited by lolifox
Link to comment
Share on other sites

hmm it trigers and hits F5 like crazy (if i set it to lower value on sleep, if not it just trigers after sleep time is over) :/ it must be my setting with pixels, can i ask for syntax on color because from what i have seen in examples there is different ways to determinate it like ex : <> , >= and so on (what each means, i coudnt find it on autoit help), and one more thing can i set that it could trigger the whole picture like this

Posted Image

or can it trigger the word in the specified place?

As far as I know you can't trigger the whole picture you will actually need to look for a specific pixel. Are you trying to do somethign only if this picture is on the screen? The policeman shows up and you do something then the policeman goes away and you wait for him again? Because if that's what you are trying to do you could maybe see if it's loaded using some of the IE stuff. I haven't worked with that though.

My main question is does the policeman picture disappear after you do what you want?

Edited by muncherw
Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
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...