christian11 Posted September 22, 2015 Share Posted September 22, 2015 (edited) expandcollapse popupi want autoit to send the key to my browser refresh button F5 every 3 minutes, but i dont want it to interfere with the script.. something like a timer.. click F5 every 3 minutes without interfering with the original script in the loop? HotKeySet ("{HOME}", "Start") While 1 Sleep(200) WEnd Func Start() While 1 Send("{F3}") sleep (180000) ;---- press f3 every 3mins timer without interfering other ;and prioritizing it at the same time?? Else $pink = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8a0859) If isArray($pink) then MouseMove($pink[0],$pink[1], 0) sleep(100) MouseClick("Left") Else $pink2 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8c085a) If isArray($pink2) then MouseMove($pink2[0],$pink2[1], 0) sleep(100) MouseClick("Left") Else $pink3 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x880852) If isArray($pink3) then MouseMove($pink3[0],$pink3[1], 0) sleep(100) MouseClick("Left") Endif Endif Endif WEnd EndFunc Edited September 22, 2015 by christian11 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 christian11,Look at AdlibRegister in the Help file.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...
christian11 Posted September 22, 2015 Author Share Posted September 22, 2015 thanks for fast replyis it okay?expandcollapse popupHotKeySet ("{HOME}", "Start") AdlibRegister("refresh",180000);3minutes? While 1 Sleep(200) WEnd Func Start() While 1 "refresh" ;--- how can i add the adlibregister"refresh" here?? is it correct? Else $pink = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8a0859) If isArray($pink) then MouseMove($pink[0],$pink[1], 0) sleep(100) MouseClick("Left") Else $pink2 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8c085a) If isArray($pink2) then MouseMove($pink2[0],$pink2[1], 0) sleep(100) MouseClick("Left") Else $pink3 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x880852) If isArray($pink3) then MouseMove($pink3[0],$pink3[1], 0) sleep(100) MouseClick("Left") Endif Endif Endif WEnd EndFunc Link to comment Share on other sites More sharing options...
water Posted September 22, 2015 Share Posted September 22, 2015 (edited) I must admit I'm a but curious. Which application are you trying to automate?As it seems to be a browser app, wouldn't it be more reliable to use the IE UDF (I assume you are running Internet Explorer) that comes with AutoIt? Edited September 22, 2015 by water 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...
water Posted September 22, 2015 Share Posted September 22, 2015 christian11,you really need to read the help file. What you are asking for can be found there 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...
christian11 Posted September 22, 2015 Author Share Posted September 22, 2015 (edited) like what i said in my previous thread im trying to automate google chrome browser from a webpage.. a spammer thing lolim really new to this..the helpfile didnt seem give me more info for my problem.. i would really appreciate can someone give me example for this thank you! Edited September 22, 2015 by christian11 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 christian11,a spammer thing lolWould you care to expand on that a bit? Just what/who are you spamming?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...
christian11 Posted September 22, 2015 Author Share Posted September 22, 2015 what? r u guys are from cyber police or something? kidding. i am not doing illegal cybercrime lol i just want to open webpages from emails sended from my boss from client.. and spam click the pink pixel on it and resend it like a automate email so how about this? i hope this will workexpandcollapse popupHotKeySet ("{HOME}", "Start") AdlibRegister("refresh",180000);3minutes? While 1 Sleep(200) WEnd Func refresh() Send("{F5}") EndFunc Func Start() While 1 call "refresh" Else $pink = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8a0859) If isArray($pink) then MouseMove($pink[0],$pink[1], 0) sleep(100) MouseClick("Left") Else $pink2 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8c085a) If isArray($pink2) then MouseMove($pink2[0],$pink2[1], 0) sleep(100) MouseClick("Left") Else $pink3 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x880852) If isArray($pink3) then MouseMove($pink3[0],$pink3[1], 0) sleep(100) MouseClick("Left") Endif Endif Endif WEnd EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 christian11,r u guys are from cyber police or something?No, just trying to protect AutoIt's reputation.What email client do you use? Perhaps there is a better way to automate it than PixelSearch.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...
christian11 Posted September 22, 2015 Author Share Posted September 22, 2015 (edited) ahh oh i see. i understand. im not using email apps just simple google chrome yahoomail @_@ i customized my email into pink theme so pixelsearch can see through it..so whats up my script is bad or okay? Edited September 22, 2015 by christian11 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 christian11,my script is bad or okay? Did you check it before posting? I think not because it is full of syntax errors. Perhaps this might do what you want (I have not tested because I do not have the "pink" page to test):expandcollapse popupHotKeySet("{HOME}", "_Start") HotKeySet("{END}", "_Stop") ; Create Run flag Global $bRun = False ; Run your refresh function automatically AdlibRegister("refresh", 180000) ; 3 minutes While 1 Sleep(200) ; Check if we should run the main function If $bRun Then ; Just run it the once on each pass - that way we can check if we stil need to do so _Main() EndIf WEnd ; This will run independently as you require Func refresh() Send("{F5}") EndFunc ;==>refresh ; These 2 functions set/clear the Run flag Func _Start() $bRun = True EndFunc ;==>_Start Func _Stop() $bRun = False EndFunc ;==>_Stop ; This function does all the work Func _Main() $pink = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8a0859) If IsArray($pink) Then MouseMove($pink[0], $pink[1], 0) Sleep(100) MouseClick("Left") Return Else $pink2 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8c085a) If IsArray($pink2) Then MouseMove($pink2[0], $pink2[1], 0) Sleep(100) MouseClick("Left") Return Else $pink3 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x880852) If IsArray($pink3) Then MouseMove($pink3[0], $pink3[1], 0) Sleep(100) MouseClick("Left") Return EndIf EndIf EndIf EndFunc ;==>_MainM23 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...
christian11 Posted October 8, 2015 Author Share Posted October 8, 2015 (edited) christian11,Did you check it before posting? I think not because it is full of syntax errors. Perhaps this might do what you want (I have not tested because I do not have the "pink" page to test):expandcollapse popupHotKeySet("{HOME}", "_Start") HotKeySet("{END}", "_Stop") ; Create Run flag Global $bRun = False ; Run your refresh function automatically AdlibRegister("refresh", 180000) ; 3 minutes While 1 Sleep(200) ; Check if we should run the main function If $bRun Then ; Just run it the once on each pass - that way we can check if we stil need to do so _Main() EndIf WEnd ; This will run independently as you require Func refresh() Send("{F5}") EndFunc ;==>refresh ; These 2 functions set/clear the Run flag Func _Start() $bRun = True EndFunc ;==>_Start Func _Stop() $bRun = False EndFunc ;==>_Stop ; This function does all the work Func _Main() $pink = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8a0859) If IsArray($pink) Then MouseMove($pink[0], $pink[1], 0) Sleep(100) MouseClick("Left") Return Else $pink2 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x8c085a) If IsArray($pink2) Then MouseMove($pink2[0], $pink2[1], 0) Sleep(100) MouseClick("Left") Return Else $pink3 = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x880852) If IsArray($pink3) Then MouseMove($pink3[0], $pink3[1], 0) Sleep(100) MouseClick("Left") Return EndIf EndIf EndIf EndFunc ;==>_MainM23omg thank you so much it works..i actually lost my hope.. until i recently saw your reply :)) although i have wait for 3mins after i pressed the start button. but its okay its perfectly working as intended.one more question... how can i add another adlibregister? with another different function let say every 2mins it will mouseclick in coordinates 592,173 ; Create Run flag Global $bRun = False ; Run your refresh function automatically AdlibRegister("refresh", 180000) ; 3 minutes AdlibRegister("click2mins", 120000) ; 2 minutes While 1 Sleep(200) ; Check if we should run the main function If $bRun Then ; Just run it the once on each pass - that way we can check if we stil need to do so _Main() EndIf WEnd ; This will run independently as you require Func refresh() Send("{F5}") EndFunc ;==>refresh Func click2mins() MouseClick("left",592,173) EndFunc ;==>click2mins ; These 2 functions set/clear the Run flag Func _Start() $bRun = True EndFunc ;==>_Start Func _Stop() $bRun = False EndFunc ;==>_Stop Edited October 8, 2015 by christian11 Link to comment Share on other sites More sharing options...
computergroove Posted October 8, 2015 Share Posted October 8, 2015 Have you tested it? It looks good to me. Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
christian11 Posted October 8, 2015 Author Share Posted October 8, 2015 Have you tested it? It looks good to me.only function refresh works.. but click2mins not working any idea why?; Create Run flag Global $bRun = False ; Run your refresh function automatically AdlibRegister("refresh", 180000) ; 3 minutes AdlibRegister("click2mins", 120000) ; 2 minutes While 1 Sleep(200) ; Check if we should run the main function If $bRun Then ; Just run it the once on each pass - that way we can check if we stil need to do so _Main() EndIf WEnd ; This will run independently as you require Func refresh() Send("{F5}") EndFunc ;==>refresh Func click2mins() MouseClick("left",592,173) EndFunc ;==>click2mins ; These 2 functions set/clear the Run flag Func _Start() $bRun = True EndFunc ;==>_Start Func _Stop() $bRun = False EndFunc ;==>_Stop 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