dannymcf2 Posted May 13, 2015 Share Posted May 13, 2015 (edited) OKAY, i know this is extremely simple and everyone can do this......SO, i created a Funcand this func works when you hit the key "alt S" (AKA "!s")and now when that func is open, i want the func to open another func....HOW THE HECK DO I DO THAT?!So i want to the func to open another funcwhat line of code do i type.... ? Thank u Edited May 13, 2015 by Melba23 Removed the SHOUTING Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 13, 2015 Moderators Share Posted May 13, 2015 dannymcf2,Welcome to the AutoIt forum.But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions. I have moved it for you, but would ask you to be more careful in future.And please do not SHOUT - we can read normal-weight text and lower-case characters perfectly well.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...
dannymcf2 Posted May 13, 2015 Author Share Posted May 13, 2015 Okay, got it.Can you answer my question quick though please?Cheers. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 13, 2015 Moderators Share Posted May 13, 2015 dannymcf2,Of course:#include <MsgBoxConstants.au3> HotKeySet("!s", "_Func_1") HotKeySet("{ESC}", "_Exit") While 1 Sleep(10) WEnd Func _Func_1() MsgBox($MB_SYSTEMMODAL, "Hi", "Inside Func 1") _Func_2() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndFunc Func _Func_2() MsgBox($MB_SYSTEMMODAL, "Hi", "Inside Func 2") EndFunc Func _Exit() Exit EndFuncM23 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...
dannymcf2 Posted May 13, 2015 Author Share Posted May 13, 2015 (edited) Okay thanks, So basically it's simple, to call a func you simply just type the func name ? lol i didn't think it would be that simple. Edited May 13, 2015 by dannymcf2 Link to comment Share on other sites More sharing options...
dannymcf2 Posted May 13, 2015 Author Share Posted May 13, 2015 (edited) Does this make sense and do you think it will work? expandcollapse popupHotKeySet ("s", "Find") HotKeySet("{ESC}", "Terminate") Global $interval $interval = 3000 MsgBox (0, "Finder", "Bot started, PRESS S to Run and ESC to End.") Func Terminate() Exit 1 EndFunc Func Find() $pixel = PixelSearch(36, 65, 73, 77, 0x000000) If IsArray($pixel) = True Then MouseClick("left", $pixel[0], $pixel[1]) new() EndIf EndFunc Func New() $pixel = PixelSearch(36, 65, 73, 77, 0x000000) If IsArray($pixel) = True Then MouseClick("left", $pixel[0], $pixel[1]) EndIf EndFunc While 1 Sleep(100) WEnd Edited May 13, 2015 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
dannymcf2 Posted May 13, 2015 Author Share Posted May 13, 2015 (edited) What i want to do i this....Find specific color Then Click And then wait 3 seconds (interval) then find another color then click again.the way i though could do it is like this....Func Find() $pixel = PixelSearch(36, 65, 73, 77, 0x000000) If IsArray($pixel) = True Then MouseClick("left", $pixel[0], $pixel[1]) sleep($interval) new() EndIf EndFunc ---------------------------------------------- Func New() $pixel = PixelSearch(36, 65, 73, 77, 0x000000) If IsArray($pixel) = True Then MouseClick("left", $pixel[0], $pixel[1]) EndIf EndFuncBut it doesn't seem to work ? haven't a clue why Edited May 13, 2015 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 13, 2015 Moderators Share Posted May 13, 2015 dannymcf2,Firstly, when you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags.Secondly, Which app are you trying to automate? There are usually much more reliable methods that searching for colours and clicking.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...
dannymcf2 Posted May 13, 2015 Author Share Posted May 13, 2015 Okay, I have it working now, and im just testing with internet explorer (i want the script to do this) - click edit, find on this page...This is the working code....I know there are other ways to get the script to find the "edit" tab by using the Imageseach method right? But sadly i don't think my brain's processing power is enough to accomplish that im afraidd So that's why im using the pixelSearch method.HotKeySet ("s", "Find") HotKeySet("{ESC}", "Terminate") Global $interval $interval = 3000 MsgBox (0, "Finder", "Bot started, PRESS S TO run.") Func Terminate() Exit 1 EndFunc Func Find() $pixel = PixelSearch(36, 65, 73, 77, 0x000000) If IsArray($pixel) = True Then MouseClick("left", $pixel[0], $pixel[1]) sleep ($interval) new() EndIf EndFunc While 1 Sleep(100) WEnd Func New() $pixel = PixelSearch(69, 180, 179, 199, 0x000000) If IsArray($pixel) = True Then MouseClick("left", $pixel[0], $pixel[1]) EndIf EndFunc While 1 Sleep(100) WEnd 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