Jump to content

Kerfluff

Resident
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Darkie, Thanks a ton! I didn't know you could change a listen's channel it was listening on from within the listen event itself. I went ahead and remade the script along my original, overly simple, overly un-secure format, just to see how it all worked. Sender: default{ state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { llSay(3, (string)llDetectedKey(0)); llSleep(1.0); llSay(6, "1225"); }} Reciever: integer giVerificationPending = 0;integer giListener;default{ state_entry() { llSay(0, "Hello, Avatar!"); giListener = llListen( 3, "", NULL_KEY, "" ); } listen( integer channel, string name, key id, string inputstring ) { llListenRemove(giListener); key owner = llGetOwnerKey(id); if ( (key)inputstring == owner ) { giVerificationPending = 1; llSay(0, "I know you clicked the passcode and not someone else! Now checking passcode."); giListener = llListen( 6, "", NULL_KEY, "" ); llSetTimerEvent(7); } else if (giVerificationPending && inputstring == "1225" ) { llSay(0, "passcode verified."); giVerificationPending = 0; state verified; } else { llSay(0, "passcode error."); giVerificationPending = 0; } } timer() { llSetTimerEvent(0); giVerificationPending = 0; llListenRemove(giListener); llSay(0, "I never recieved a pass code!"); } } state verified { state_entry() { llSay(0, "I am now verified!"); } } This worked, though I just did it only because i wanted to recreate a barebones version to see how you did it. Yours is way better due to the extra security from the channel-based-off-of-UUID solution (among many other things!) It also helped me clean up some if statements and I even learned some good coding practices by finally now knowing where to remove the listener! Thanks again!
  2. Hi! I'm new to scripting, and I am trying to work with two objects, one an authenticator, and one a passkey. I want the listen handler to verify the UUID of the owner through a string, like a passcode. When the first string is verified, i want it to then read the other data. The part where it checks the UUID works, but it keeps checking the UUID instead of the second string, like I want. Here's my code: Sender: default { state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { llSay(3, (string)llDetectedKey(0)); llSay(3, "1225"); } } Receiver: default { state_entry() { llSay(0, "Hello, Avatar!"); llListen( 3, "", NULL_KEY, "" ); } listen( integer channel, string name, key id, string inputstring ) { key owner = llGetOwnerKey(id); if ( (key)inputstring == owner ) { llSay(0, "I know you clicked the passcode and not someone else! Now checking passcode."); if ( inputstring == "1225" ) llSay(0, "passcode verified."); else llSay(0, "passcode error."); } } } Ideally i'd like for the Reciever script to listen for the UUID, and if the UUID of the person who clicked the Sender object matches the owner of the Reciever object, then it will proceed to listen for the next string(s). Thanks a ton for reading, and any help anyone could give would be super appreciated!
×
×
  • Create New...