Execute one line of a script at an exact time


#1

Hi, I am trying to automate booking on a web site, the script runs fine, but takes a variable 10-15 seconds to run (from a PC).
How can I just execute the last “confirm” comand at an exact time, in milliseconds, ideally using internet time.

I thought of spliting the script, executing the “confirm” from a new pc scheduled task, unsure how to pick up from the initial macro as "confirm " is in a frame.

Or look at a Clock web site - then execute when the time (or image) matches.

I guess this is a common request, but I can’t find any examples.

Thanks,


#2

General idea:
If getTime(); > X then click.


#3
{
  "Command": "label",
  "Target": "checktime",
  "Value": ""
},
{
  "Command": "executeScript_Sandbox",
  "Target": "var d = new Date(); return d.getTime();",
  "Value": "x"
},
{
  "Command": "gotoIf_v2",
  "Target": "${x} < 1560180196279",
  "Value": "checktime"
},
{
  "Command": "click",
  "Target": "whatev",
  "Value": ""
}

#4

If you know the time in ms you need to click at (${time}) you can also use:

{
      "Command": "executeScript_Sandbox",
      "Target": "return 1560180196279",
      "Value": "time"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "var d = new Date(); return ${time}-d.getTime();",
      "Value": "x"
    },
    {
      "Command": "pause",
      "Target": "${x}",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "whatev",
      "Value": ""
    }

But of course there is a delay for the command execution so this is not exact in ms.