|
@@ -99,45 +99,109 @@ $telefon['contact'] = {
|
|
|
if $ARGS[0] = 'AddContact':
|
|
|
!! $ARGS[1] = NPC Array identifier
|
|
|
!! $ARGS[2] = Icon
|
|
|
- !! $ARGS[3] = Code to execute for Call out
|
|
|
- !! $ARGS[4] = If statement code to determine schedule for outbound calls
|
|
|
- !! $ARGS[5] = Code to execute for Incoming call
|
|
|
- !! $ARGS[6] = if statement code for schedule of incoming calls
|
|
|
- !! $ARGS[7] = Code to execute for SMS out
|
|
|
- !! $ARGS[8] = If statement code to determine schedule for outbound SMS
|
|
|
- !! $ARGS[9] = Code to execute for Incoming SMS
|
|
|
- !! $ARGS[10] = if statement code for schedule of incoming SMS
|
|
|
- !! ARGS[11] = Anonymous? 0 if not, 1 if yes
|
|
|
+ !! ARGS[3] = Anonymous? 0 if not, 1 if yes
|
|
|
+
|
|
|
$telefonCon['NPC'] = $ARGS[1]
|
|
|
$telefonCon['Icon'] = $ARGS[2]
|
|
|
- $telefonCon['OutCode'] = $ARGS[3]
|
|
|
- $telefonCon['OutSched'] = $ARGS[4]
|
|
|
- $telefonCon['InCode'] = $ARGS[5]
|
|
|
- $telefonCon['InSched'] = $ARGS[6]
|
|
|
- $telefonCon['OutSMSCode'] = $ARGS[7]
|
|
|
- $telefonCon['OutSMSSched'] = $ARGS[8]
|
|
|
- $telefonCon['InSMSCode'] = $ARGS[9]
|
|
|
- $telefonCon['InSMSSched'] = $ARGS[10]
|
|
|
- telefonCon['Anonymous'] = ARGS[11]
|
|
|
+ telefonCon['Anonymous'] = ARGS[3]
|
|
|
+
|
|
|
telefonCon['ContactListID'] = arrpos('$contact', $telefonCon['NPC'])
|
|
|
if telefonCon['ContactListID'] = -1:
|
|
|
telefonCon['ContactListID'] = arrsize('$contact')
|
|
|
$contact[telefonCon['ContactListID']] = $telefonCon['NPC']
|
|
|
+ $contactOCode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactOSche[telefonCon['ContactListID']] = "0"
|
|
|
+ $contactICode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactISche[telefonCon['ContactListID']] = "0"
|
|
|
+ $contactOSMSCode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactOSMSSche[telefonCon['ContactListID']] = "0"
|
|
|
+ $contactISMSCode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactISMSSche[telefonCon['ContactListID']] = "0"
|
|
|
end
|
|
|
$contactIcon[telefonCon['ContactListID']] = $telefonCon['Icon']
|
|
|
+ contactAnon[telefonCon['ContactListID']] = telefonCon['Anonymous']
|
|
|
+
|
|
|
+ killvar 'telefonCon'
|
|
|
+ killvar '$telefonCon'
|
|
|
+end & ! --- AddContact ---
|
|
|
+
|
|
|
+if $ARGS[0] = 'SetCallSchedule':
|
|
|
+ !! $ARGS[1] = NPC Array identifier
|
|
|
+ !! $ARGS[2] = Code to execute for Call out
|
|
|
+ !! $ARGS[3] = If statement code to determine schedule for outbound calls
|
|
|
+ !! $ARGS[4] = Code to execute for Incoming call
|
|
|
+ !! $ARGS[5] = if statement code for schedule of incoming calls
|
|
|
+ $telefonCon['NPC'] = $ARGS[1]
|
|
|
+ telefonCon['ContactListID'] = arrpos('$contact', $telefonCon['NPC'])
|
|
|
+ if telefonCon['ContactListID'] = -1:
|
|
|
+ !! If the contact does not exist, create an anonymous contact.
|
|
|
+ gs 'telefon', 'AddContact', $telefonCon['NPC'], 'icon_na', 1
|
|
|
+ end
|
|
|
+
|
|
|
+ $telefonCon['OutCode'] = $ARGS[2]
|
|
|
+ if $ARGS[3] ! '': $telefonCon['OutSched'] = $ARGS[3] else $telefonCon['OutSched'] = "0"
|
|
|
+ $telefonCon['InCode'] = $ARGS[4]
|
|
|
+ if $ARGS[5] ! '': $telefonCon['InSched'] = $ARGS[5] else $telefonCon['InSched'] = "0"
|
|
|
+
|
|
|
$contactOCode[telefonCon['ContactListID']] = $telefonCon['OutCode']
|
|
|
$contactOSche[telefonCon['ContactListID']] = $telefonCon['OutSched']
|
|
|
$contactICode[telefonCon['ContactListID']] = $telefonCon['InCode']
|
|
|
$contactISche[telefonCon['ContactListID']] = $telefonCon['InSched']
|
|
|
+
|
|
|
+ killvar '$telefonCon'
|
|
|
+end & ! --- SetCallSchedule ---
|
|
|
+
|
|
|
+if $ARGS[0] = 'ClearCallSchedule':
|
|
|
+ $telefonCon['NPC'] = $ARGS[1]
|
|
|
+ telefonCon['ContactListID'] = arrpos('$contact', $telefonCon['NPC'])
|
|
|
+ if telefonCon['ContactListID'] = -1: exit
|
|
|
+ $contactOCode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactOSche[telefonCon['ContactListID']] = "0"
|
|
|
+ $contactICode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactISche[telefonCon['ContactListID']] = "0"
|
|
|
+
|
|
|
+ killvar '$telefonCon'
|
|
|
+end & ! --- ClearCallSchedule ---
|
|
|
+
|
|
|
+
|
|
|
+if $ARGS[0] = 'SetSMSSchedule':
|
|
|
+ !! $ARGS[1] = NPC Array identifier
|
|
|
+ !! $ARGS[2] = Code to execute for SMS out
|
|
|
+ !! $ARGS[3] = If statement code to determine schedule for outbound SMS
|
|
|
+ !! $ARGS[4] = Code to execute for Incoming SMS
|
|
|
+ !! $ARGS[5] = if statement code for schedule of incoming SMS
|
|
|
+
|
|
|
+ $telefonCon['NPC'] = $ARGS[1]
|
|
|
+ telefonCon['ContactListID'] = arrpos('$contact', $telefonCon['NPC'])
|
|
|
+ if telefonCon['ContactListID'] = -1:
|
|
|
+ !! If the contact does not exist, create an anonymous contact.
|
|
|
+ gs 'telefon', 'AddContact', $telefonCon['NPC'], 'icon_na', 1
|
|
|
+ end
|
|
|
+
|
|
|
+ $telefonCon['OutSMSCode'] = $ARGS[2]
|
|
|
+ if $ARGS[3] ! "": $telefonCon['OutSMSSched'] = $ARGS[3] else $telefonCon['OutSMSSched'] = "0"
|
|
|
+ $telefonCon['InSMSCode'] = $ARGS[4]
|
|
|
+ if $ARGS[5] ! "": $telefonCon['InSMSSched'] = $ARGS[5] else $telefonCon['InSMSSched'] = "0"
|
|
|
+
|
|
|
$contactOSMSCode[telefonCon['ContactListID']] = $telefonCon['OutSMSCode']
|
|
|
$contactOSMSSche[telefonCon['ContactListID']] = $telefonCon['OutSMSSched']
|
|
|
$contactISMSCode[telefonCon['ContactListID']] = $telefonCon['InSMSCode']
|
|
|
$contactISMSSche[telefonCon['ContactListID']] = $telefonCon['InSMSSched']
|
|
|
- contactAnon[telefonCon['ContactListID']] = telefonCon['Anonymous']
|
|
|
|
|
|
- killvar 'telefonCon'
|
|
|
killvar '$telefonCon'
|
|
|
-end &! --- AddContact ---
|
|
|
+end & ! --- SetSMSSchedule ---
|
|
|
+
|
|
|
+if $ARGS[0] = 'ClearSMSSchedule':
|
|
|
+ $telefonCon['NPC'] = $ARGS[1]
|
|
|
+ telefonCon['ContactListID'] = arrpos('$contact', $telefonCon['NPC'])
|
|
|
+ if telefonCon['ContactListID'] = -1: exit
|
|
|
+ $contactOSMSCode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactOSMSSche[telefonCon['ContactListID']] = "0"
|
|
|
+ $contactISMSCode[telefonCon['ContactListID']] = ""
|
|
|
+ $contactISMSSche[telefonCon['ContactListID']] = "0"
|
|
|
+
|
|
|
+ killvar '$telefonCon'
|
|
|
+end & ! --- ClearSMSSchedule ---
|
|
|
|
|
|
if $ARGS[0] = 'DeleteContact':
|
|
|
!! $ARGS[1] = NPC Array identifier
|
|
@@ -155,7 +219,6 @@ if $ARGS[0] = 'DeleteContact':
|
|
|
killvar '$contactISMSCode', telefonCon['ContactListID']
|
|
|
killvar '$contactISMSSche', telefonCon['ContactListID']
|
|
|
killvar 'contactAnon', telefonCon['ContactListID']
|
|
|
-
|
|
|
end
|
|
|
|
|
|
killvar 'telefonCon'
|
|
@@ -1041,7 +1104,22 @@ if $ARGS[0] = 'delete_sms_send_id':
|
|
|
end
|
|
|
|
|
|
|
|
|
+if $ARGS[0] = 'IncomingSMSCheck':
|
|
|
+ i=0
|
|
|
+ :telefonIncSMSLoop
|
|
|
+ if i < arrsize('$contact'):
|
|
|
+ if $contactISMSCode[i] ! "":
|
|
|
+ if dyneval('result = iif(<<$contactISMSSche[i]>>,1,0)') = 1:
|
|
|
+ dynamic $contactISMSCode[i]
|
|
|
+ end
|
|
|
+ end
|
|
|
+ i += 1
|
|
|
+ jump 'telefonIncSMSLoop'
|
|
|
+ end
|
|
|
+
|
|
|
|
|
|
+ killvar 'i'
|
|
|
+end
|
|
|
|
|
|
|
|
|
|