TheDcoder 1,812 Posted December 26, 2022 Share Posted December 26, 2022 Scheduler UDF A time-based task scheduler to run arbitrary tasks at set times in a day. Features Milli-second precision with reasonable accuracy Repeating tasks Run tasks even if scheduled time has elapsed (optional) Interruptible Project Home GitHub: https://github.com/TheDcoder/Scheduler.au3 --- Hello everyone, it's been a long time since I've made a new UDF I originally wanted to release this yesterday as my Christmas present to the AutoIt community but I couldn't find the time, so I'm releasing it today as a belated present Work on this was started many months ago but I got caught up with many things and couldn't find the time to clean this up and document everything. I made this UDF because I found myself implementing this in one way or the other in many projects, so I made it into a neat little package to release it to the general public, no need to reinvent the wheel and waste time on this. This implementation is very simple in my opinion and as a bonus I made it interruptible so that the user can exit out of the infinite event-loop. Enjoy and belated Merry Xmas! - TheDcoder Musashi, SOLVE-SMART, TheSaint and 1 other 4 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 post Share on other sites
TheSaint 4,062 Posted December 27, 2022 Share Posted December 27, 2022 Good work bud. I am guessing this is better than Windows Task Scheduler? TheDcoder 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to post Share on other sites
TheDcoder 1,812 Posted December 28, 2022 Author Share Posted December 28, 2022 15 hours ago, TheSaint said: Good work bud. Thanks 15 hours ago, TheSaint said: I am guessing this is better than Windows Task Scheduler? Yes, definitely. Windows Task Scheduler just runs your program, it's not integrated into your program itself unlike my UDF, which gives you full control over the schedule, not to mention that your program can still display a GUI and do stuff periodically with AdlibRegister while the main event loop is sleeping. None of that is possible with Windows Task Scheduler. The most important thing though, is the simplicity and independence, no need to bother messing with an external program and risk potential complications. Also it's just not a good look if you are developing a end-user GUI program and it doesn't have it's own schedule thing, instead you have to rely on the user or potentially other programs to not screw up whatever Task Scheduler settings need to be changed. TheSaint 1 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 post Share on other sites
TheSaint 4,062 Posted December 28, 2022 Share Posted December 28, 2022 Sounds very promising .... now I just need a need for it. ย Most of my life follows an internal subconscious schedule. TheDcoder 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to post Share on other sites
TheDcoder 1,812 Posted January 4 Author Share Posted January 4 Hello again, I just fixed some wicked nasty bugs in the UDF which practically makes the original version unusable. I also added some quality of life improvements in the meanwhile My most embarrassing bug is the nasty one, where I wrote incorrect documentation for the schedule format because I wrote from my memory. Turns out my 6-month old implementation was significantly different, who knew So I rewrote the algorithm to fit the documentation --- If anyone has free time and would like to lend me a hand, please write an example script for the UDF. At this point the DIY testing script is broken due to all the changes, and I don't want to update it. So I'll probably remove it soon, so an example script could be of great help. You will get due credit of course. If you are interested just fork my repo and send me a PR, or get in touch here with the script and I'll take a look. --- Hopefully there aren't any more bugs in there... 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 post Share on other sites
SOLVE-SMART 110 Posted January 4 Share Posted January 4 (edited) Hi @TheDcoder, my first quick review is in progress ๐ง . What do you mean by: 44 minutes ago, TheDcoder said: [...] the DIY testing script is broken due to all the changes, and I don't want to update it. So I'll probably remove it soon [...] Youย are talking aboutย Testing.au3, am I right? 44 minutes ago, TheDcoder said: [...] please write an example script for the UDF [...] if you are interested just fork my repo and send me a PR, or get in touch here with the script and I'll take a lookย [...] Could be possible that I can spent I bit of time to do this ๐ . But please don'tย necessarily expect it, I can not promise, but I will do my best . Some questions: Do you prefer the creation of a GitHub issue (where I describe what I want to do) before I come up with a PR? Who is your target/focus group? You talk about an example for the UDF, what about extending the README (by some instructions) for a wider user field? Necessary or more nice to have? Best regardsSven________________Stay innovative! Edited January 4 by SOLVE-SMART TheDcoder 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ย Forum search ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ย ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to post Share on other sites
SOLVE-SMART 110 Posted January 4 Share Posted January 4 (edited) To be honestย @TheDcoder, after forking your repositoryย and reviewing your UDF a while and thinking about how the examples could look like, I struggle to find useful use cases (especiallyย for a need of such accuracy) ๐ค . I would really like to contribute, but I miss a practiacl need (for now). Let me rethink it a bit later. In a business view of point, I used such cronjob based scheduler before, maybe this could be a entry point for examples. Let's see,ย I will get back. Best regardsSven________________Stay innovative! Edited January 4 by SOLVE-SMART Stay innovative! Spoiler ๐ย Au3Forums ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ย Forum search ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ย ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to post Share on other sites
TheDcoder 1,812 Posted January 4 Author Share Posted January 4 Hi @SOLVE-SMART, 2 hours ago, SOLVE-SMART said: Youย are talking aboutย Testing.au3, am I right? Yup, that's the quick and dirty script I wrote to test changes on the fly 2 hours ago, SOLVE-SMART said: Do you prefer the creation of a GitHub issue (where I describe what I want to do) before I come up with a PR? Sure, it's your choice, we can also discuss here. 2 hours ago, SOLVE-SMART said: Who is your target/focus group? No one in particular, I just put it out for people who need to perform tasks according to a schedule everyday. Personally I'm using this in one of my work projects, I already created several variants of things like this for automation related work projects, so I made this comprehensive solution to cover all my bases in the future and avoid reinventing the wheel everytime 2 hours ago, SOLVE-SMART said: You talk about an example for the UDF, what about extending the README (by some instructions) for a wider user field? I think the README is adequate, but I'm always open for suggestions. 30 minutes ago, SOLVE-SMART said: To be honestย @TheDcoder, after forking your repositoryย and reviewing your UDF a while and thinking about how the examples could look like, I struggle to find useful use cases (especiallyย for a need of such accuracy) ๐ค . I would really like to contribute, but I miss a practiacl need (for now). Let me rethink it a bit later. No worries, the aspect about accuracy is just a nice to have feature, that wasn't one of my primary goals. It's fine if you don't have an use for this at the moment 32 minutes ago, SOLVE-SMART said: In a business view of point, I used such cronjob based scheduler before, maybe this could be a entry point for examples. Let's see,ย I will get back. cron is indeed similar to Windows Task Scheduler, but it also shares all of the drawbacks that I mentioned. Don't push yourself to find some use case, at the end of the day it's just a hobby project Having an example script is just another "nice to have" thing, it's not critical and I'm sure the person who wants to use this in a project can figure it out quite easily with the documentation... and maybe with a little bit of help from here SOLVE-SMART 1 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 post Share on other sites
SOLVE-SMART 110 Posted January 4 Share Posted January 4 Hi @TheDcoder, all good and understandable, thanks. In case I find useful and meaningful examples and will create a pull request in which I explain whats going on etc. So I would skip the usage of GitHub issue beforehand ๐ . I agree and like your mentioned advantages of this Scheduler.au3 UDF over "Windows Task Scheduler" or Cron(jobs) and their drawbacks ๐ . Iย will not push myself, don't worry, but I guess I want to contribute ๐ . Best regardsSven________________Stay innovative! TheDcoder 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ย Forum search ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ย ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to post Share on other sites
TheSaint 4,062 Posted January 4 Share Posted January 4 7 hours ago, TheDcoder said: So I rewrote the algorithm to fit the documentation Really?ย I don't think you should have done that bud, and it brings to mind the Chicken or the Egg question.ย Spoiler Just kidding. Naturally you did what you thought was best. Lot of work though, and probably less thinking to have just rewritten the documentation instead. ย Not to mention you screwed your example. ย ย TheDcoder 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to post Share on other sites
SOLVE-SMART 110 Posted January 4 Share Posted January 4 Hi @TheDcoder, I am still working on the examples, but I do have a intermediate state which could be merged I think. The current state isn't working either, like you mentioned in a post above before. So I would like to come up with 1, 2 and 3 PRs as shown in the screenshot ๐ค . Would you like to have a CHANGELOG.md file?ย I could create one with the keepachangelog.comย style and SemVer, if you want to? This would only make sense in my opinion, if you plan to extend the UDF more and more in the future? Best regardsSven________________Stay innovative! ย TheDcoder 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ย Forum search ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ย ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to post Share on other sites
TheDcoder 1,812 Posted January 5 Author Share Posted January 5 Hi @SOLVE-SMART, Thanks for the PRs, I replied to all of them. 9 hours ago, SOLVE-SMART said: Would you like to have a CHANGELOG.md file?ย I could create one with the keepachangelog.comย style and SemVer, if you want to? At this point, no. It would just increase the friction between changes. I don't intend to push a lot of updates, and I don't think the users of the UDF (i.e. other developers) would need such neat versioning and change-logs anyway, they can just diff the changes to see what changed, at-least that's what I do 9 hours ago, SOLVE-SMART said: This would only make sense in my opinion, if you plan to extend the UDF more and more in the future? I don't have any major plans for this UDF, there might be some small updates here and there but that's it. SOLVE-SMART 1 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 post Share on other sites
SOLVE-SMART 110 Posted January 5 Share Posted January 5 (edited) Hi @TheDcoder, great, understood ๐ค , further discussions and changes based on your replies can be made at GitHub. So see you there. Best regardsSven________________Stay innovative! ย Edited January 5 by SOLVE-SMART Stay innovative! Spoiler ๐ย Au3Forums ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ย Forum search ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ย ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to post Share on other sites
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