touch_start(integer number)
{
AVKey = llDetectedKey(0);
AVName = llDetectedName(0);
llDialog(AVKey,"\nPlease choose an option:\n",["Add", "Change", "List"],channel);
}
listen(integer channel, string name, key id, string message)
{
if (message == "List"

requestid = llHTTPRequest("http://www.mydebitcredit.com/php/list_registered_students.php",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],"AVName=" + AVName + "&Key=" + (string)AVKey );
}
else if (message == "Change"

llInstantMessage(AVKey, "What do you want to change your NID, Twitter account or email address? \nType either Nid, Twitter or Email then a space and then type your new NID, Twitter Account or Email Address. \nRemember to start your chat with /2021 and a space, so for example to change your e-mail type the following:\n/2021 Email [email]shornik@bus.ucf.edu[/email]"

llListen(2021,"", AVKey, ""

}
else if (message == "Add"

llInstantMessage(AVKey, "Please enter the following information by typing it in the chat window.\n Begin the chat with /2021 followed by a space, your NID,Twitter Account, and Email. \n Seperate each of the following with a comma: \n Your NID, Twitter account name (if you don't have one leave a blank space), and your email address. \n Please don't leave any spaces between them so for example what you type might look like this: \n /2021 sh123456,acg2021,shornik@bus.ucf.edu"

llListen(2021,"", AVKey, ""

}
else if (llGetSubString(message,0,6) == "Twitter"

ChangeData = llParseString2List(message,[" "],[""]);
twitter = llList2String(ChangeData,1);
twitter = llStringTrim(twitter,STRING_TRIM);
update = llGetSubString(message,0,6);
requestid = llHTTPRequest("http://www.mydebitcredit.com/php/update_registered_students.php",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],"AVName=" + AVName + "&Key=" + (string)AVKey + "&TwitName=" + twitter + "&changed=" + update);
}
else if (llGetSubString(message,0,2) == "Nid"

llSay(0, "Im in the Nid Change"

ChangeData = llParseString2List(message,[" "],[""]);
NID = llList2String(ChangeData,1);
NID = llStringTrim(NID,STRING_TRIM);
update = llGetSubString(message,0,2);
requestid = llHTTPRequest("http://www.mydebitcredit.com/php/update_registered_students.php",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],"AVName=" + AVName + "&Key=" + (string)AVKey + "&Nid=" + NID + "&changed=" + update);
}
else if (llGetSubString(message,0,4) == "Email"

ChangeData = llParseString2List(message,[" "],[""]);
Email = llList2String(ChangeData,1);
Email = llStringTrim(Email,STRING_TRIM);
update = llGetSubString(message,0,4);
requestid = llHTTPRequest("http://www.mydebitcredit.com/php/update_registered_students.php",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],"AVName=" + AVName + "&Key=" + (string)AVKey + "&Email=" + Email + "&changed=" + update);
}
else {
StudentData = llParseStringKeepNulls(message,[","],[""]);
NID = llList2String(StudentData,0);
NID = llStringTrim(NID,STRING_TRIM);
twitter = llList2String(StudentData,1);
twitter = llStringTrim(twitter,STRING_TRIM);
Email = llList2String(StudentData,2);
Email = llStringTrim(Email,STRING_TRIM);
llInstantMessage(AVKey, "NID" + NID + "Twitter: " + twitter + "Email: " + Email);
requestid = llHTTPRequest("http://www.mydebitcredit.com/php/register_students.php",
[HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
"Nid=" + NID + "&AVName=" + AVName + "&Key=" + (string)AVKey + "&TwitName=" + twitter + "&Email=" + Email);
}