blu3dragon619 Posted June 10, 2012 Share Posted June 10, 2012 (edited) i'm new to autoit scriptting and cant seem to get some functions to work right if i can get some help that would be awsome... i have tryed looking at other forums and threads but cant seem to get help.what i have done so far is this script... belowwhat it should do...if script is run...it will find a active "word.doc" and open it up... then when F1 key is pressed... the script will start running....Step 1 of the script - looks within the range ($Left, $Top, $Right, $Bottom) for any red text/pixel color, if there are any, it should add 1 to a status list then click in the front of the red text/pixcel and hit "Enter" 2 times then move on to step 2....Step 2 of the script - looks within the range ($Left, $Top, $Right, $Bottom) for any blue text/pixel color, if there are any, it should add 1 to a status list then click in the front of the blue text/pixcel and hit "Enter" 2 times then move on to step 3....Step 3 of the script - looks within the range ($Left, $Top, $Right, $Bottom) for any green text/pixel color, if there are any, it should add 1 to a status list then click in the front of the green text/pixcel and hit "delete" key once and wait for 1 sec then hit "ctrl + HOME" to go to the top of the doc again.what else i want it to do is....if any green is found... on steps 3 it will do everything it should and return to the top of the doc and end the while loop in the script and restarts the loop from the top of the while fuction (so it should end loop then starts at step 1 again)... i cant figure out what to do to get this to work....what i have think of... i was thinking of adding a "ExitLoop" at the end of "Send("^HOME")" (which moves to the top of the doc again) on step 3, but that would only exit the loop and stop the script, so is there another command i should use so that it does not end the loop but restarts the loop from the begining?Any help would be great and greatful, thanks again for the time to read all this junk. expandcollapse popupWINACTIVATE("Word.doc") ;opens active program Global $Paused HotKeySet("F1","StartPause") ;STARTS and PAUSE Script HotKeySet("F2", "Stop") $start = False $Left = 300 $Top = 0 $Right = 1920 $Bottom = 1080 $TotalRed = 0 $TotalBlue = 0 $TotalGreen = 0 $red = 0xA56DF1 $blue = 0x6969FF $green = 0xB5F773 While = True if($start) Then $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $red) ;searches for red color If Not @error Then $TotalRed += 1 UpdateStatus() MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) Send("{Enter 2}") EndIf $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $blue) ;searches for blue color If Not @error Then $TotalBlue += 1 UpdateStatus() MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) Send("{Enter 2}") EndIf $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $green) ;searches for green color If Not @error Then $TotalGreen += 1 UpdateStatus() MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) Send("{del}") Sleep(1000) Send("^HOME") EndIf Send("{DOWN down}") Sleep(2000) Send("{DOWN up}") EndIf Wend Func UpdateStatus() ToolTip("Red "&$TotalRed&" : "&$TotalBlue&" Blue, "&$TotalGreen" Greens, ", 380, 37) EndFunc Func StartPause() $start = Not $start While Not $start Sleep(100) ToolTip("Scan Paused",887, 60) WEnd UpdateStatus() EndFunc Func Stop() Exit 0 EndFunc Edited June 10, 2012 by blu3dragon619 Link to comment Share on other sites More sharing options...
blu3dragon619 Posted June 11, 2012 Author Share Posted June 11, 2012 can anyone help me here??? so quite Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2012 Moderators Share Posted June 11, 2012 blu3dragon619,Welcome to the AutoIt forum. But please do NOT bump your posts within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. As to your problem, it would be a good idea to post an example of the sort of Word document you are working with as it is difficult to code anything without a good idea of what it is we are trying to do. Help us to help you. 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...
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