mikey88 Posted February 9, 2013 Posted February 9, 2013 can you insert some kind of prgressbar into this script, with that i mean some kind of timer that show's you when script is going to loop? ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused, $Runner HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") ;;;; Body of program would go here ;;;; While 1 Sleep(10) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(10) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() $Runner = Not $Runner While $Runner Sleep( 10 ) MouseMove( 1868, 923 , 1 ) Sleep( 100 ) MouseClick( "left" , 1868, 923, 1, 1 ) Sleep( 900 ) MouseMove( 1016, 707,1 ) Sleep( 100 ) MouseClick( "left" , 1016, 707, 1, 1 ) Sleep( 900 ) MouseMove( 1163, 707, 1 ) Sleep( 100 ) MouseClick( "left" , 1163, 707 , 1 , 1 ) Sleep( 900 ) MouseMove( 1868, 923, 1 ) Sleep( 100 ) MouseClick( "left" , 1868, 923 , 1, 1 ) Sleep( 900 ) MouseMove( 751, 501 , 1 ) Sleep( 100 ) MouseClick( "left" , 751, 501, 1, 1 ) Sleep( 900 ) MouseMove( 1185, 452 , 1 ) Sleep( 300 ) MouseClick( "left" , 1185, 452, 1, 1 ) Sleep( 900 ) MouseMove( 907, 47 , 1 ) Sleep( 300 ) MouseClick( "left" , 907, 47, 1, 1 ) Sleep( 900 ) MouseMove( 1868, 923 , 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923, 1, 1 ) Sleep( 900 ) MouseMove( 1016, 707,1 ) Sleep( 300 ) MouseClick( "left" , 1016, 707, 1, 1 ) Sleep( 900 ) MouseMove( 1163, 707, 1 ) Sleep( 300 ) MouseClick( "left" , 1163, 707 , 1 , 1 ) Sleep( 1000 ) MouseMove( 1868, 923, 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923 , 1, 1 ) Sleep( 900 ) MouseMove( 751, 501 , 1 ) Sleep( 300 ) MouseClick( "left" , 751, 501, 1, 1 ) Sleep( 900 ) MouseMove( 1185, 452 , 1 ) Sleep( 300 ) MouseClick( "left" , 1185, 452, 1, 1 ) Sleep( 900 ) MouseMove( 1117, 49 , 1 ) Sleep( 300 ) MouseClick( "left" , 1117, 49, 1, 1 ) Sleep( 900 ) MouseMove( 1868, 923 , 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923, 1, 1 ) Sleep( 900 ) MouseMove( 1016, 707,1 ) Sleep( 300 ) MouseClick( "left" , 1016, 707, 1, 1 ) Sleep( 900 ) MouseMove( 1163, 707, 1 ) Sleep( 300 ) MouseClick( "left" , 1163, 707 , 1 , 1 ) Sleep( 900 ) MouseMove( 1868, 923, 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923 , 1, 1 ) Sleep( 900 ) MouseMove( 751, 501 , 1 ) Sleep( 300 ) MouseClick( "left" , 751, 501, 1, 1 ) Sleep( 900 ) MouseMove( 1185, 452 , 1 ) Sleep( 300 ) MouseClick( "left" , 1185, 452, 1, 1 ) Sleep( 900 ) MouseMove( 690, 50 , 1 ) Sleep( 300 ) MouseClick( "left" , 690, 50, 1, 1 ) sleep (601000) WEnd EndFunc ;==>ShowMe
water Posted February 9, 2013 Posted February 9, 2013 Welcome to AutoIt and the forum!A few notes:Please wrap your code in [autoit][/autoit] tags for better readabilityWhat kind of application do you want to automate with so many MouseMove/MouseClick calls? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
mikey88 Posted February 9, 2013 Author Posted February 9, 2013 expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused, $Runner HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") ;;;; Body of program would go here ;;;; While 1 Sleep(10) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(10) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() $Runner = Not $Runner While $Runner Sleep( 10 ) MouseMove( 1868, 923 , 1 ) Sleep( 100 ) MouseClick( "left" , 1868, 923, 1, 1 ) Sleep( 900 ) MouseMove( 1016, 707,1 ) Sleep( 100 ) MouseClick( "left" , 1016, 707, 1, 1 ) Sleep( 900 ) MouseMove( 1163, 707, 1 ) Sleep( 100 ) MouseClick( "left" , 1163, 707 , 1 , 1 ) Sleep( 900 ) MouseMove( 1868, 923, 1 ) Sleep( 100 ) MouseClick( "left" , 1868, 923 , 1, 1 ) Sleep( 900 ) MouseMove( 751, 501 , 1 ) Sleep( 100 ) MouseClick( "left" , 751, 501, 1, 1 ) Sleep( 900 ) MouseMove( 1185, 452 , 1 ) Sleep( 300 ) MouseClick( "left" , 1185, 452, 1, 1 ) Sleep( 900 ) MouseMove( 907, 47 , 1 ) Sleep( 300 ) MouseClick( "left" , 907, 47, 1, 1 ) Sleep( 900 ) MouseMove( 1868, 923 , 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923, 1, 1 ) Sleep( 900 ) MouseMove( 1016, 707,1 ) Sleep( 300 ) MouseClick( "left" , 1016, 707, 1, 1 ) Sleep( 900 ) MouseMove( 1163, 707, 1 ) Sleep( 300 ) MouseClick( "left" , 1163, 707 , 1 , 1 ) Sleep( 1000 ) MouseMove( 1868, 923, 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923 , 1, 1 ) Sleep( 900 ) MouseMove( 751, 501 , 1 ) Sleep( 300 ) MouseClick( "left" , 751, 501, 1, 1 ) Sleep( 900 ) MouseMove( 1185, 452 , 1 ) Sleep( 300 ) MouseClick( "left" , 1185, 452, 1, 1 ) Sleep( 900 ) MouseMove( 1117, 49 , 1 ) Sleep( 300 ) MouseClick( "left" , 1117, 49, 1, 1 ) Sleep( 900 ) MouseMove( 1868, 923 , 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923, 1, 1 ) Sleep( 900 ) MouseMove( 1016, 707,1 ) Sleep( 300 ) MouseClick( "left" , 1016, 707, 1, 1 ) Sleep( 900 ) MouseMove( 1163, 707, 1 ) Sleep( 300 ) MouseClick( "left" , 1163, 707 , 1 , 1 ) Sleep( 900 ) MouseMove( 1868, 923, 1 ) Sleep( 300 ) MouseClick( "left" , 1868, 923 , 1, 1 ) Sleep( 900 ) MouseMove( 751, 501 , 1 ) Sleep( 300 ) MouseClick( "left" , 751, 501, 1, 1 ) Sleep( 900 ) MouseMove( 1185, 452 , 1 ) Sleep( 300 ) MouseClick( "left" , 1185, 452, 1, 1 ) Sleep( 900 ) MouseMove( 690, 50 , 1 ) Sleep( 300 ) MouseClick( "left" , 690, 50, 1, 1 ) sleep (601000) WEnd EndFunc ;==>ShowMe
water Posted February 9, 2013 Posted February 9, 2013 Which program to you try to automate? MouseMove/MouseClick isn't very reliable because it depends on the screen resolution and window position. Control* functions, the IE UDF etc. provide better solutions. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
mikey88 Posted February 9, 2013 Author Posted February 9, 2013 it's to automate something on the internet (gamelike) the windowposition is always the same, so i'm not bothered with that^^ i'm kinda a newbie to this so every input is welcome :-) so if ur up to it, would you like to explain it to me like i'm a 6yrs old
water Posted February 9, 2013 Posted February 9, 2013 You should read the forum rules. Link is in the lower right corner of this page. Game automation of any kind isn't allowed here. What do you mean by "gamelike"? Can you post the URL? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
mikey88 Posted February 9, 2013 Author Posted February 9, 2013 it's for a gameserver i set up... the site is for admins only since i'm the night-admin i wanna smuggle the last two hours of my shift :$ (and if it works all admins would work with it) so it's not actually to automate ingame stuff it's actually to dowload some online logfiles (since i'm a newbie to this i made the script mouseclick-based, works fine tho) the logfiles update every ten minutes and we need all logfiles to see where possible errors are since the server is accesable through "remote desktop" i want a timer in this script so that the other admins don't interubt the script this way we got more time to do other things (I know, it's an annyoing way to control our server, that's why i want this script to work^^) (my english is a bit bad, so can't explain it in a good way, sorry bout that)
Moderators Melba23 Posted February 9, 2013 Moderators Posted February 9, 2013 mikey88,Please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing interaction with game servers - before you post again. Thread locked. 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
Recommended Posts