Jump to content
Reyetta Claven

Script to send messages to multiple channels sequentially?

You are about to reply to a thread that has been inactive for 167 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm trying to figure out how to script an object to automatically send a test message to a large number of channels, one at a time. My end goal is to figure out which channel another scripted object I own is listening for. Alternatively, if anyone knows a better way to do that, I'm all ears.

Share this post


Link to post
Share on other sites

No matter how you do it, if you have absolutely no clue what the channel number is, it will take a rather long time to test them all.  After all, there are 4,294,967,295 possibilities. if you are determined to try, though:

integer i;

default
{
     touch_start(integer num)
     {
          llSay( i, "This is a test on channel " + (string)i );
          ++i;
     }
}

When you get to 2,147,483,647, stop.  Then replace ++i with --i in the script and start all over again.  Keep clicking until you get to −2,147,483,648. 

  • Thanks 1

Share this post


Link to post
Share on other sites
Just now, Rolig Loon said:

No matter how you do it, if you have absolutely no clue what the channel number is, it will take a rather long time to test them all.  After all, there are 4,294,967,295 possibilities. if you are determined to try, though:


integer i;

default
{
     touch_start(integer num)
     {
          llSay( i, "This is a test on channel " + (string)i );
          ++i;
     }
}

When you get to 2,147,483,647, stop.  Then replace ++i with --i in the script and start all over again.  Keep clicking until you get to −2,147,483,648. 

Oh, I'm aware it's going to take a while. Thanks for this though!

Share this post


Link to post
Share on other sites
2 minutes ago, Rolig Loon said:

No matter how you do it, if you have absolutely no clue what the channel number is, it will take a rather long time to test them all.  After all, there are 4,294,967,295 possibilities. if you are determined to try, though:


integer i;

default
{
     touch_start(integer num)
     {
          llSay( i, "This is a test on channel " + (string)i );
          ++i;
     }
}

When you get to 2,147,483,647, stop.  Then replace ++i with --i in the script and start all over again.  Keep clicking until you get to −2,147,483,648. 

How do I know which channel it's currently on? Forgive me, i'm rather inexperienced with scripting.

Share this post


Link to post
Share on other sites

Do you have edit access to the other object's script? I'm guessing that either you don't, or if you do, that the script is not using a hard-coded value for the channel - but instead generating it randomly.

Also, do you know how this object will react when it hears something on the channel it listens to? Does it speak? I ask because if it emits its own text chat, you can potentially automate the process and use that as a shutoff signal - stopping when you get the right channel.

Share this post


Link to post
Share on other sites

Oh, I assumed that your other object is listening for a message on that channel, so it will tell you when you finally get there.  If you want to hear in the meantime, just add one more line:

integer i; 

default 
{
    touch_start(integer num)
    {
        llSay( i, "This is a test on channel " + (string)i );
        llSay( 0, "Sending a test on channel " + (string)i );
        ++i;
    }
}

For reference, by the way, there are 31.2 million seconds in a year.

Edited by Rolig Loon
Ooops. Slipped a decimal point. That's 31.2 million seconds
  • Thanks 1

Share this post


Link to post
Share on other sites
2 minutes ago, Fenix Eldritch said:

Do you have edit access to the other object's script? I'm guessing that either you don't, or if you do, that the script is not using a hard-coded value for the channel - but instead generating it randomly.

Also, do you know how this object will react when it hears something on the channel it listens to? Does it speak? I ask because if it emits its own text chat, you can potentially automate the process and use that as a shutoff signal - stopping when you get the right channel.

I do not have access to it, no. And the creator is no longer on SL, or i'd just ask. Yes, the object speaks on that channel.

Share this post


Link to post
Share on other sites

@Reyetta Claven, Fenix and I are getting at the same point, but he's less subtle than I am.  If you have absolutely no idea what channel the thing is listening on, it will take you the better part of a century to check just the positive ones at the rate of one every second.  Even if you automate the system, it's going to take a ridiculously long time.  That's why scripters typically have their scripts operate on a randomly selected channel.  It's almost impossible to guess, no matter how patient you are..

Share this post


Link to post
Share on other sites
7 minutes ago, Rolig Loon said:

@Reyetta Claven, Fenix and I are getting at the same point, but he's less subtle than I am.  If you have absolutely no idea what channel the thing is listening on, it will take you the better part of a century to check just the positive ones at the rate of one every second.  Even if you automate the system, it's going to take a ridiculously long time.  That's why scripters typically have their scripts operate on a randomly selected channel.  It's almost impossible to guess, no matter how patient you are..

I know it might be futile, but on the off chance it's a relatively low channel, i'm going to put a small amount of effort into figuring it out. If I don't find it after an hour of watching youtube in another tab while I try, then i'll give up. I'd feel really silly if it was under like, 2k and I didn't find it, which I realize is unlikely, but I've got to try.

Edited by Reyetta Claven

Share this post


Link to post
Share on other sites
2 minutes ago, Reyetta Claven said:

I'd feel really silly if it was under like, 2k and I didn't find it, which I realize is unlikely, but I've got to try.

That's cool.  In that case, my hope is that the scripter was lazy and picked a low positive integer.  😉

  • Thanks 1

Share this post


Link to post
Share on other sites

Hypothetically speaking, you could set up a system where you have a timer loop that automatically does the following:

  • close the previous listen handler
  • increment the target channel value
  • open a listen to that channel (to listen for any potential response)
  • speak the test message on the current channel
  • repeat

The idea is that you prime the test script by starting a 0, opening a listen, and then dropping into a loop governed by a timer event. That way, if you do manage to find that needle in the haystack, the target object will respond and your own test script's listen event will hear that response. Upon doing so, the test script will stop the timer and report to you the value of the channel it used.

And then for the negative values, just change the channel increment to a channel decrement as Rolig demonstrated above.

 

Edited by Fenix Eldritch
  • Thanks 1

Share this post


Link to post
Share on other sites
2 minutes ago, Rolig Loon said:
7 minutes ago, Reyetta Claven said:

I'd feel really silly if it was under like, 2k and I didn't find it, which I realize is unlikely, but I've got to try.

That's cool.  In that case, my hope is that the scripter was lazy and picked a low positive integer.  😉

Start from -2K, to catch those who are both lazy and clever.

  • Haha 1

Share this post


Link to post
Share on other sites
1 minute ago, Fenix Eldritch said:

Hypothetically speaking, you could set up a system where you have a timer loop that automatically does the following:

  • close the previous listen handler
  • increment the target channel value
  • open a listen to that channel (to listen for any potential response)
  • speak the test message on the current channel
  • repeat

The idea is that you prime the test script by starting a 0, opening a listen, and then dropping into a loop governed by a timer event. That way, if you do manage to find that needle in the haystack, the target object will respond and your own test script's listen event will hear that response. Upon doing so, the test script will stop the timer and repor to you the value of the channel it used.

 

 

Ah, now there's an idea. Thanks again. :)

Share this post


Link to post
Share on other sites

Speaking about a long time:

Checking one channel per second will take 136 years for all 2^32 channels.

4294967296   ÷   ( 3600   ×   24   ×   365 ) =‬ 136,19

If you make 100 per second that's still over a year but you need many open channels and many scripts running at the same time since you need to wait a little bit for an answer and that will be a few frames of 1/45th second.

Of course statistically you will have success at 50% of the channels but here you can be very lucky or very unlucky.

Well - luckily you are lucky 😎

Edited by Nova Convair

Share this post


Link to post
Share on other sites
8 minutes ago, Nova Convair said:

Checking one channel per second will take 136 years for all 2^32 channels.

4294967296   ÷   ( 3600   ×   24   ×   365 ) =‬ 136,19

Heh...I got lazy and didn't do the arithmetic to get the exact number.  Thanks.  😎

39 minutes ago, Rolig Loon said:

it will take you the better part of a century to check just the positive ones at the rate of one every second.

I think about this every once in a while when we get into those paranoid discussions about how to make a super-unguessable code for some in-world task.  It's fun to dream up tricky systems but really

iCode = -1 * (integer)llFrand(100000000.0);

is usually sufficient.

Share this post


Link to post
Share on other sites
6 hours ago, Reyetta Claven said:

Whelp! Lucky for me the scripter was lazy! Channel 999. :)

is pretty interesting this as it shows a human practice that is quite common

when left to ourselves we tend to pick numbers that are either familiar to us or resonate with us

like when asked to pick a number between 1 and 10, more people in western cultures pick 7 than any other number. More people in eastern cultures pick 8 than any other number

another example of picking resonating numbers. Back in the wayback days when the Numbers game was played in the USA, pick your own number between  000 and 999 and bet on it, then during his career the most picked number in some areas was the batting average of Babe Ruth the baseball player. Jackie Robinson's would also get a lot of play. So the Numbers game operators in the areas where this was prevalent, would reduce the winning payout on these numbers from the standard 500 for 1, down to 200 for 1. To deter/reduce people from playing these numbers. Not that these numbers are any more or less 'lucky', just that the cost to the operators is a lot higher when theses resonating numbers do come up as a winner. In the Numbers game the winning number was typically the last 3 numbers of the Dow Jones Index at close of business on some given day, which was published daily in the newspapers.  A interesting thing about this was that a lot of the small neighbourhood newspapers Business section in those days, would consist of 1 line of business news. Today's Dow Jones Index. If they didn't then their newspaper sales volumes would drop

scripterss are not a lot different when it comes to picking numbers. Like other people when given a large range and left to their own devices, they pick more easily read (resonating) numbers than they pick less easily read ones

with even numbers an added reason for scripters, to pick low resonating numbers, is that agents can type commands on positive channels which can be listened for by our script .  Which leads scripters to pick numbers that they feel resonate (are more convenient, more easily remembered, are imbued with the feelings of the audience) with the intended users.  999,  99, 888, 88, 111, 101, 33, 11, 8, 7, 1 etc

this tendency to pick low can bleed sometimes also into the negative numbers.  For example I have some neko ears which has a texture changer which listens for its HUD on -8. This no-modify cript checks for llGetOwner() and thats it.  So what happens is that any other script I own which also operates on -8, throws a runtime error in the neko ears script when the 'text' said on the channel is not a texture identifier known to the ears. Identifiers that the ears script should check for, but doesn't

when we pick channel numbers for our scripts then when our app is script-to-script only, then pick high non-resonating numbers, high meaning above minus 1 million. Moving our choices away from resonating numbers

which ever numbers we do choose  tho, then is always best to validate the 'text' received, just so that we don't have what happens to the neko ears script, happen to our scripts

 

 

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 167 days.

Please take a moment to consider if this thread is worth bumping.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...