James,
I got to it sooner than I thought.
I made the asyncExec as a function

and one day/time case for my open as a function

or alternately as

and fired the two functions in the main body of my task

It played the open I wanted because the day is neither Sunday nor Saturday, and the time was between 8pm & 9pm, but I didn't get to see about it clearing the Xpression layers I need to clear because the pauses don't happen.
Does anything jump out at you?
I realize in my experimenting, I didn't try putting the asyncExec function into my open function---would that have been closer?
Thanks,
James.
This is the ogScript:
function MyExec() {
/*! block id=1444 !*/
ogscript.asyncExec(MyExec);
/*!!
<block id="1444" type="customcode" x="8" y="18" w="343" CODE="ogscript.asyncExec(MyExec);" />
!!*/
}
function open() {
/*! block id=1445,1446,1447,1448,1449,1450,1451,1452 !*/
if (new Date().getDay() == 0)
{
if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),20,00,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),21,00,0,0).getTime()) { rosstalk.sendMessage("10.253.10.107", 7788, "TAKE " + 1798 + ":" + (1 -1) + ":" + 10);
} else {
} } else { if (new Date().getDay() == 6) { if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),20,00,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),21,00,0,0).getTime()) { rosstalk.sendMessage("10.253.10.107", 7788, "TAKE " + 1798 + ":" + (1 -1) + ":" + 10);
} else { } } else { if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),20,00,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),21,00,0,0).getTime()) { rosstalk.sendMessage("10.253.10.107", 7788, "TAKE " + 1798 + ":" + (1 -1) + ":" + 10);
} else { } }
}
/*! block id=1461 !*/
ogscript.pause(2250);
/*! block id=1462 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 0);
/*! block id=1463 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 1);
/*! block id=1464 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 2);
/*! block id=1465 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 3);
/*! block id=1466 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 4);
/*! block id=1467 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 5);
/*! block id=1468 !*/
rosstalk.sendMessage("10.253.10.107", 7788, "CLFB " + (1 - 1) + ":" + 6);
/*! block id=1469 !*/
ogscript.pause(3000);
/*! block id=1470 !*/
rosstalk.sendMessage("10.253.10.88", 7788, "MECUT ME:" + 3);
/*!!
<block id="1445" type="if_dayofweek" x="107" y="17" w="243" DAY="Sunday" TRUE="ID:1446" FALSE="ID:1448" next="ID:1461" />
<block id="1446" type="if_currenttimebetween" x="515" y="44" w="268" TIME1="20:00" TIME2="21:00" TRUE="ID:1447" FALSE="" />
<block id="1447" type="XPression.1_xpression_take" x="770" y="45" w="257" color="#ffc857" TAKEID="1798" BUFFER="1" LAYER="10" />
<block id="1448" type="if_dayofweek" x="284" y="118" w="243" DAY="Saturday" TRUE="ID:1449" FALSE="ID:1451" />
<block id="1449" type="if_currenttimebetween" x="499" y="151" w="268" TIME1="20:00" TIME2="21:00" TRUE="ID:1450" FALSE="" />
<block id="1450" type="XPression.1_xpression_take" x="765" y="168" w="262" color="#ffc857" TAKEID="1798" BUFFER="1" LAYER="10" />
<block id="1451" type="if_currenttimebetween" x="472" y="271" w="268" TIME1="20:00" TIME2="21:00" TRUE="ID:1452" FALSE="" />
<block id="1452" type="XPression.1_xpression_take" x="763" y="290" w="267" color="#ffc857" TAKEID="1798" BUFFER="1" LAYER="10" />
<block id="1461" type="customcode" x="119" y="267" w="343" CODE="ogscript.pause(2250);" next="ID:1462" />
<block id="1462" type="XPression.1_xpression_clearlayer" x="44" y="448" w="243" color="#ffc857" BUFFER="1" LAYER="0" next="ID:1463" />
<block id="1463" type="XPression.1_xpression_clearlayer" x="251" y="451" w="243" color="#ffc857" BUFFER="1" LAYER="1" next="ID:1464" />
<block id="1464" type="XPression.1_xpression_clearlayer" x="457" y="450" w="243" color="#ffc857" BUFFER="1" LAYER="2" next="ID:1465" />
<block id="1465" type="XPression.1_xpression_clearlayer" x="666" y="448" w="243" color="#ffc857" BUFFER="1" LAYER="3" next="ID:1466" />
<block id="1466" type="XPression.1_xpression_clearlayer" x="40" y="566" w="243" color="#ffc857" BUFFER="1" LAYER="4" next="ID:1467" />
<block id="1467" type="XPression.1_xpression_clearlayer" x="257" y="572" w="243" color="#ffc857" BUFFER="1" LAYER="5" next="ID:1468" />
<block id="1468" type="XPression.1_xpression_clearlayer" x="470" y="574" w="243" color="#ffc857" BUFFER="1" LAYER="6" next="ID:1469" />
<block id="1469" type="customcode" x="87" y="675" w="343" CODE="ogscript.pause(3000);" next="ID:1470" />
<block id="1470" type="Carbonite 00:0F:9B:03:D3:AF<br>Slot 0<br>Carbonite_carbonite_cut" x="531" y="687" w="243" MESRC="ME" MENUM="3" />
!!*/
}
/*! block id=1481 !*/
MyExec()
/*! block id=1480 !*/
open()
/*!!
<block id="1481" type="function_MyExec" x="76" y="30" w="243" next="ID:1480" />
<block id="1480" type="function_open" x="68" y="107" w="243" />
!!*/
/*!!<checksum>b01a18e66e00fcd0f4bbda0a54782296</checksum>!!*/
------------------------------
James Hessler
WAAY (HEARTLAND MEDIA)
------------------------------
Original Message:
Sent: 01-19-2023 15:58
From: James Hessler
Subject: DashBoard Visual Logic Ands & Ors
Hey James,
Thank you so much.
It will be a little while before I can digest all this and work it into my button---but the fact that what I need to do is possible is great!
Thanks,
James.
------------------------------
James Hessler
WAAY (HEARTLAND MEDIA)
Original Message:
Sent: 01-18-2023 10:04
From: James
Subject: DashBoard Visual Logic Ands & Ors
Hi James
asyncExec does not have a visual logic control block but you can use the "custom code" block to execute it. It takes a function name (and an optional delay) as arguments so you would put your main task body in a function and call it.


You would also use custom code to trigger a pause - it takes a number of milliseconds as its argument.

<abs contexttype="opengear" keepalive="true"> <button buttontype="push" height="111" left="47" name="Async Exec" top="81" width="232"> <task tasktype="ogscript">function MyExec() { /*! block id=1005,1004,1006,1007,1008,1009,1013,1014,1010,1011,1012 !*/ switch ( new Date().getDay()) { case 0: ogscript.debug("Sunday"); break; case 1: ogscript.debug("Monday"); break; case 2: ogscript.debug("Tuesday"); break; case 3: ogscript.debug("Wednesday"); ogscript.pause(1000); ogscript.debug("Yes... definitely Wednesday"); break; case 4: ogscript.debug("Thursday"); break; case 5: ogscript.debug("Friday"); break; case 6: ogscript.debug("Saturday"); break; } /*!! <block id="1005" type="switch" x="244" y="230" w="268" VALUE="ID:1004" STATEMENT="ID:1006" statementtag_STATEMENT="0" STATEMENT_0="ID:1007" statementtag_STATEMENT_0="1" STATEMENT_1="ID:1008" statementtag_STATEMENT_1="2" STATEMENT_2="ID:1009" statementtag_STATEMENT_2="3" STATEMENT_3="ID:1010" statementtag_STATEMENT_3="4" STATEMENT_4="ID:1011" statementtag_STATEMENT_4="5" STATEMENT_5="ID:1012" statementtag_STATEMENT_5="6" STATEMENT_6="" /> <block id="1004" type="getCurrentDay" x="10" y="10" w="243" empty2="" /> <block id="1006" type="ogscript_debug" x="564" y="8" w="243" MESSAGE="Sunday" /> <block id="1007" type="ogscript_debug" x="563" y="75" w="243" MESSAGE="Monday" /> <block id="1008" type="ogscript_debug" x="564" y="143" w="243" MESSAGE="Tuesday" /> <block id="1009" type="ogscript_debug" x="566" y="212" w="243" MESSAGE="Wednesday" next="ID:1013" /> <block id="1013" type="customcode" x="817" y="277" w="343" CODE="ogscript.pause(1000);" next="ID:1014" /> <block id="1014" type="ogscript_debug" x="844" y="439" w="243" MESSAGE="Yes... definitely Wednesday" /> <block id="1010" type="ogscript_debug" x="576" y="426" w="243" MESSAGE="Thursday" /> <block id="1011" type="ogscript_debug" x="575" y="508" w="243" MESSAGE="Friday" /> <block id="1012" type="ogscript_debug" x="569" y="587" w="243" MESSAGE="Saturday" /> !!*/}/*! block id=1001 !*/ogscript.asyncExec(MyExec);/*!! <block id="1001" type="customcode" x="185" y="136" w="343" CODE="ogscript.asyncExec(MyExec);" />!!*//*!!<checksum>28faf98de753390b0fcfc9464c2e5eb2</checksum>!!*/</task> </button></abs>
------------------------------
James Peltzer
Ross Video
Original Message:
Sent: 01-16-2023 16:20
From: James Hessler
Subject: DashBoard Visual Logic Ands & Ors
I have working visual logic to decide which open rolls depending upon the day and time that isn't alarmingly bulky.

My problem is that I have five tasks; which open?, pause, clear some Xpression layers, another pause, and cut ME3
If the opens are different lengths, this bites me on the undercut.
I've read about Async.Exec scripts (adding a dealy between tasks) but can't figure out where they would go, much less be able to write them.
I'm only assuming the Async.Exec would apply since I want it all to happen within one task.
Could I add your sample to a custom code block and have it do what I need?
I remember reading about a problem with more than one Async.Exec, so I'm not sure about how to address that...include that script snippet in another Custom Code block.
But where? at the beginning of my visual logic?
I want to exit the visual logic when it fires an open and does all the other steps---does a return block on the out side of my last function do that?
I know---so many questions---is there any hope?
Aside from being wary of the time needed to become proficient at JavaScript and therefore hopefully ogScript, I need this to be visual so that coworkers have a better chance of understanding what it does and be able to make changes down the road.
Thanks,
James.
------------------------------
James Hessler
WAAY (HEARTLAND MEDIA)
Original Message:
Sent: 01-16-2023 15:52
From: Aleksander
Subject: DashBoard Visual Logic Ands & Ors
If you want to learn how to code, the scrips in DashBoard is JavaScript based, and not that hard to get into.
As for the visual logic you need, I never solved that one in VL myself.
------------------------------
Aleksander Stalsberg
Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
Norway
Original Message:
Sent: 01-11-2023 22:56
From: James Hessler
Subject: DashBoard Visual Logic Ands & Ors
I'm working on some visual logic for a DashBoard panel button to roll the correct newscast open depending upon time of day and day of week.
I am much more familiar with visual logic in Xpression, but DashBoard doesn't have all the same blocks.
I've been trying to come up with a way to make an "and" condition, but either fail or start an approach that will be very cumbersome.
Below is the latest attempt, but I worry about how complex it would need to be to cover all days and dayparts.

I considered making each time its own task, but thought that might introduce some delays, if I had fifty tasks stacked up in a button.
I've started looking at the ogScript version of tasks I built with visual logic, but although I am capable of stringing together some coherent thoughts in VBScript for Xpression, ogScript is escaping me.
Am I close? Am I missing something?
Thanks,
James.
#DashBoard
#CarboniteBlack
#XPression
------------------------------
James Hessler
WAAY (HEARTLAND MEDIA)
------------------------------