robbryjo Posted February 24, 2015 Share Posted February 24, 2015 (edited) Hello Community, i have some script here and want to see the total runtime (or the total runtime - all sleeptimers) as a message box at the end of the script. Can you please help me? ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:212]", "test BMS 3.0") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "B*****") Sleep(500) ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "right") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{down}") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{Enter}") Sleep(2500) ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "left") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}") Sleep(1500) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "Acer_NB") Sleep(500) ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "right") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{down}") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{Enter}") Sleep(1500) ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:165]", "left") Sleep(100) ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:156]", "test BMS 3.0") Sleep(100) ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:169]", "left") MsgBox(CAN I PUT IT HERE?) Edited February 24, 2015 by robbryjo Link to comment Share on other sites More sharing options...
JohnOne Posted February 24, 2015 Share Posted February 24, 2015 TimerInit() TimerDiff() <- Help File AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheDcoder Posted February 24, 2015 Share Posted February 24, 2015 Global $Runtime = TimerInit() ; This is the first line of your script ; ; YOUR CODE HERE ; MsgBox(0, "Runtime", TimerDiff($Runtime)) EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
TheDcoder Posted February 24, 2015 Share Posted February 24, 2015 (edited) Global $Runtime = TimerInit() ; This is the first line of your script ; ; YOUR CODE HERE ; $Runtime / 1000 = $RuntimeInSeconds MsgBox(0, "Runtime", "Total Runtime: " & $RuntimeInSeconds & " Seconds.") More friendly version.... Edited February 24, 2015 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
iamtheky Posted February 24, 2015 Share Posted February 24, 2015 ohhh, those interpretations of the OP make much more sense. Here is my solution to all sleeptimers) as a message box at the end of the script expandcollapse popupGlobal $tooltime ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:212]", "test BMS 3.0") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "B*****") _Sleep(500) ;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "right") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{down}") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{Enter}") _Sleep(2500) ;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "left") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}") _Sleep(1500) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "Acer_NB") _Sleep(500) ;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "right") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{down}") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{Enter}") _Sleep(1500) ;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:165]", "left") _Sleep(100) ;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:156]", "test BMS 3.0") _Sleep(100) ;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:169]", "left") msgbox(0, '' , $tooltime) Func _Sleep ($time) $tooltime += $time sleep($time) EndFunc ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
robbryjo Posted February 24, 2015 Author Share Posted February 24, 2015 I Got another Question. When i click this button .. ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:169]", "left") --> This is in ADD button the tool creates a ticket and fills a ticket number in the field (Case ID). this takes about 6 seconds What i want now is the exact time for ticket creation (about 14 seconds - the runtime till ADD button.) What have i to fill in ?? The field Name of the Case ID button is [CLASS:TWINDOW1; INSTANCE:25] Link to comment Share on other sites More sharing options...
TheDcoder Posted February 25, 2015 Share Posted February 25, 2015 Please open a new thread EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion 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