lolifox Posted July 2, 2008 Share Posted July 2, 2008 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 More sharing options...
muncherw Posted July 2, 2008 Share Posted July 2, 2008 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 More sharing options...
lolifox Posted July 2, 2008 Author Share Posted July 2, 2008 (edited) um what you mean get out, if i remove while loop it trigger once then ends :/ Edited July 2, 2008 by lolifox Link to comment Share on other sites More sharing options...
ofLight Posted July 2, 2008 Share Posted July 2, 2008 (edited) 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 July 2, 2008 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 More sharing options...
muncherw Posted July 2, 2008 Share Posted July 2, 2008 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 More sharing options...
lolifox Posted July 2, 2008 Author Share Posted July 2, 2008 hehe thanks for fast replies it works ^^ this forum is best Link to comment Share on other sites More sharing options...
muncherw Posted July 2, 2008 Share Posted July 2, 2008 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 More sharing options...
lolifox Posted July 2, 2008 Author Share Posted July 2, 2008 (edited) 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 Edited July 2, 2008 by lolifox Link to comment Share on other sites More sharing options...
muncherw Posted July 2, 2008 Share Posted July 2, 2008 (edited) 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 July 2, 2008 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 More sharing options...
lolifox Posted July 3, 2008 Author Share Posted July 3, 2008 (edited) 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 July 3, 2008 by lolifox Link to comment Share on other sites More sharing options...
muncherw Posted July 3, 2008 Share Posted July 3, 2008 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 More sharing options...
lolifox Posted July 3, 2008 Author Share Posted July 3, 2008 um arent that code suppose to be to keep script active? While 1 Sleep(100000) WEnd Link to comment Share on other sites More sharing options...
muncherw Posted July 3, 2008 Share Posted July 3, 2008 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 More sharing options...
lolifox Posted July 3, 2008 Author Share Posted July 3, 2008 (edited) 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 July 3, 2008 by lolifox Link to comment Share on other sites More sharing options...
muncherw Posted July 3, 2008 Share Posted July 3, 2008 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 triggerCODEWhile 1WinWait("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)WEndThis 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 More sharing options...
lolifox Posted July 3, 2008 Author Share Posted July 3, 2008 (edited) 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 or can it trigger the word in the specified place? Edited July 3, 2008 by lolifox Link to comment Share on other sites More sharing options...
muncherw Posted July 3, 2008 Share Posted July 3, 2008 (edited) 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 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 July 3, 2008 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 More sharing options...
lolifox Posted July 3, 2008 Author Share Posted July 3, 2008 yes thats what im using F5 button it dissapiers after you refresh site, and it comes after a while only Link to comment Share on other sites More sharing options...
muncherw Posted July 3, 2008 Share Posted July 3, 2008 yes thats what im using F5 button it dissapiers after you refresh site, and it comes after a while onlyThen I'd agree the pixel thing you are searching on isn't correct. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now