multiple direct messages with for loop

Home Forums Scripts multiple direct messages with for loop

This topic contains 3 replies, has 2 voices, and was last updated by  IanniX 1 year ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4188 Reply

    Joseph

    Hi. I’m trying to load a single cursor with multiple setpointat messages. Not working. Is it even possible? I think this is just overwriting all but the last iteration.

    for(var i = 0 ; i < 12 ; i++) {
    run(“setmessage 8 20 , direct:// setpointat ” + i+200 + ” 0 cursor_xPos cursor_yPos cursor_zPos “);
    }

    #4189 Reply

    IanniX
    Keymaster

    Hi!
    You need to concatenate a string like this :

    var message = "";
    for(var i = 0 ; i < 12 ; i++) {
         message = message + “, direct:// setpointat ” + i+200 + ” 0 cursor_xPos cursor_yPos cursor_zPos“);
    }
    run(“setmessage 8 20 " + message);
    #4190 Reply

    Joseph

    I had to take out that last parenthesis and semicolon, but it works . . .

    message = message + “, direct:// setpointat ” + i+200 + ” 0 cursor_xPos cursor_yPos cursor_zPos“);

    becomes…

    message = message + “, direct:// setpointat ” + i+200 + ” 0 cursor_xPos cursor_yPos cursor_zPos”

    Thank You.

    #4191 Reply

    IanniX
    Keymaster

    Yes, sorry, I didn’t test it before posting 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: multiple direct messages with for loop
Your information:





© IanniX Association

What is IanniX? | Download | Showcase | Forums | Research | About