Help me about looping to send message


im making app to send message and there is option to how many times to send.
and i try a lot of time to make it but.. i failed. this is my last code

Which is the initial value of "Times"? If you wat to enter in "Notice" the times of the loop, put it out of the loop.

time value is inputted by user. in this case it's 3.

Then it must enter into the loop twice. How are you you setting Times to 3? where are you calling to that loop? May be, if you show the relevant blocks.

blocks (2)

so the "time" variable is set as 0
and it's sending the message in exact time that user set it.
and "time" is not timeintervel. im just saying if u think it was that.
and i have to loop the last part. so it can send the same message "time" that user set it.

But what is the meaning of "Time" in those blocks? If you don't want to send several times the message, why do you want to use a loop? what is exactly your problem?

the exact problem is sending message several time in this script. but how many times that send message depends on users input. and "time" variable is that how many times it will send message. Use this aia file if u need.
ArtLedDesignV1_2_1_copy.aia (65.3 KB)

You are collecting the Times value of the text box well, so yes, if you want the message to be sent that number of times, you need to include a loop there like the one you had.

Are you being able to send the message once now without the loop?

First question: Do you succeed in sending ONE message?
Second question: Are you sure you want to use SendMessageDirect? You wll have trouble getting the right permissions, and maybe your phone makes trouble.
If you can send one message, then maybe you must leave some time between sending messages.

i send ONE message but i cant send several. i find out a way to it but... as you said, there were several delays when i use SendMessageDirect. Do i have to use extension?

Your solution will overwhelm the texting component and your device…

use a clock component to avoid sending the sms all at exactly the same time, see also The ‘Do something’ example

Taifun

Try Tims solution instead

No, you do not have to use an extension. Follow Taifun’s and Steve’s advice and experiment with how much time you need between messages.


i changed the code after i read it all. but there is error going out here.

What is around that block you showed? What is the error? Where is the timer we advised to use?

ERROR: GET SUBSCIPTION USER

there is error like this .
current block:

i mean GET SUBSCRIPTION USER HANDLE

i fixed GET SUBSCRIPTION USER HANDLE error by increasing timeinterval.
but now there is null PDU error.

Great. For the new problem, I have no idea what it means. Can you post a screenshot of the error message, and maybe Google on the problem?:neutral_face: