02.08.2022, 11:46
(02.08.2022, 11:38)admin Wrote: Post your whole script with the for loop. There's should not be any difference between the loop and copy/pasted multiple sms function calls.
Code:
value = event.getvalue()
if value then
from_nr = '+****'
to_nrs = { '+***', '+***', '+***' }
id_nr = '***' -- put your ID here
token_nr = '***' -- put your token here
for _, to_nr in ipairs(to_nrs) do
sms(id_nr, token_nr, from_nr, to_nr, 'Alarm HCWC 009 changed to Alarm ON')
end
else
from_nr = '+****'
to_nrs = { '+***', '+***', '+***' }
id_nr = '***' -- put your ID here
token_nr = '***' -- put your token here
for _, to_nr in ipairs(to_nrs) do
sms(id_nr, token_nr, from_nr, to_nr, 'Alarm HCWC 009 changed to Alarm OFF')
end
end