This is a common question from my customers and it is easy!
-
set up two memory string tags:
OnDutyEmail
OnDutyMobileMake sure they are retainable values
- Copy and paste the scripts below to the Init Section of BASIC IDE
ONCHANGE “OnDutyMobile”, “Goto SMSDestination”
ONCHANGE “OnDutyEmail”, “Goto EmailDestination”
SMSDestination:
D$ = OnDutyMobile@ + “,gsm,0”
NBTAGS% = GETSYS PRG,“NBTAGS”
For i%=0 To NBTAGS%-1
Setsys Tag,“load”,-i%
P$ = Getsys Tag,“AlEnabled”
REM Only change SMS number of Tags belonging to Page nr 2
If Val(P$) = 1 Then
Setsys Tag,“STO”,D$ : REM SMS To field of Tag_1
Setsys TAG,“save”
Endif
Next i%
CFGSAVE : REM Writes configuration to flash
LogEvent "SMS Number changed to: " + D$,100
Print “yea”
END
EmailDestination:
D$ = OnDutyEmail@
NBTAGS% = GETSYS PRG,“NBTAGS”
For i%=0 To NBTAGS%-1
Setsys Tag,“load”,-i%
P$ = Getsys Tag,“AlEnabled”
REM Only change SMS number of Tags belonging to Page nr 2
If Val(P$) = 1 Then
Setsys Tag,“ETO”,D$ : REM SMS To field of Tag_1
Setsys TAG,“save”
Endif
Next i%
CFGSAVE : REM Writes configuration to flash
LogEvent "Email changed to: " + D$,100
Print “hey”
END
-
save and run, turn on auto run
-
Bob is your uncle