Community discussions

MikroTik App
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

How to add "or" condition on this code?

Tue May 02, 2023 7:20 pm

Hello again sirs, Im having a hard time on how to put "or" selector on this code, please do help.
:local usb                  "usb4"
:local myNum                "0951490XXXXX"
:local acceptNum           {"GCash"; "+6395149XXXX"}

/tool sms inbox
:foreach item in=[find] do={
  :local uphone [get $item phone]
  :local newMess [get $item message]
  :local uphone [get $item phone]
  :local variable {"GCash"; "+6395149XXXX"}

    /tool sms send $usb $myNum message="$newMess\n\n\n\nReceived From: $uphone"
    ([/tool sms inbox remove [find where phone!="+639514XXXXX"]] or [/tool sms inbox remove [find where phone!="GCash"]])
}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: How to add "or" condition on this code?

Tue May 02, 2023 9:30 pm

/tool sms inbox remove [find where ( (phone != "+639514XXXXX") or  (phone != "GCash") )]
But all SMSs are deleted because
if the phone do not have GCash, the SMS is deleted
and all the others are deleted because when have GCash do not have "+639514XXXXX"......

All SMS are at the same time different to "+639514" OR different to "GCash"........

Who is online

Users browsing this forum: No registered users and 7 guests