Jump to content

Scheduler UDF - Run tasks according to a schedule in a day


Recommended Posts

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 :D

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

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

Good work bud.

I am guessing this is better than Windows Task Scheduler?

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)

userbar.png

Link to post
Share on other sites
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.

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

Sounds very promising .... now I just need a need for it. :lol: 

Most of my life follows an internal subconscious schedule. :muttley:

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)

userbar.png

Link to post
Share on other sites

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 :wacko:

So I rewrote the algorithm to fit the documentation :lol:

---

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

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:

  1. Do you prefer the creation of a GitHub issue (where I describe what I want to do) before I come up with a PR?
  2. 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 regards
Sven

________________
Stay innovative!

Edited 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

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 regards
Sven

________________
Stay innovative!

Edited 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

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 :lol:

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 :lol:

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

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 regards
Sven

________________
Stay innovative!

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
7 hours ago, TheDcoder said:

So I rewrote the algorithm to fit the documentation

Really? :wacko:

I don't think you should have done that bud, and it brings to mind the Chicken or the Egg question. :blink:

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. :lol: 

 

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)

userbar.png

Link to post
Share on other sites

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 🤝 .

image.thumb.png.58a1fe49c3321f34197fa593ec7812dd.png

  • 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 regards
Sven

________________
Stay innovative!

 

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

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 :lol:

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.

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

Hi @TheDcoder,

great, understood 🤝 , further discussions and changes based on your replies can be made at GitHub. So see you there.

Best regards
Sven

________________
Stay innovative!

 

Edited 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...