Tripoz Posted May 29, 2015 Share Posted May 29, 2015 Hello all,I have a project in autoi script but im too nubie here...I need some help.. I had a project with time,..In simple language i just want to make function like:1. If my condition is "True", For the 1st 5minute in my computer clock, i will click in coord X, Y2. If my condition " true" again in the same 5minute it willn't doing nothing.In other words, i just want to make code that will doing something each 5mins. Even they meet alot "true condition" they just will running once in a 5min Can anybody help me what funct that i must use???thx Link to comment Share on other sites More sharing options...
Developers Jos Posted May 29, 2015 Developers Share Posted May 29, 2015 What are you trying to automate?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
water Posted May 29, 2015 Share Posted May 29, 2015 (edited) Welcome to AutoIt and the forum!Can you please tell us which program you try to automate? Clicking on coordinates is not very reliable because it depends on screen resolution, window position etc.Most of the time there are better solutions to achieve what you try to do. Edited May 29, 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...
Tripoz Posted May 29, 2015 Author Share Posted May 29, 2015 (edited) @jos. Some condition in excel...If the formula is =True, they will paste that formula to specific cell each 5minutes (only once in 5mins)For excel i just will used the udf..but im confuse for the looping I just need one true condition every 5mins, the other they will pass it Edited May 29, 2015 by Tripoz Link to comment Share on other sites More sharing options...
water Posted May 29, 2015 Share Posted May 29, 2015 During this 5 minutes, does your script need to do something else? Or can it just sit there and wait for 5 minutes? 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...
Tripoz Posted May 29, 2015 Author Share Posted May 29, 2015 (edited) @water just waiting the true condition..but there maybe often show up the"true" condition...but i just need 1st true condition each 5mins Edited May 29, 2015 by Tripoz Link to comment Share on other sites More sharing options...
water Posted May 29, 2015 Share Posted May 29, 2015 (edited) Something like this:While True ; Check condition here If condition = True Then ; Do whatever you need to do when the condition is true EndIf Sleep(5 * 60 * 1000) ; Wait 5 minutes WEnd Edited May 29, 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...
Tripoz Posted May 29, 2015 Author Share Posted May 29, 2015 Condition in 5 mins : a(true), b(false), c(true), d(true)In every 5mins i just want to running my code if they meet 1st true condition.in that example is A..n willnot excute when they meet other True condition ( C) Link to comment Share on other sites More sharing options...
Tripoz Posted May 29, 2015 Author Share Posted May 29, 2015 Something like this:While True ; Check condition here If condition = True Then ; Do whatever you need to do when the condition is true EndIf Sleep(5 * 60 * 1000) ; Wait 5 minutes WEndHmmm...if the 1st condition found in minute 3, so the code will run again in minute 8 right (sleep 5min)But in excel my condition will looping every 5minutes.. If the true condition is found in minute 6 so they will pass it too right..Sorry bad english so i cant explain it in well.. Link to comment Share on other sites More sharing options...
Tripoz Posted May 29, 2015 Author Share Posted May 29, 2015 Minute. : [1.....2....3....4.....5]. [6....7....8....9....10]. [11....12....13....14....15]Condition true: [A.....b.....c....d.....e]. [b....c....A....d.....A]. [d......e........b.....A.......e]They will run the code if meet "A" in minutes 1, 8 n 14....but will pass condition "A" in minute 10 cause in 5min they was found "A" in min 8... Link to comment Share on other sites More sharing options...
water Posted May 29, 2015 Share Posted May 29, 2015 Minute. : [1.....2....3....4.....5]. [6....7....8....9....10]. [11....12....13....14....15]Condition true: [A.....b.....c....d.....e]. [b....c....A....d.....A]. [A......e........b.....A.......e]To get a better understanding of what you need.It processes A in minute 1 and 8, ignores A in minute 10 but would the script process condition A in minute 11? 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...
Tripoz Posted May 29, 2015 Author Share Posted May 29, 2015 if the condition like urs, they will just process A in minute 1,8 & 11 only. N will ignore A in minute 10 n 14 Link to comment Share on other sites More sharing options...
water Posted May 29, 2015 Share Posted May 29, 2015 Something like this? It writes the values of the "mintues" to the console when A is true and will be processed. I've added comments so you see what is going on. Global $iTimer = 1, $iCountA = 0 Global $sValueA = ";1;8;10;11;14;" ; <== Just needed for the test script. Remove it in your productions cript While True If Mod($iTimer, 5) = 1 Then ; New block of 5 minutes has started. $iCountA = 0 ; Reset counter EndIf If StringInStr($sValueA, ";" & $iTimer & ";") Then ; <== Checking condition. Needs to be replaced with the real thing If $iCountA = 0 Then ConsoleWrite($iTimer & @CRLF) ; <== Needs to be changed to the reald processing (cell copying) $iCountA = $iCountA + 1 EndIf EndIf $iTimer = $iTimer + 1 Sleep(10) ; <== To wait for a minute change the value to 1000 If $iTimer > 15 Then Exit ; <== Condition to end the script. Needs to be changed to your ending condition WEnd 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...
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