Countdown to specific Date and Time

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Jimlaro30
Posts: 1
Joined: Tue Feb 13, 2018 8:57 pm

Countdown to specific Date and Time

Post by Jimlaro30 » Tue Feb 13, 2018 9:08 pm

Hello. I 've been searching the internet but i couldn't find an answer to this. Is it possible to create a countdown to a specific date and time inside imacros? I know that this can be done by scheduling in windows to run the .bat file but this is not helpfull because it first launches firefox and then runs the macro and this can take a few seconds. I want this to be integrated inside the imacro and running all the way until the specific date and time and then continue executing the remaining script. Thank you in advance!
chivracq
Posts: 8198
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Countdown to specific Date and Time

Post by chivracq » Tue Feb 13, 2018 10:26 pm

Jimlaro30 wrote:Hello. I 've been searching the internet but i couldn't find an answer to this. Is it possible to create a countdown to a specific date and time inside imacros? I know that this can be done by scheduling in windows to run the .bat file but this is not helpfull because it first launches firefox and then runs the macro and this can take a few seconds. I want this to be integrated inside the imacro and running all the way until the specific date and time and then continue executing the remaining script. Thank you in advance!
FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for FF v...?, FF v...?, OS=Win v...?

Hum..., "... searching the internet...", => searching the Forum might prove to be more efficient...! :idea:

But to answer your Qt, => yep possible, and there are several ways... and several related Threads already on the Forum :D
And this can easily be done in pure '.iim', so there is nothing really specific to "iMacros for FF" I would think, unless you are using a '.js' Script, which you then should have mentioned if that's the case... => Correct Sub-Forum would have been the 'General' one from the scarce Info you provide about what your Macro will be doing... (But no need to duplicate now...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
Posts: 8198
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Countdown to specific Date and Time

Post by chivracq » Wed Feb 14, 2018 8:47 pm

For those interested, parallel Thread on SOF...
Same "low" Quality Thread (no Research, FCI not mentioned, etc...), but Advanced User @Shugar has already posted one Solution... :wink:
@Shugar wrote:Just as an example, you can try something like this code:

Code: Select all

' ... '
SET specificTime "2018-02-14T12:00:00"
SET countdownTime EVAL("var ct = parseInt((new Date('{{specificTime}}') - new Date()) / 1000); Math.max(0, ct);")
WAIT SECONDS={{countdownTime}}
' Happy Valentine’s Day! '
Interesting/useful Example on how to use/manipulate a 'Date' Object in JS, but not the most "accurate" Solution for OP as it relies solely on the iMacros 'WAIT' Command which is not always very accurate, but it should do "the Job" for say, up to 1 hour in advance maybe... 8)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
thecoder2012
Posts: 248
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Countdown to specific Date and Time

Post by thecoder2012 » Fri Apr 13, 2018 7:06 am

chivracq wrote:..., but Advanced User @Shugar has already posted one Solution... :wink:
Shugar Wiki for iMacros required. :wink:
chivracq wrote:Hum..., "... searching the internet...", => searching the Forum might prove to be more efficient...! :idea:
Combined internet (google) with forum: https://www.google.de/search?q=Countdow ... macros.net :mrgreen:
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
Post Reply