Jump to content

Dialog, PikkuBot, llInstantmessage....Where's my Advil...


Kiran Steamweaver
 Share

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

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

Recommended Posts

So I'm programming a customer support and advertising board for my radio station and have gotten to the point that I'm stuck on getting this command properly translated.


The endstate I'm looking for is this:

This dialog will be using a PikkuBot as a go-between to communicate with The radio station staff group specifically for the purpose of requesting Customer Support.

In practice, it will be:

  1. User touches board
  2. Board provides menu
  3. User selects "Contact CS"
  4. Board collects UUID, then sends 3 messages to PikkuBot
  5. PikkuBot relays 1st message, which goes directly to the Staff Group chat, stating a request for CS has been placed, gives the Avatar name that requested.
  6. PikkuBot relays 2nd message, IMing requesting avatar directly that it is attempting to contact Customer Support and if no response is received please try again later.
  7. PikkuBot relays 3rd message, directly to the owner, me, stating "CS Request: (avatar name)" So I can perform a follow-up later. (This could be replaced by the board contacting me directly?)


Currently I'm using llInstantMessage to supply commands to the Bot.

My command looks something like:

 else if (message == "Request CS")
                llInstantMessage( (key)"PikkuBotUUID", "@Staff group UUID" ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" );

 After a few hours of head scratching I'm at a complete loss as to how to pull the UUID of the avtar that touched the board, ideally translate that UUID into a URL, and inject that URL into the string being sent to the PikkuBot to be relayed to the group chat.


The IM that needs to be sent to the PikkuBot needs to be in the format of "@(GroupUUID) (Message)"

Failing the URL bit I would settle for just the name itself being transmitted, I'm not afraid of the search bar. But can this be done at all? I think If I can get some pointers on how to get the first message relay formatted correctly I can apply that to the other two on my own.

Link to comment
Share on other sites

I've no idea what this means "pull the UUID of the avtar that touched the board, ideally translate that UUID into a URL" as there is no relation an has never been between an avatar UUID and any URL.

In respect to UUID, my advice would be that if you don't know how to retrieve an agent UUID on touch and stuff in a message, don't spend a single hour more. Order your script from a friendly professional in your neighborhood :)

Link to comment
Share on other sites

By "URL" I was referring to the Avatar name that pops up in chat that you can click to bring up that Avatar's profile within the viewer.


I understand that the command I'm looking for has something to do with the multiple commands that draw the UUID. Such as llKey2Name I'm just held up on actually pulling that info and injecting it into an llInstantMessage string That the bot can understand.


I'm not going to waste "a friendly professional in my neighborhood"s time, or mine waiting on them, for something that simple.

The reason I'm even asking is because I'm interested in learning and coding it myself.

Link to comment
Share on other sites

I'm not sure I understand what you're trying to do, but it sounds as if you're just asking how to grab an av's UUID or username when s/he touches your object.  In that case, you simply want either

llDetectedKey(0) or

llDetectedName(0),

but maybe I'm missing some nuance here.

  • Like 1
Link to comment
Share on other sites

Hey Rolig! Been awhile! =)

So my basic intention is to, at the end of the day, have a button on the dialog menu that, upon pressing a button it sends an IM to a Bot which will relay the message along to where it needs to go, in this case a group chat.


The syntax the PikkuBot understands to chat with a group, for example, is receiving an IM that states

@[GroupUUID] [Message to send]

 

Where I'm stuck is figuring out how to make the menu dialog option inject the name (preferrably clickable to their profile, but either way) of the avatar pressing the button into the llInstantMessage string being sent to the Bot.

Link to comment
Share on other sites

Hi again.  Yeah, I get that, but I don't understand what the problem is. Assuming that you are sending that IM from your touch_start or touch_end event, all you have to do to send a UUID is write

llInstantMessage("To_whom_UUID", llDetectedKey(0));

To send the avatar's username, write

llInstantMessageI("To_whom_UUID", llDetectedName(0));

You can stuff any other things you want into your message too, but that's how you send a UUID or name. On the receiving end, your script probably needs to typecast the UUID back to type (key), because it was sent as a string.  Otherwise, there's no magic here.  Again, unless I'm missing something.

Link to comment
Share on other sites

I think the hang-up is the specific format the message needs to be in to the PikkuBot. I'm formatting the message correctly in string text but if I try to punch in llDetectedName, it doesn't actually return the name in the IM to the bot, and the bot outputs "llDetectedName(0)" rather than the name.

else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately: llDetectedName(0)");

 

However, if I close the quotations on the string, I get a syntax error.

else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" llDetectedName(0));

 BUT WAIT WAIT WAIT! Understanding I'm probably an idiot, I tried by throwing a + in there.

else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" + llDetectedName(0));

 And the Bot outputs:

" ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:00000000-0000-0000-0000-000000000000"

 So that puts me closer than I've been yet. Now to figure out why it's returning all zeros rather than an actual UUID

Link to comment
Share on other sites

OK, so the bot is evidently expecting a UUID, not a name.  That's why the end of the received string is NULL_KEY.  So send it llDetectedKey(0) instead of llDetectedName(0).  The syntax of your IM (your last try) is OK other than that.  If your bot script is at all smart, it will accept the transmitted UUID as a string and print it out correctly in the user message.

Link to comment
Share on other sites

else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" +  llDetectedKey(0));

 In the script editor I get (20, 249)  : ERROR : Type mismatch

 

Entire script:

integer CHANNEL = -21342;    // dialog channellist MENU_MAIN =["Info NC", "Request CS", "Group Invite"];    // the main menukey detected;integer handle;default {    touch_start(integer total_number) {        detected = llDetectedKey(0);        handle = llListen(CHANNEL, "", detected, "");    // listen for dialog answers (from multiple users)        llDialog(detected, "Welcome to RUFFNEK Radio!", MENU_MAIN, CHANNEL);    // present dialog on click    }    listen(integer channel, string name, key id, string message) {        if (llListFindList(MENU_MAIN,[message]) != -1)    // verify dialog choice        {            if (message == "Info NC")                llGiveInventory(detected, "RUFFNEK Radio");            else if (message == "Group Invite")                 llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "/00000000-0000-0000-0000-000000000000 I got the message!" + llDetectedName(0)); // Ignore this. Waiting to fix the CS before I fix this crap.            else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" +  llDetectedKey(0));        }        else            llSay(0, name + " picked invalid option '" + llToLower(message) + "'.");    // not a valid dialog choice        llListenRemove(handle);    }}

 

Link to comment
Share on other sites

That's fine.  So send (string)llDetectedKey(0).  LSL is a little quirky about when you have to typecast variables explicitly and when you can get away with letting the compiler do it.  This is evidently one of those places where you have to tell it "Hey, I know llDetectedKey is a (key) variable, but I need to send it as a string."  So do it.

Link to comment
Share on other sites

Ahhh... should've said so to begin with... lol

The agent profile URL is formed like this:

string url = "http://world.secondlife.com/" + (string)agent_uuid + "/";

where agent_uuid is a global variable which value you assign in the touch event as agent_uuid = llDetectedKey(0);

and then you'd need to send anhttp_request and process it via http_response event.

There is some info that you can retrieve from the profile and some that you cannot (whatever hides behind meta-tags). You can use API's from http://www.sluniverse.com/php/vb/scripting/72302-slnode-lsl-parsers-more.html to get some info that is not accessible directly

You'd never be wasting professional's time for as long as you pay the price :)

Link to comment
Share on other sites

Thank you so much for your help up to this point.

 

else if (message == "Request CS")                llInstantMessage( (key)"
", "@
ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" + (string)llDetectedKey(0) );

 

Returns the same result.

ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:00000000-0000-0000-0000-000000000000

 

Link to comment
Share on other sites

I figured it out! Partly...

 

My script was already defining llDetectedKey as "detected"

 

else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:" + (string)detected);

 

Returns:

ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately:00000000-0000-0000-0000-000000000000

 

It returns only the UUID and doesn't transl- wait...

...

 

GOT IT!

 

else if (message == "Request CS")                llInstantMessage( (key)"00000000-0000-0000-0000-000000000000", "@00000000-0000-0000-0000-000000000000 ATTENTION RUFFNEK Staff! I have received a request for Customer Support! Please contact this user immediately: secondlife:///app/agent/" + (string)detected + "/about")

 Returns a clickable profile link within the viewer! WIN!

 

 

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...