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
ChatGPT?
Come here with real questions and probably you have real answers.
Simply one line:
/tool sms inbox remove [find where message~$ref]
sorry sir , i just take same ideas on chat gpt code, like this code
thankyou sir for your quick response , im gonna try it,
ChatGPT can’t compete with logic of CatSTBC
![]()
still same result sir, no such item…

I just now knew chatgpt , I think I must go out in my cave
, i thought there codes will run smooth , hahaha. still gonna think for the answers
![]()
you must remove all chatgtp and leave only my line…
The problem is the rest of the code, is wrong…
Without cycle, you can not parse all messages…
/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
}
hahaha, im laughing at myself now , i did just things complicated, thanks again sir! youre the best!!!
![]()
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]]
}
}
Does your code look like mine on post #10?
https://forum.mikrotik.com/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!
Thankyou again sir!! It works now furpectly!!! Youre awesome!!!