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

Removing certain sms via referene number match.

Mon Jan 30, 2023 5:16 pm

Im here again for another problem sir, i did follow chatgpt code , and also I made ideas , but it turns out it dont work properly, i do like to remove sms with match refence number, or match acct number, but it turns out to be deleted all , please help. thanks
Here's my code
Last edited by akira463 on Sat Feb 04, 2023 9:55 am, edited 4 times in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:20 pm

ChatGPT?

Come here with real questions and probably you have real answers.
Last edited by rextended on Mon Jan 30, 2023 5:28 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:25 pm

Simply one line:
/tool sms inbox remove [find where message~$ref]
Last edited by rextended on Mon Jan 30, 2023 5:33 pm, edited 1 time in total.
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:27 pm

ChatGPT?

Come here with real questions and probably you have real answers.

(you have revealed true phone number on images and script....)
sorry sir , i just take same ideas on chat gpt code, like this code
Last edited by akira463 on Sat Feb 04, 2023 9:55 am, edited 1 time in total.
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:28 pm

Simply one line:
/tool sms inbox remove [find where message~$refNum]
thankyou sir for your quick response , im gonna try it,
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:31 pm

ChatGPT can't compete with logic of CatSTBC :lol: :lol: :lol:
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:32 pm

still same result sir, no such item......
sms 2.PNG
You do not have the required permissions to view the files attached to this post.
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:34 pm

ChatGPT can't compete with logic of CatSTBC :lol: :lol: :lol:
I just now knew chatgpt , I think I must go out in my cave :lol: , i thought there codes will run smooth , hahaha. still gonna think for the answers :lol: :lol:
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:34 pm

you must remove all chatgtp and leave only my line....

The problem is the rest of the code, is wrong....
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:39 pm

Without cycle, you can not parse all messages...

revised code

/tool sms inbox
:foreach item in=[find where phone="+63970XXXXX90" and message~"Ref\\. No\\."] do={
    :local newMess [get $item message]
    :local amount [:pick $newMess ([:find $newMess "PHP "] + 4) [:find $newMess ".00 of GCash"]]
    :local sender [:pick $newMess ([:find $newMess ". "] + 2) [:find $newMess  " w/"]]
    :local accMsg [:pick $newMess ([:find $newMess "MSG: "] + 5) [:find $newMess ". Your new"]]
    :local ref [:pick $newMess ([:find $newMess "Ref. No. "] + 9) ([:len $newMess] - 1)]
    /tool sms inbox remove [find where message~$ref]

    # do what you need here for each message

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

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 5:46 pm

you must remove all chatgtp and leave only my line....

The problem is the rest of the code, is wrong....
hahaha, im laughing at myself now , i did just things complicated, thanks again sir! youre the best!!! :D :D :D
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 6:04 pm

Sorry to ask again sir, but the code it does'nt seems to work , when there's a lot of sms , they just do work when it has only one sms, i did already using foreach, but still it does not work, it always says invalid internal item, what could be wrong?


this code deletes only one sms if it is only one sms in the inbox
/tool sms inbox
{

:global ref       [:pick $newMess ([:find $newMess "Ref. No. "] + 9) ([:len $newMess] - 1)]

  [/tool sms inbox remove [find where message~$ref]]
}

this one tells invalid internal item number,

:global ref       [:pick $newMess ([:find $newMess "Ref. No. "] + 9) ([:len $newMess] - 1)]
:local accNum "2021001"

:foreach i in=[find] do={
  [/tool sms inbox remove [find where message~$ref]]
}
}

Last edited by akira463 on Sat Feb 04, 2023 9:54 am, edited 2 times in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 6:12 pm

Does your code look like mine on post #10?
viewtopic.php?p=981064#p981049

(you have published again the number...)

It's late at your home, at midnight is better sleep...
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 6:16 pm

Does your code look like mine on post #10?
viewtopic.php?p=981064#p981049

(you have published again the number...)

It's late at your home, at midnight is better sleep...

sorry sir, i did'nt saw it before, thankyou for mentioning it again, sorry again :( .

ok ill try it , thankyou!
 
User avatar
akira463
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Thu Jan 11, 2018 12:30 pm
Location: Ph

Re: Removing certain sms via referene number match.

Mon Jan 30, 2023 6:26 pm

Thankyou again sir!! It works now furpectly!!! Youre awesome!!!!

Who is online

Users browsing this forum: No registered users and 25 guests