danielgomez Posted May 24, 2017 Share Posted May 24, 2017 Hola no se si me puedan ayudar pero tengo un problema con mi código específicamente en esta función ya que yo quiero que el siclo cierre el programa cuando $i <= $selector cual creen que sea el problema ? $seleccion = GUICtrlCreateCombo("Select", 104, 200, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "2|4|6") Func buscarimg() $buscar_x = 0 $buscar_y = 0 Local $i = 0 $selector = GUICtrlRead($seleccion) $search_img = _ImageSearch('axep.bmp', 1, $buscar_x, $buscar_y, 0) While $i <= $selector If $search_img = 1 Then MouseClick($MOUSE_CLICK_LEFT, $buscar_x, $buscar_y, 2) EndIf clickexit() If $i <= $selector Then MsgBox(0, "Error", "la imagen no se encontro") Exit EndIf $i = $i + 1 WEnd EndFunc ;==>buscarimg Func clickexit() $click_x = 0 $click_y = 0 $search_exit = _ImageSearch('exit.bmp', 1, $click_x, $click_y, 0) If $search_exit = 1 Then MouseClick($MOUSE_CLICK_LEFT, $click_x, $click_y, 1) EndIf EndFunc ;==>clickexit Donde creen que pueda estar el error ? Link to comment Share on other sites More sharing options...
anthonyjr2 Posted May 24, 2017 Share Posted May 24, 2017 Hi Daniel, Most of the people on this forum communicate in English, and it will make it a lot easier for us to help you if you post in the future using Google Translate or some other translator. What problem are you having? It seems that it should exit if $i <= $selector UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
danielgomez Posted May 24, 2017 Author Share Posted May 24, 2017 (edited) Ahh ok sorry, The problem is that when $i <= $selector don't exit program :S (my english is very bad sorry XD) Edited May 24, 2017 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
anthonyjr2 Posted May 24, 2017 Share Posted May 24, 2017 $seleccion = GUICtrlCreateCombo("Select", 104, 200, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "2|4|6") Func buscarimg() $buscar_x = 0 $buscar_y = 0 Local $i = 0 $selector = GUICtrlRead($seleccion) $search_img = _ImageSearch('axep.bmp', 1, $buscar_x, $buscar_y, 0) While $i <= $selector If $search_img = 1 Then MouseClick($MOUSE_CLICK_LEFT, $buscar_x, $buscar_y, 2) EndIf clickexit() $i = $i + 1 If $i <= $selector Then MsgBox(0, "Error", "la imagen no se encontro") Exit EndIf WEnd EndFunc ;==>buscarimg Func clickexit() $click_x = 0 $click_y = 0 $search_exit = _ImageSearch('exit.bmp', 1, $click_x, $click_y, 0) If $search_exit = 1 Then MouseClick($MOUSE_CLICK_LEFT, $click_x, $click_y, 1) EndIf EndFunc ;==>clickexit Try this. I think it just had to do with where you were incrementing $i. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
danielgomez Posted May 24, 2017 Author Share Posted May 24, 2017 (edited) ok thanks you :3 I try it and I'll let you know Edited May 24, 2017 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 24, 2017 Moderators Share Posted May 24, 2017 danielgomez, When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote and it just pads the thread unnecessarily. 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...
danielgomez Posted May 24, 2017 Author Share Posted May 24, 2017 (edited) ok i'm sorry. A question, I have a forum in Spanish autoit, can I publish it? Edited May 24, 2017 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 24, 2017 Moderators Share Posted May 24, 2017 (edited) danielgomez, 2 hours ago, danielgomez said: ok i'm sorry So why use the "Quote" button again in the very same post? M23 Edit: You could add the URL of your Spanish site to your sig. Edited May 24, 2017 by Melba23 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...
danielgomez Posted May 25, 2017 Author Share Posted May 25, 2017 9 hours ago, anthonyjr2 said: $seleccion = GUICtrlCreateCombo("Select", 104, 200, 57, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "2|4|6") Func buscarimg() $buscar_x = 0 $buscar_y = 0 Local $i = 0 $selector = GUICtrlRead($seleccion) $search_img = _ImageSearch('axep.bmp', 1, $buscar_x, $buscar_y, 0) While $i <= $selector If $search_img = 1 Then MouseClick($MOUSE_CLICK_LEFT, $buscar_x, $buscar_y, 2) EndIf clickexit() $i = $i + 1 If $i <= $selector Then MsgBox(0, "Error", "la imagen no se encontro") Exit EndIf WEnd EndFunc ;==>buscarimg Func clickexit() $click_x = 0 $click_y = 0 $search_exit = _ImageSearch('exit.bmp', 1, $click_x, $click_y, 0) If $search_exit = 1 Then MouseClick($MOUSE_CLICK_LEFT, $click_x, $click_y, 1) EndIf EndFunc ;==>clickexit Try this. I think it just had to do with where you were incrementing $i. Friend the code still does not work try another alternative and none. What I'm looking for is that if the variables are met and the cicle is performed according to the programmed hours the program is closed. Link to comment Share on other sites More sharing options...
anthonyjr2 Posted May 25, 2017 Share Posted May 25, 2017 Is your Error box coming up at all? Or is it never even going into the if statement? I can't really test it on my end because I don't really know what it's used for. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
danielgomez Posted May 25, 2017 Author Share Posted May 25, 2017 1 hour ago, anthonyjr2 said: Is your Error box coming up at all? Or is it never even going into the if statement? I can't really test it on my end because I don't really know what it's used for. The problem is that it complies with the if statement but it never stops don't throws the error in case the cicle is met the requested number of times 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