szucsaaron Posted May 28, 2012 Share Posted May 28, 2012 (edited) Hi In my script i made a do until loop and i want to end it with Isarray but when i tryed nothing happens it doesnt shows an error but it keeps doing the loop and it wont stop. See my script: Do If Not @error then Msgbox (1,"Hello","hello") Sleep (1000) Msgbox(1,"Hello","hello") EndIf Until IsArray($coord) and the script would go on Edited May 28, 2012 by szucsaaron Link to comment Share on other sites More sharing options...
water Posted May 28, 2012 Share Posted May 28, 2012 Can you please post the code you have? This way it's much easier to help. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 there you go sorry i forgot that part Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 i want it to end when the $coord is array Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 but it keeps going on Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 28, 2012 Moderators Share Posted May 28, 2012 szucsaaron,Please use the "Edit" button rather then posting single phrases every few seconds. You already have 5 posts and so padding your post count serves no useful purpose. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 ok sorry Link to comment Share on other sites More sharing options...
water Posted May 28, 2012 Share Posted May 28, 2012 You have to set $coord to an array in the Do / Until loop. Else you'll never exit the loop (as you can see now). My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 and how do i do that? sorry but im newbie Link to comment Share on other sites More sharing options...
water Posted May 28, 2012 Share Posted May 28, 2012 It depends on what you try to do with your script. The code you posted looks like a cut down version of your script. Can you post the whole script or at least tell us what you try to do? If you post your code please enclose it in tags. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 sorry but i cant post the whole script itself because its one of my friends but he has no internet now but he said he want something with pixelsearch and he wants this continue to go on if something can be seen on the desktop like u know he has win 7 so his screensaver keeps on changing and when the screensaver goes to one of thoose he wants that this should end (do...until) Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 (edited) $coord = PixelSearch(539, 495, 778, 620 0xFCF097) Do If Not @error then Msgbox (1,"Hello","hello") Sleep (1000) Msgbox(1,"Hello","hello") EndIf Until IsArray($coord) Until IsArray($coord) Sleep(1000) If IsArray($coord) Then MouseMove($coord[0], $coord[1]) MouseClick("LEFT") Sleep(10000) EndIf thats all what he dictated for me because he said its a long way till the end and the beggining Edited May 28, 2012 by szucsaaron Link to comment Share on other sites More sharing options...
BrewManNH Posted May 28, 2012 Share Posted May 28, 2012 Try putting the pixelsearch line INSIDE the first Do loop (just before the If Not @error line), otherwise $coord will never get updated. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 but it doesnt need refreshing it just should exit that loop when the $coord is shown on his desktop right? Link to comment Share on other sites More sharing options...
BrewManNH Posted May 28, 2012 Share Posted May 28, 2012 No, how do you expect the $coord array to get created if you're not actually looking for the pixel? Trust me on this, put the line inside the Do loop where I said to put it, it should work, if that pixel color ever shows up. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 (edited) should it look like this? Do $coord = PixelSearch(539, 495, 778, 620 0xFCF097) If Not @error then Msgbox (1,"Hello","hello") Sleep (1000) Msgbox(1,"Hello","hello") EndIf Until IsArray($coord) Sleep(1000) If IsArray($coord) Then MouseMove($coord[0], $coord[1]) MouseClick("LEFT") Sleep(10000) EndIf Edited May 28, 2012 by szucsaaron Link to comment Share on other sites More sharing options...
BrewManNH Posted May 28, 2012 Share Posted May 28, 2012 Well, you'll need a comma between the 620 and 0xFCF097, but that is what I was suggesting. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
water Posted May 28, 2012 Share Posted May 28, 2012 You can remove the second check for array because this part of the code will only be executed when $coord is an array:Do $coord = PixelSearch(539, 495, 778, 620 0xFCF097) If Not @error Then MsgBox(1, "Hello", "hello") Sleep(1000) MsgBox(1, "Hello", "hello") EndIf Until IsArray($coord) Sleep(1000) MouseMove($coord[0], $coord[1]) MouseClick("LEFT") Sleep(10000) Another question: What do you want to do with your script? PixelSearch often is used for some kind of game automation? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
szucsaaron Posted May 28, 2012 Author Share Posted May 28, 2012 My pc has some kinda virus what gives ads and it shall be like a relflex u know which closes them and its from different parts and theese warn me that u know but thanks anyway i'll try it out Link to comment Share on other sites More sharing options...
water Posted May 28, 2012 Share Posted May 28, 2012 But shouldn't you first try to get rid of the virus? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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