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!