Yonke Ming
Fat Laughing Hyena
Join date: 18 Jun 2005
Posts: 16
|
08-31-2005 11:19
This is for the little sign that listens to the main sign, or "The server". It's ignoring the server despite that I am telling it to listen to it. Any suggestions? key owner; key request; integer mode = TRUE; integer lines; integer gline; integer some =0; integer chan = 89123; list names; list tester; string note = "Admin"; string avname;
default { on_rez(integer start_param) { llResetScript(); } state_entry() { gline = 0; names = []; llListen(chan,"The Server",NULL_KEY,""); owner =llGetOwner(); llSetText("Reading Admin List. Please wait.",<1,1,1>,1); llSleep(1.0); request = llGetNumberOfNotecardLines(note); llSetText("Message to the Forest Rangers:\n Not set",<1,1,1>,1); }
listen(integer channel, string name, key id, string message) { llSay(0, "Picked up a message!"); some = llListFindList(tester, names); tester = [llKey2Name(id)]; llSetText("Message to the Forest Rangers:\n"+message+"",<1,1,1>,1); some = 0; } touch_start(integer num_detected) { key avatar = llDetectedKey(0); some = llListFindList(names, tester); tester = [llKey2Name(avatar)]; if (some != -1) { if (mode == FALSE) { llSetText(" ",<1,1,1>,1); state off; } else { llSay(0, "Listens are OFF (Text still shows)"); state off; } } else if (some == -1) { llSay(0, "Error."); } } dataserver(key query_id, string data) { if (request == query_id) { //Searches for the admin names here from the notecard. integer i = 0; lines = (integer)data; string test = "null"; if (data != EOF) { // not at the end of the notecard llSay(0, data); // output the line request = llGetNotecardLine("Admin", gline); // request next line names = names + [data]; gline++; // increase line count } } } }
state off { touch_start(integer num_detected) { key avatar = llDetectedKey(0); if (avatar == owner); { llSetText("Message to the Forest Rangers is:\nNot Set.",<1,1,1>,1); state default; } } on_rez(integer start_param) { llResetScript(); } }
_____________________
I like Hyenas...
...Especially the soft, fat, squishy, and silly ones!
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
08-31-2005 11:34
Are you changing state before the server sends out the chat message? If I remember right, listens get removed automatically on state changes, so if you change state, you'll have to set up the listener again.
|
Yonke Ming
Fat Laughing Hyena
Join date: 18 Jun 2005
Posts: 16
|
08-31-2005 17:01
The listen gets set up in state_entry. So it should ALWAYS come back on.
Edit: After it comes back from the Off state.
_____________________
I like Hyenas...
...Especially the soft, fat, squishy, and silly ones!
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
08-31-2005 17:24
OK, and I'm assuming that based on the set texts you're sure that the script actually is in the default state and not the off state when the server says whatever it says. This is obvious syuff, but it never hurts to double check - do you have the name of the server object right? Are you sure they're both using the same channel? Are you sure they're not too far apart? llSay has a range of 20m, and llShout is I think 100m (going from memory here).
|
a lost user
Join date: ?
Posts: ?
|
08-31-2005 18:08
From: someone llListen(chan,"The Server",NULL_KEY,""  ; Ok.. you need to make sure the server is sending on the correct channel, you also need to ensure that the object, which is the server, is actually called The Server yes it IS case sensitive and if you have any extra spaces before, after or between "The" and "Server" it will also fail to work. if you had the server then it won't work, it needs to be The Server to be heard by this listen. Have you tried it without defining the name for the listen? Try that first, if it still isn't heard, then it has to be something wrong with the server.. either sending on the wrong channel or just not sending at all.
|