Community discussions

MikroTik App
 
User avatar
rgraham
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu May 05, 2005 10:50 pm
Location: USA Minneapolis, Minnesota

Westminister Chimes

Sun Jan 13, 2008 7:37 pm

Past this in the routers Terminal to have Westminister Chimes through the speaker.

#------------------------------------------------
/system script
add name="Westminister" source=":global c 11:00:00\r\n:global h 0\r\n:global m 0\r\n:global s 0\r\n:set c \[/system clock get time\]\r\n:set h \[ :tonum \[:pick \$c 0 2\]\]\r\n:set m \[ :tonum \[:pick \$c 3 5\]\]\r\n:set s \[ :tonum \[:pick \$c 6 8\]\]\r\n\r\n# First-quarter Sequence 1\r\n:if \( \$m=15 ) do /system script run \"Westminister Seq #1\"}\r\n# Half-hour Sequence 2,3\r\n:if \( \$m = 30 \) do {/system script run \"Westminister Seq #2\"}\r\n:if \( \$m = 30 \) do {:delay 2500ms}\r\n:if \( \$m = 30 \) do /system script run \"Westminister Seq #3\"}\r\n\r\n# Third-quarter Sequence 4,5,1\r\n:if \( \$m = 45 \) do {/system script run \"Westminister Seq #4\"}\r\n:if \( \$m = 45 \) do {:delay 2500ms}\r\n:if \( \$m = 45 \) do {/system script run \"Westminister Seq #5\"}\r\n:if \( \$m = 45 \) do {:delay 2500ms}\r\n:if \( \$m = 45 \) do {/system script run \"Westminister Seq #1\"}\r\n\r\n# Full-hour Sequence 2,3,4,5\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #2\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #3\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #4\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #5\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Chime\"}"

add name="Westminister Chime" source="#Westminister Chime\r\n#Chimes the number of times that the hour is.\r\n\r\n:global ch 6\r\n:set ch \[:tonum\(\$h\)\]\r\n:if \(\$ch>12\) do=\{:set ch \(\$ch - 12\)\}\r\n:if \(\$ch=0\) do=\{:set ch \(\$ch + 12\)\}\r\n:for i from=1 to \$ch step=1 do \{:beep length=1000ms frequency=440; :delay 1500ms\}"

add name="Westminister Seq #1" source="#Westminister Sequence #1\r\n# E-660 D-588 C-528 G-396\r\n# EDCG\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 500ms\r\n:beep length=480ms frequency=396\r\n:delay 10000ms"

add name="Westminister Seq #2" source="#Westminister Sequence #2\r\n# E-660 D-588 C-528 G-396\r\n# CEDG\r\n:beep length=480ms frequency=528\r\n:delay 500ms\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=396\r\n:delay 10000ms"

add name="Westminister Seq #3" source="#Westminister Sequence #3\r\n# E-660 D-588 C-523 G-396\r\n# CDEC\r\n:beep length=480ms frequency=523\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=659\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 10000ms"

add name="Westminister Seq #4" source="#Westminister Sequence #4\r\n# E-660 D-588 C-528 G-396\r\n# ECDG\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=396\r\n:delay 10000ms"

add name="Westminister Seq #5" source="#Westminister Sequence #5\r\n# E-660 D-588 C-528 G-396\r\n# GDEC\r\n:beep length=480ms frequency=396\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 10000ms"

/ system scheduler
add name="Westminister" on-event=Westminister start-date=jan/01/1970 start-time=00:00:00 interval=15m comment="" disabled=no

#------------------------------------------------
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26930
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Westminister Chimes

Wed Jan 16, 2008 11:24 am

wow nice!!!!
 
User avatar
rgraham
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu May 05, 2005 10:50 pm
Location: USA Minneapolis, Minnesota

Re: Westminister Chimes

Thu Jan 24, 2008 6:06 pm

There are a couple of errors in the script. Can you figure it out?
 
User avatar
rgraham
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu May 05, 2005 10:50 pm
Location: USA Minneapolis, Minnesota

Re: Westminister Chimes

Thu Jan 24, 2008 8:25 pm

Here's a new copy with the corrections that I did.

/system script
add name="Westminister" source=":global c 11:00:00\r\n:global h 0\r\n:global m 0\r\n:global s 0\r\n:set c \[/system clock get time\]\r\n:set h \[ :tonum \[:pick \$c 0 2\]\]\r\n:set m \[ :tonum \[:pick \$c 3 5\]\]\r\n:set s \[ :tonum \[:pick \$c 6 8\]\]\r\n\r\n# First-quarter Sequence 1\r\n:if \( \$m=15 ) do {/system script run \"Westminister Seq #1\"}\r\n\r\n# Half-hour Sequence 2,3\r\n:if \( \$m = 30 \) do {/system script run \"Westminister Seq #2\"}\r\n:if \( \$m = 30 \) do {:delay 2500ms}\r\n:if \( \$m = 30 \) do {/system script run \"Westminister Seq #3\"}\r\n\r\n# Third-quarter Sequence 4,5,1\r\n:if \( \$m = 45 \) do {/system script run \"Westminister Seq #4\"}\r\n:if \( \$m = 45 \) do {:delay 2500ms}\r\n:if \( \$m = 45 \) do {/system script run \"Westminister Seq #5\"}\r\n:if \( \$m = 45 \) do {:delay 2500ms}\r\n:if \( \$m = 45 \) do {/system script run \"Westminister Seq #1\"}\r\n\r\n# Full-hour Sequence 2,3,4,5\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #2\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #3\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #4\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Seq #5\"}\r\n:if \( \$m=0 \) do {:delay 2500ms}\r\n:if \( \$m=0 \) do {/system script run \"Westminister Chime\"}"

add name="Westminister Chime" source="#Westminister Chime\r\n#Chimes the number of times that the hour is.\r\n\r\n:global ch 6\r\n:set ch \[:tonum\(\$h\)\]\r\n:if \(\$ch>12\) do=\{:set ch \(\$ch - 12\)\}\r\n:if \(\$ch=0\) do=\{:set ch \(\$ch + 12\)\}\r\n:for i from=1 to \$ch step=1 do \{:beep length=1000ms frequency=440; :delay 1500ms\}"

add name="Westminister Seq #1" source="#Westminister Sequence #1\r\n# E-660 D-588 C-528 G-396\r\n# EDCG\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 500ms\r\n:beep length=480ms frequency=396\r\n:delay 10000ms"

add name="Westminister Seq #2" source="#Westminister Sequence #2\r\n# E-660 D-588 C-528 G-396\r\n# CEDG\r\n:beep length=480ms frequency=528\r\n:delay 500ms\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=396\r\n:delay 10000ms"

add name="Westminister Seq #3" source="#Westminister Sequence #3\r\n# E-660 D-588 C-523 G-396\r\n# CDEC\r\n:beep length=480ms frequency=523\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=659\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 10000ms"

add name="Westminister Seq #4" source="#Westminister Sequence #4\r\n# E-660 D-588 C-528 G-396\r\n# ECDG\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=396\r\n:delay 10000ms"

add name="Westminister Seq #5" source="#Westminister Sequence #5\r\n# E-660 D-588 C-528 G-396\r\n# GDEC\r\n:beep length=480ms frequency=396\r\n:delay 500ms\r\n:beep length=480ms frequency=588\r\n:delay 500ms\r\n:beep length=480ms frequency=660\r\n:delay 500ms\r\n:beep length=480ms frequency=528\r\n:delay 10000ms"

/ system scheduler
add name="Westminister" on-event=Westminister start-date=jan/01/1970 start-time=00:00:00 interval=15m comment="" disabled=no
 
User avatar
omega-00
Forum Guru
Forum Guru
Posts: 1167
Joined: Sat Jun 06, 2009 4:54 am
Location: Australia
Contact:

Re: Westminister Chimes

Mon Mar 02, 2009 12:16 pm

That didn't paste properly for me so I've reformated it here
/ system scheduler
add name="Westminister" on-event=Westminister start-date=jan/01/1970 start-time=00:00:00 interval=15m comment="" disabled=no
/system script
add name="Westminister Seq #2" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #2\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# CEDG\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=396\r\
    \n:delay 10000ms"
add name="Westminister Seq #3" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #3\r\
    \n# E-660 D-588 C-523 G-396\r\
    \n# CDEC\r\
    \n:beep length=480ms frequency=523\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=659\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 10000ms"
add name="Westminister Seq #4" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #4\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# ECDG\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=396\r\
    \n:delay 10000ms"
add name="Westminister Seq #5" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #5\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# GDEC\r\
    \n:beep length=480ms frequency=396\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 10000ms"
add name=Westminister policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source=":global c \
    11:00:00\r\
    \n:global h 0\r\
    \n:global m 0\r\
    \n:global s 0\r\
    \n:set c  [/system clock get time ]\r\
    \n:set h  [ :tonum  [:pick  \$c 0 2 ] ]\r\
    \n:set m  [ :tonum  [:pick  \$c 3 5 ] ]\r\
    \n:set s  [ :tonum  [:pick  \$c 6 8 ] ]\r\
    \n\r\
    \n# First-quarter Sequence 1\r\
    \n:if  (  \$m=15 ) do {/system script run  \"Westminister Seq #1\"}\r\
    \n\r\
    \n# Half-hour Sequence 2,3\r\
    \n:if  (  \$m = 30  ) do {/system script run  \"Westminister Seq #2\"}\r\
    \n:if  (  \$m = 30  ) do {:delay 2500ms}\r\
    \n:if  (  \$m = 30  ) do {/system script run  \"Westminister Seq #3\"}\r\
    \n\r\
    \n# Third-quarter Sequence 4,5,1\r\
    \n:if  (  \$m = 45  ) do {/system script run  \"Westminister Seq #4\"}\r\
    \n:if  (  \$m = 45  ) do {:delay 2500ms}\r\
    \n:if  (  \$m = 45  ) do {/system script run  \"Westminister Seq #5\"}\r\
    \n:if  (  \$m = 45  ) do {:delay 2500ms}\r\
    \n:if  (  \$m = 45  ) do {/system script run  \"Westminister Seq #1\"}\r\
    \n\r\
    \n# Full-hour Sequence 2,3,4,5\r\
    \n:if  (  \$m=0  ) do {/system script run  \"Westminister Seq #2\"}\r\
    \n:if  (  \$m=0  ) do {:delay 2500ms}\r\
    \n:if  (  \$m=0  ) do {/system script run  \"Westminister Seq #3\"}\r\
    \n:if  (  \$m=0  ) do {:delay 2500ms}\r\
    \n:if  (  \$m=0  ) do {/system script run  \"Westminister Seq #4\"}\r\
    \n:if  (  \$m=0  ) do {:delay 2500ms}\r\
    \n:if  (  \$m=0  ) do {/system script run  \"Westminister Seq #5\"}\r\
    \n:if  (  \$m=0  ) do {:delay 2500ms}\r\
    \n:if  (  \$m=0  ) do {/system script run  \"Westminister Chime\"}\r\
    \n"
add name="Westminster Chime" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Chime\r\
    \n#Chimes the number of times that the hour is.\r\
    \n\r\
    \n:global ch 6\r\
    \n:set ch  [:tonum ( \$h ) ]\r\
    \n:if  ( \$ch>12 ) do= {:set ch  ( \$ch - 12 ) }\r\
    \n:if  ( \$ch=0 ) do= {:set ch  ( \$ch + 12 ) }\r\
    \n:for i from=1 to  \$ch step=1 do  {:beep length=1000ms frequency=440; :d\
    elay 1500ms }\""
 
mindlesstux
just joined
Posts: 15
Joined: Tue Mar 17, 2009 3:20 pm
Location: Charlotte, NC, USA
Contact:

Re: Westminister Chimes

Tue Mar 17, 2009 3:24 pm

Did not work for me on a 133 running 3.20. Had to modify the script some, mostly in the chime and delays.

*edit* Corrected the chime */edit*
/system script
add name="Westminister Seq #1" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #1\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# EDCG\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=396"
add name="Westminister Seq #2" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #2\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# CEDG\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=396"
add name="Westminister Seq #3" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #3\r\
    \n# E-660 D-588 C-523 G-396\r\
    \n# CDEC\r\
    \n:beep length=480ms frequency=523\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=659\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528"
add name="Westminister Seq #4" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #4\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# ECDG\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=396\r\
    \n"
add name="Westminister Seq #5" policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source="#Westminis\
    ter Sequence #5\r\
    \n# E-660 D-588 C-528 G-396\r\
    \n# GDEC\r\
    \n:beep length=480ms frequency=396\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=588\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=660\r\
    \n:delay 500ms\r\
    \n:beep length=480ms frequency=528"
add name="Westminister Chime" policy=\
    ftp,reboot,read,write,policy,test,winbox,password source="#Westminister Ch\
    ime\r\
    \n#Chimes the number of times that the hour is.\r\
    \n:global h\r\
    \n:global ch\r\
    \n:if  ( \$h >12 ) do= {\r\
    \n:set ch  ( \$h - 12 )\r\
    \n:};\r\
    \n:if  ( \$h < 12 ) do= {\r\
    \n:set ch \$h\r\
    \n:}\r\
    \n:if  ( \$h=0 ) do= {\r\
    \n:set ch  ( \$h + 12 )\r\
    \n:}\r\
    \n\r\
    \n:for i from=1 to=\$ch step=1 do={\r\
    \n:beep length=1000ms frequency=440;\r\
    \n:delay 2000ms\r\
    \n:}"
add name=Westminister policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff source=":global c \
    11:00:00\r\
    \n:global h 0\r\
    \n:global m 0\r\
    \n:global s 0\r\
    \n:set c  [/system clock get time ]\r\
    \n:set h  [ :tonum  [:pick  \$c 0 2 ] ]\r\
    \n:set m  [ :tonum  [:pick  \$c 3 5 ] ]\r\
    \n:set s  [ :tonum  [:pick  \$c 6 8 ] ]\r\
    \n\r\
    \n#Really should put a limiter in here so it does not chime all night long\
     when no one is around to hear it.\r\
    \n\r\
    \n# First-quarter Sequence 1\r\
    \n:if  (  \$m=15 ) do {/system script run  \"Westminister Seq #1\"}\r\
    \n\r\
    \n# Half-hour Sequence 2,3\r\
    \n:if  (  \$m = 30  ) do {/system script run  \"Westminister Seq #2\"}\r\
    \n:if  (  \$m = 30  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 30  ) do {/system script run  \"Westminister Seq #3\"}\r\
    \n\r\
    \n# Third-quarter Sequence 4,5,1\r\
    \n:if  (  \$m = 45  ) do {/system script run  \"Westminister Seq #4\"}\r\
    \n:if  (  \$m = 45  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 45  ) do {/system script run  \"Westminister Seq #5\"}\r\
    \n:if  (  \$m = 45  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 45  ) do {/system script run  \"Westminister Seq #1\"}\r\
    \n\r\
    \n# Full-hour Sequence 2,3,4,5\r\
    \n:if  (  \$m = 0  ) do {/system script run  \"Westminister Seq #2\"}\r\
    \n:if  (  \$m = 0  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 0  ) do {/system script run  \"Westminister Seq #3\"}\r\
    \n:if  (  \$m = 0  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 0  ) do {/system script run  \"Westminister Seq #4\"}\r\
    \n:if  (  \$m = 0  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 0  ) do {/system script run  \"Westminister Seq #5\"}\r\
    \n:if  (  \$m = 0  ) do { :delay 2000ms }\r\
    \n:if  (  \$m = 0  ) do {/system script run  \"Westminister Chime\"}\r\
    \n:if  (  \$m = 0  ) do { :delay 2000ms }"