cirrus
Technical User
- Aug 20, 2003
- 5
Ok here is my script. The problem is that I only want ONE action per line received but it seems that targets 20 and 22 also cause targets 19 and 21 to be triggered. I am new to this as this is my script. Any suggestions in laymens terms so there is no conflict between 19-22?
modify the code or please give me an example so I can understand.
Thanks,
Here's what I've coded:
proc start
string logs = "dsctemp.txt"
run "c:\dsc\renlog.bat"
pause 5
set capture path "c:\dsc"
set capture file logs
capture on
endproc
proc main
when target 0 "test" call test
when target 1 "Alarm Zone 1" call alarm1 ;Basement magenets
when target 2 "Alarm Zone 2" call alarm2 ;Basement glassbreak
when target 3 "Alarm Zone 3" call alarm3 ;Basement Motion
when target 4 "Alarm Zone 4" call alarm4 ;Front Doors
when target 5 "Alarm Zone 5" call alarm5 ;Kitchen Glassbreak
when target 6 "Alarm Zone 6" call alarm6 ;1st Floor Front Motion
when target 7 "Alarm Zone 7" call alarm7 ;1st Floor Back Motion
when target 8 "Alarm Zone 8" call alarm8 ;2nd Floor Motion
when target 9 "Alarm Restore Zone 1" call alarmr1
when target 10 "Alarm Restore Zone 2" call alarmr2
when target 11 "Alarm Restore Zone 3" call alarmr3
when target 12 "Alarm Restore Zone 4" call alarmr4
when target 13 "Alarm Restore Zone 5" call alarmr5
when target 14 "Alarm Restore Zone 6" call alarmr6
when target 15 "Alarm Restore Zone 7" call alarmr7
when target 16 "Alarm Restore Zone 8" call alarmr8
when target 17 "Armed in" call armed
when target 18 "Opening" call disarmed
when target 19 "Telephone Line Trouble" call telldown
when target 20 "Telephone Line Trouble Restore" call tellup
when target 21 "Bell Circuit Trouble" call sirendown
when target 22 "Bell Circuit Trouble Restore" call sirenup
when target 23 "Cold Start" call coldstart
when target 24 "keypad lockout" call keypad
while 1
yield
endwhile
endproc
proc test
run "c:\winnt\system32\calc.exe"
endproc
proc alarm1
run "c:\dsc\alarm1.bat"
endproc
proc alarm2
run "c:\dsc\alarm2.bat"
endproc
proc alarm3
run "c:\dsc\alarm3.bat"
endproc
proc alarm4
run "c:\dsc\alarm4.bat"
endproc
proc alarm5
run "c:\dsc\alarm5.bat"
endproc
proc alarm6
run "c:\dsc\alarm6.bat"
endproc
proc alarm7
run "c:\dsc\alarm7.bat"
endproc
proc alarm8
run "c:\dsc\alarm8.bat"
endproc
proc alarmr1
run "c:\dsc\alarmr1.bat"
endproc
proc alarmr2
run "c:\dsc\alarmr2.bat"
endproc
proc alarmr3
run "c:\dsc\alarmr3.bat"
endproc
proc alarmr4
run "c:\dsc\alarmr4.bat"
endproc
proc alarmr5
run "c:\dsc\alarmr5.bat"
endproc
proc alarmr6
run "c:\dsc\alarmr6.bat"
endproc
proc alarmr7
run "c:\dsc\alarmr7.bat"
endproc
proc alarmr8
run "c:\dsc\alarmr8.bat"
endproc
proc armed
run "c:\dsc\armed.bat"
endproc
proc disarmed
run "c:\dsc\disarmed.bat"
endproc
proc tellup
run "c:\dsc\tellup.bat"
endproc
proc telldown
run "c:\dsc\telldown.bat"
endproc
proc sirenup
run "c:\dsc\sirenup.bat"
endproc
proc sirendown
run "c:\dsc\sirendown.bat"
endproc
proc coldstart
run "c:\dsc\coldstart.bat"
endproc
proc keypad
run "c:\dsc\keypad.bat"
endproc
modify the code or please give me an example so I can understand.
Thanks,
Here's what I've coded:
proc start
string logs = "dsctemp.txt"
run "c:\dsc\renlog.bat"
pause 5
set capture path "c:\dsc"
set capture file logs
capture on
endproc
proc main
when target 0 "test" call test
when target 1 "Alarm Zone 1" call alarm1 ;Basement magenets
when target 2 "Alarm Zone 2" call alarm2 ;Basement glassbreak
when target 3 "Alarm Zone 3" call alarm3 ;Basement Motion
when target 4 "Alarm Zone 4" call alarm4 ;Front Doors
when target 5 "Alarm Zone 5" call alarm5 ;Kitchen Glassbreak
when target 6 "Alarm Zone 6" call alarm6 ;1st Floor Front Motion
when target 7 "Alarm Zone 7" call alarm7 ;1st Floor Back Motion
when target 8 "Alarm Zone 8" call alarm8 ;2nd Floor Motion
when target 9 "Alarm Restore Zone 1" call alarmr1
when target 10 "Alarm Restore Zone 2" call alarmr2
when target 11 "Alarm Restore Zone 3" call alarmr3
when target 12 "Alarm Restore Zone 4" call alarmr4
when target 13 "Alarm Restore Zone 5" call alarmr5
when target 14 "Alarm Restore Zone 6" call alarmr6
when target 15 "Alarm Restore Zone 7" call alarmr7
when target 16 "Alarm Restore Zone 8" call alarmr8
when target 17 "Armed in" call armed
when target 18 "Opening" call disarmed
when target 19 "Telephone Line Trouble" call telldown
when target 20 "Telephone Line Trouble Restore" call tellup
when target 21 "Bell Circuit Trouble" call sirendown
when target 22 "Bell Circuit Trouble Restore" call sirenup
when target 23 "Cold Start" call coldstart
when target 24 "keypad lockout" call keypad
while 1
yield
endwhile
endproc
proc test
run "c:\winnt\system32\calc.exe"
endproc
proc alarm1
run "c:\dsc\alarm1.bat"
endproc
proc alarm2
run "c:\dsc\alarm2.bat"
endproc
proc alarm3
run "c:\dsc\alarm3.bat"
endproc
proc alarm4
run "c:\dsc\alarm4.bat"
endproc
proc alarm5
run "c:\dsc\alarm5.bat"
endproc
proc alarm6
run "c:\dsc\alarm6.bat"
endproc
proc alarm7
run "c:\dsc\alarm7.bat"
endproc
proc alarm8
run "c:\dsc\alarm8.bat"
endproc
proc alarmr1
run "c:\dsc\alarmr1.bat"
endproc
proc alarmr2
run "c:\dsc\alarmr2.bat"
endproc
proc alarmr3
run "c:\dsc\alarmr3.bat"
endproc
proc alarmr4
run "c:\dsc\alarmr4.bat"
endproc
proc alarmr5
run "c:\dsc\alarmr5.bat"
endproc
proc alarmr6
run "c:\dsc\alarmr6.bat"
endproc
proc alarmr7
run "c:\dsc\alarmr7.bat"
endproc
proc alarmr8
run "c:\dsc\alarmr8.bat"
endproc
proc armed
run "c:\dsc\armed.bat"
endproc
proc disarmed
run "c:\dsc\disarmed.bat"
endproc
proc tellup
run "c:\dsc\tellup.bat"
endproc
proc telldown
run "c:\dsc\telldown.bat"
endproc
proc sirenup
run "c:\dsc\sirenup.bat"
endproc
proc sirendown
run "c:\dsc\sirendown.bat"
endproc
proc coldstart
run "c:\dsc\coldstart.bat"
endproc
proc keypad
run "c:\dsc\keypad.bat"
endproc