zakiller Posted August 24, 2012 Share Posted August 24, 2012 ok i make this script for sharing my page on fb in another pages but when i made something similar to it ... it worked fine without the non-array error but now it makes me a non-array error even if i writed this code in the error place so here is my script expandcollapse popupsleep(1500) MouseClick("left",102, 782,1,7) Sleep(1500) MouseClick("left",223, 15,1,7) Sleep(1500) MouseClick("left",245, 42,1,7) Sleep(1500) Send("^c") Sleep(1500) MouseClick("left",135, 12,1,7) Sleep(1500) MouseClick("left",308, 618,1,7) Sleep(1500) Send("^v") Sleep(1500) Send("{Enter}") Sleep(1500) Send("{End}") Sleep(1500) MouseClick("left",280, 546,1,7) Sleep(1500) $sharepage = PixelSearch(671, 465,859, 660,0x5972A6) Sleep(1500) If Not @error Then MouseClick("left",$sharepage[0],$sharepage[1],1,7) EndIf If IsArray($sharepage) = True Then EndIf Sleep(1500) MouseClick("left",46, 11,1,7) Sleep(1500) MouseClick("left",187, 42,1,7) Sleep(1500) Send("^c") Sleep(1500) MouseClick("left",187, 42,1,7) Sleep(1500) MouseClick("left",256, 735,1,7) sleep(1800) Send("{End}") Sleep(1500) $write_a_comment = PixelSearch(216, 119,932, 731,0x777777) Sleep(1500) If Not @error Then MouseClick("left",$write_a_comment[0],$write_a_comment[1],1,7) EndIf If IsArray($write_a_comment) = True Then EndIf Send("^v") Sleep(1500) Send("{Enter}") Sleep(1500) Send("^w") so plzzzz help me Link to comment Share on other sites More sharing options...
zakiller Posted August 24, 2012 Author Share Posted August 24, 2012 sorry this is the right post ok i made this script for sharing my page on fb in another pages but when i made something similar to it in the past ... it worked fine without giving me the non-array error but now it makes me a non-array error even if i writed this code in the error place if not @error then endif so here is my script expandcollapse popupsleep(1500) MouseClick("left",102, 782,1,7) Sleep(1500) MouseClick("left",223, 15,1,7) Sleep(1500) MouseClick("left",245, 42,1,7) Sleep(1500) Send("^c") Sleep(1500) MouseClick("left",135, 12,1,7) Sleep(1500) MouseClick("left",308, 618,1,7) Sleep(1500) Send("^v") Sleep(1500) Send("{Enter}") Sleep(1500) Send("{End}") Sleep(1500) MouseClick("left",280, 546,1,7) Sleep(1500) $sharepage = PixelSearch(671, 465,859, 660,0x5972A6) Sleep(1500) If Not @error Then MouseClick("left",$sharepage[0],$sharepage[1],1,7) EndIf If IsArray($sharepage) = True Then EndIf Sleep(1500) MouseClick("left",46, 11,1,7) Sleep(1500) MouseClick("left",187, 42,1,7) Sleep(1500) Send("^c") Sleep(1500) MouseClick("left",187, 42,1,7) Sleep(1500) MouseClick("left",256, 735,1,7) sleep(1800) Send("{End}") Sleep(1500) $write_a_comment = PixelSearch(216, 119,932, 731,0x777777) Sleep(1500) If Not @error Then MouseClick("left",$write_a_comment[0],$write_a_comment[1],1,7) EndIf If IsArray($write_a_comment) = True Then EndIf Send("^v") Sleep(1500) Send("{Enter}") Sleep(1500) Send("^w") so plzzzz help me Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 24, 2012 Moderators Share Posted August 24, 2012 zakiller,Welcome to the AutoIt forum. You have your IsArray test in the wrong place. $sharepage = PixelSearch(671, 465,859, 660,0x5972A6) Sleep(1500) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @error is set by this line, not the one above If Not @error Then ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< And Sleep never returns a error so... MouseClick("left",$sharepage[0],$sharepage[1],1,7) ; << this line will always execute even if there is no array EndIf If IsArray($sharepage) = True Then ; <<<<<<<<<<<<<<<<<<<<<< And this is too late EndIfTry something like this:$sharepage = PixelSearch(671, 465,859, 660, 0x5972A6) Sleep(1500) ; Now check if the pixel was found If IsArray($sharepage) Then ; And only click if it was found MouseClick("left", $sharepage[0], $sharepage[1], 1, 7) Else ; Whatever you do if you do not find the pixel EndIfM23P.S. This thread was reported. The Forum Rules prohibit spamming and login scripts - I see no evidence of that here. 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...
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