Middlebury

Terra Ideology Test

The following code is for the Political Form script (first of 3 scripts used in the ideology test object)

//Brendan Smith 8/24/08
//Middlebury College Digital Media Department
//Political questionnaire script that gives the user a colored Political Indicator (halo) to wear based on their answers.
//This script coordinates with the Economic and Social question scripts to perform the questionnaire. The two helper scripts are used to ask the questions and then the answers to those questions are recorded in this script in the two variables polEcon and polSoc. When all of the questions have been asked this script gives the user the Political Indicator halo that matches their values for polEcon and polSoc.
integer polEcon = 0;
integer polSoc = 0;
key user;
list l = ["Strongly Disagree", "Disagree", "Unsure", "Agree", "Strongly Agree"];
string texture_on= "Political Test Sign2";
string texture_off= "Political Test Sign";

integer currentquestion;

//Gives the appropriate colored Political Indicator based on the score of the political questionnaire
giveIndicator() {
//llSay(0, "Error econ:" + (string)polEcon + " social:" + (string)polSoc);

if (polEcon == 0 && polSoc == 0) {
//return 0;
llGiveInventory(user,"Political Indicator Black");
}else if (polEcon >= -24 && polEcon < -18 && polSoc >= -24 && polSoc < -18) {
//return 1;
llGiveInventory(user,"Political Indicator 1");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= -24 && polSoc < -18) {
//return 2;
llGiveInventory(user,"Political Indicator 2");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= -24 && polSoc < -18) {
//return 3;
llGiveInventory(user,"Political Indicator 3");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= -24 && polSoc < -18) {
//return 4;
llGiveInventory(user,"Political Indicator 4");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= -24 && polSoc < -18) {
//return 5;
llGiveInventory(user,"Political Indicator 5");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= -24 && polSoc < -18) {
//return 6;
llGiveInventory(user,"Political Indicator 6");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= -24 && polSoc < -18) {
//return 7;
llGiveInventory(user,"Political Indicator 7");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= -24 && polSoc < -18) {
//return 8;
llGiveInventory(user,"Political Indicator 8");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= -18 && polSoc < -12) {
//return 9;
llGiveInventory(user,"Political Indicator 9");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= -18 && polSoc < -12) {
//return 10;
llGiveInventory(user,"Political Indicator 10");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= -18 && polSoc < -12) {
//return 11;
llGiveInventory(user,"Political Indicator 11");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= -18 && polSoc < -12) {
//return 12;
llGiveInventory(user,"Political Indicator 12");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= -18 && polSoc < -12) {
//return 13;
llGiveInventory(user,"Political Indicator 13");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= -18 && polSoc < -12) {
//return 14;
llGiveInventory(user,"Political Indicator 14");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= -18 && polSoc < -12) {
//return 15;
llGiveInventory(user,"Political Indicator 15");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= -18 && polSoc < -12) {
//return 16;
llGiveInventory(user,"Political Indicator 16");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= -12 && polSoc < -6) {
//return 17;
llGiveInventory(user,"Political Indicator 17");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= -12 && polSoc < -6) {
//return 18;
llGiveInventory(user,"Political Indicator 18");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= -12 && polSoc < -6) {
//return 19;
llGiveInventory(user,"Political Indicator 19");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= -12 && polSoc < -6) {
//return 20;
llGiveInventory(user,"Political Indicator 20");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= -12 && polSoc < -6) {
//return 21;
llGiveInventory(user,"Political Indicator 21");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= -12 && polSoc < -6) {
//return 22;
llGiveInventory(user,"Political Indicator 22");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= -12 && polSoc < -6) {
//return 23;
llGiveInventory(user,"Political Indicator 23");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= -12 && polSoc < -6) {
//return 24;
llGiveInventory(user,"Political Indicator 24");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= -6 && polSoc < 0) {
//return 25;
llGiveInventory(user,"Political Indicator 25");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= -6 && polSoc < 0) {
//return 26;
llGiveInventory(user,"Political Indicator 26");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= -6 && polSoc < 0) {
//return 27;
llGiveInventory(user,"Political Indicator 27");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= -6 && polSoc < 0) {
//return 28;
llGiveInventory(user,"Political Indicator 28");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= -6 && polSoc < 0) {
//return 29;
llGiveInventory(user,"Political Indicator 29");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= -6 && polSoc < 0) {
//return 30;
llGiveInventory(user,"Political Indicator 30");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= -6 && polSoc < 0) {
//return 31;
llGiveInventory(user,"Political Indicator 31");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= -6 && polSoc < 0) {
//return 32;
llGiveInventory(user,"Political Indicator 32");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= 0 && polSoc < 6) {
//return 33;
llGiveInventory(user,"Political Indicator 33");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= 0 && polSoc < 6) {
//return 34;
llGiveInventory(user,"Political Indicator 34");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= 0 && polSoc < 6) {
//return 35;
llGiveInventory(user,"Political Indicator 35");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= 0 && polSoc < 6) {
//return 36;
llGiveInventory(user,"Political Indicator 36");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= 0 && polSoc < 6) {
//return 37;
llGiveInventory(user,"Political Indicator 37");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= 0 && polSoc < 6) {
//return 38;
llGiveInventory(user,"Political Indicator 38");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= 0 && polSoc < 6) {
//return 39;
llGiveInventory(user,"Political Indicator 39");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= 0 && polSoc < 6) {
//return 40;
llGiveInventory(user,"Political Indicator 40");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= 6 && polSoc < 12) {
//return 41;
llGiveInventory(user,"Political Indicator 41");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= 6 && polSoc < 12) {
//return 42;
llGiveInventory(user,"Political Indicator 42");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= 6 && polSoc < 12) {
//return 43;
llGiveInventory(user,"Political Indicator 43");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= 6 && polSoc < 12) {
//return 44;
llGiveInventory(user,"Political Indicator 44");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= 6 && polSoc < 12) {
//return 45;
llGiveInventory(user,"Political Indicator 45");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= 6 && polSoc < 12) {
//return 46;
llGiveInventory(user,"Political Indicator 46");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= 6 && polSoc < 12) {
//return 47;
llGiveInventory(user,"Political Indicator 47");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= 6 && polSoc < 12) {
//return 48;
llGiveInventory(user,"Political Indicator 48");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= 12 && polSoc < 18) {
//return 49;
llGiveInventory(user,"Political Indicator 49");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= 12 && polSoc < 18) {
//return 50;
llGiveInventory(user,"Political Indicator 50");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= 12 && polSoc < 18) {
//return 51;
llGiveInventory(user,"Political Indicator 51");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= 12 && polSoc < 18) {
//return 52;
llGiveInventory(user,"Political Indicator 52");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= 12 && polSoc < 18) {
//return 53;
llGiveInventory(user,"Political Indicator 53");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= 12 && polSoc < 18) {
//return 54;
llGiveInventory(user,"Political Indicator 54");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= 12 && polSoc < 18) {
//return 55;
llGiveInventory(user,"Political Indicator 55");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= 12 && polSoc < 18) {
//return 56;
llGiveInventory(user,"Political Indicator 56");

}else if (polEcon >= -24 && polEcon < -18 && polSoc >= 18 && polSoc <= 24) {
//return 57;
llGiveInventory(user,"Political Indicator 57");
}else if (polEcon >= -18 && polEcon < -12 && polSoc >= 18 && polSoc <= 24) {
//return 58;
llGiveInventory(user,"Political Indicator 58");
}else if (polEcon >= -12 && polEcon < -6 && polSoc >= 18 && polSoc <= 24) {
//return 59;
llGiveInventory(user,"Political Indicator 59");
}else if (polEcon >= -6 && polEcon < 0 && polSoc >= 18 && polSoc <= 24) {
//return 60;
llGiveInventory(user,"Political Indicator 60");
}else if (polEcon >= 0 && polEcon < 6 && polSoc >= 18 && polSoc <= 24) {
//return 61;
llGiveInventory(user,"Political Indicator 61");
}else if (polEcon >= 6 && polEcon < 12 && polSoc >= 18 && polSoc <= 24) {
//return 62;
llGiveInventory(user,"Political Indicator 62");
}else if (polEcon >= 12 && polEcon < 18 && polSoc >= 18 && polSoc <= 24) {
//return 63;
llGiveInventory(user,"Political Indicator 63");
}else if (polEcon >= 18 && polEcon <= 24 && polSoc >= 18 && polSoc <= 24) {
//return 64;
llGiveInventory(user,"Political Indicator 64");

}else{

llSay(0, "Error econ:" + (string)polEcon + " social:" + (string)polSoc);
llGiveInventory(user,"Political Indicator White");
//return 99;
}
}

//Default state asks the first question through a dialog window.
default
{


//When entering the default state set the prims texture to the blue background, set currentquestion to 1, and return the polEcon and polSoc variables back to 0.
state_entry()
{

llSetTexture(texture_off,ALL_SIDES);
//llSay(0, "Set to Blue");
currentquestion = 1;
polEcon = 0;
polSoc = 0;
}

//When the prim is touched the user's UID is saved, the prim's texture is changed to the red "do not touch" sign, a message is sent to the Econ Questions script and this script is sent to the econanswer state.
touch_end(integer num_detected)
{
user = llDetectedKey(0);
llSetTexture(texture_on,ALL_SIDES);
//llSay(0, "Set to Red");
state econanswer;
}
}

//This state updates currentquestion counter, which makes sure that the questions are asked in order, and then starts the next question by queing the correct question script and then placing this script in the appropriate matching answer state.
state betweenquestions
{
state_entry()
{
if (currentquestion==1)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc1", NULL_KEY);
state socanswer;
}else if(currentquestion==2)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ2", NULL_KEY);
state econanswer;
}else if(currentquestion==3)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc2", NULL_KEY);
state socanswer;
}else if(currentquestion==4)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ3", NULL_KEY);
state econanswer;
}else if(currentquestion==5)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc3", NULL_KEY);
state socanswer;
}else if(currentquestion==6)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ4", NULL_KEY);
state econanswer;
}else if(currentquestion==7)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc4", NULL_KEY);
state socanswer;
}else if(currentquestion==8)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ5", NULL_KEY);
state econanswer;
}else if (currentquestion==9)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc5", NULL_KEY);
state socanswer;
}else if(currentquestion==10)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ6", NULL_KEY);
state econanswer;
}else if(currentquestion==11)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc6", NULL_KEY);
state socanswer;
}else if(currentquestion==12)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ7", NULL_KEY);
state econanswer;
}else if(currentquestion==13)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc7", NULL_KEY);
state socanswer;
}else if(currentquestion==14)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ8", NULL_KEY);
state econanswer;
}else if(currentquestion==15)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc8", NULL_KEY);
state socanswer;
}else if(currentquestion==16)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ9", NULL_KEY);
state econanswer;
}else if (currentquestion==17)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc9", NULL_KEY);
state socanswer;
}else if(currentquestion==18)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ10", NULL_KEY);
state econanswer;
}else if(currentquestion==19)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc10", NULL_KEY);
state socanswer;
}else if(currentquestion==20)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ11", NULL_KEY);
state econanswer;
}else if(currentquestion==21)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc11", NULL_KEY);
state socanswer;
}else if(currentquestion==22)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "econ12", NULL_KEY);
state econanswer;
}else if(currentquestion==23)
{
currentquestion++;
llMessageLinked(LINK_THIS , 0, "soc12", NULL_KEY);
state socanswer;
}else if(currentquestion==24)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "MainReset");
state sendItem;
}
}
}

//This state is used to record the answers to the econ questions, which update the polEcon variable. After the answer is recorded this script is sent to the betweenquestions state in order to initiate the next question
state econanswer
{

link_message(integer sender_num, integer num, string str, key id)
{
if( str=="econminustwo" )
{
polEcon--;
polEcon--;
state betweenquestions;
}
else if( str=="econminus" )
{
polEcon--;
state betweenquestions;
}
else if( str=="econnone" )
{
state betweenquestions;
}
else if( str=="econplus" )
{
polEcon++;
state betweenquestions;
}
else if( str=="econplustwo" )
{
polEcon++;
polEcon++;
state betweenquestions;
} else if( str=="reset")
{
//llSay(0, "MainReset");
llResetScript();
}
}
}

//This state is used to record the answers to the soc questions, which update the polSoc variable. After the answer is recorded this script is sent to the betweenquestions state in order to initiate the next question
state socanswer
{

link_message(integer sender_num, integer num, string str, key id)
{

if( str=="socminustwo" )
{
polSoc--;
polSoc--;
state betweenquestions;
}
else if( str=="socminus" )
{
polSoc--;
state betweenquestions;
}
else if( str=="socnone" )
{
state betweenquestions;
}
else if( str=="socplus" )
{
polSoc++;
state betweenquestions;
}
else if( str=="socplustwo" )
{
polSoc++;
polSoc++;
state betweenquestions;
}else if(str=="reset")
{
//llSay(0, "MainReset");
llResetScript();
}
}
}


//Sends the participant an item based on their answers
state sendItem
{
state_entry()
{
//llGiveInventory(user,"Political Indicator");
giveIndicator();

//llRezObject("Political Indicator v1.2", llList2Vector(llGetObjectDetails(user, [OBJECT_POS]), 0) + <0.0,0.0,0.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0>, findNumber());
llInstantMessage(user, "Here is your Political Indicator. To wear it, simply locate the Political Indicator inside the Objects folder of your Inventory and drag it onto your avatar.");
llResetScript();
}
}


The following code is for the Economic Questions script (second of 3 scripts used in the ideology test object)

//Brendan Smith @ Middlebury College 8/17/08
//This script works with the Political Form Script to ask political questions to users so that they can recieve a color coded Political Indicator. This script houses all of the economics questions which are asked to the player when the Political Form script requests it. The answers are then sent back to the Political Form script where variables are updated to keep track of the users answers and eventually dictate the color of their Political Indicator.
list l = ["Strongly Disagree", "Disagree", "Unsure", "Agree", "Strongly Agree"];
//The CHANNEL variable must be set to a different value for each ideology test in the area or the answers that are broadcasted from the dialogue boxes will interfere with each other
integer CHANNEL = -1;
integer eq1;
integer eq2;
integer eq3;
integer eq4;
integer eq5;
integer eq6;
integer eq7;
integer eq8;
integer eq9;
integer eq10;
integer eq11;
integer eq12;

key euser;

//This default state is where this script stays when a question is not being asked. Once a question is asked the script moves to that question's state where the question is given, the answer is recorded and then communicated to the Political Form script. If a user touches the prim during the political questionnaire then the questionnaire is cancelled and all three scripts are reset by sending a prim wide "reset" message.
default
{
touch_end(integer num_detected)
{
euser = llDetectedKey(0);
state equestion1;
}

}


state betweeneconquestions
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}

link_message(integer sender_num, integer num, string str, key id)
{
if( str=="econ2" )
{
state equestion2;
}
else if( str=="econ3" )
{
state equestion3;
}
else if( str=="econ4" )
{
state equestion4;
}
else if( str=="econ5" )
{
state equestion5;
}
else if( str=="econ6" )
{
state equestion6;
}
else if( str=="econ7" )
{
state equestion7;
}
else if( str=="econ8" )
{
state equestion8;
}
else if( str=="econ9" )
{
state equestion9;
}
else if( str=="econ10" )
{
state equestion10;
}
else if( str=="econ11" )
{
state equestion11;
}
else if( str=="econ12" )
{
state equestion12;
}else if( str=="reset")
{
//llSay(0, "EconReset");
llResetScript();
}
}
}

//Question 1 w/dialogue box and listener
state equestion1
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}

state_entry()
{
eq1 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "1. A state's tax system should help eliminate inequality, provide adequate resources for important government programs, and eliminate any tax loopholes that would keep wealthy individuals and corporations from making substantial contributions to the tax base.", l, CHANNEL);
}


//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq1);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq1);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq1);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq1);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq1);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 2 w/dialoge box and listener
state equestion2
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq2 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "3. Because corporations cannot be trusted to voluntarily protect the environment, they require regulation.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq2);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq2);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq2);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq2);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq2);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 3 w/dialoge box and listener
state equestion3
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq3 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "5. Controlling inflation is more important than controlling unemployment.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq3);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq3);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq3);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq3);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq3);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 4 w/dialoge box and listener
state equestion4
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq4 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "7. \"From each according to his ability, to each according to his need\", is a fundamentally good idea.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq4);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq4);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq4);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq4);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq4);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 5 w/dialoge box and listener
state equestion5
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq5 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "9. Protectionism is often necessary in trade.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq5);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq5);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq5);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq5);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq5);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 6 w/dialoge box and listener
state equestion6
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq6 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "11. Those with the ability to pay should have the right to higher standards of medical care.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq6);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq6);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq6);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq6);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq6);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 7 w/dialoge box and listener
state equestion7
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq7 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "13. A genuine free market requires restrictions on the ability of predator multinationals to create monopolies.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq7);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq7);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq7);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq7);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq7);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 8 w/dialoge box and listener
state equestion8
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq8 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "15. The freer the market, the freer the people.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq8);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq8);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq8);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq8);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq8);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}
}
}

//Question 9 w/dialoge box and listener
state equestion9
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq9 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "17. All government barriers to international free trade should be eliminated.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq9);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq9);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq9);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq9);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq9);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}
}
}
//Question 10 w/dialoge box and listener
state equestion10
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq10 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "19. It's not the government's job to reduce the income difference between the rich and the poor.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq10);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq10);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq10);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq10);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq10);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}
}
}
//Question 11 w/dialoge box and listener
state equestion11
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq11 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "21. Every person has the obligation to take care of his or her own needs, without government interference.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq11);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq11);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq11);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq11);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq11);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}
}
}
//Question 12 w/dialoge box and listener
state equestion12
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "EconReset");
llResetScript();
}
state_entry()
{
eq12 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(euser, "23. Individuals should be able to invest portions of government pensions in their own way, which might allow them to make more money for their retirement, even if it would involve greater risk.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(eq12);
llMessageLinked(LINK_THIS , 0, "econminustwo", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(eq12);
llMessageLinked(LINK_THIS , 0, "econminus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(eq12);
llMessageLinked(LINK_THIS , 0, "econnone", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(eq12);
llMessageLinked(LINK_THIS , 0, "econplus", NULL_KEY);
state betweeneconquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(eq12);
llMessageLinked(LINK_THIS , 0, "econplustwo", NULL_KEY);
state betweeneconquestions;
}
}
}


The following code is for the Social Questions script (third of 3 scripts used in the ideology test object)

//Brendan Smith @ Middlebury College 8/17/08
//This script works with the Political Form Script to ask political questions to users so that they can recieve a color coded Political Indicator. This script houses all of the social questions which are asked to the player when the Political Form script requests it. The answers are then sent back to the Political Form script where variables are updated to keep track of the users answers and eventually dictate the color of their Political Indicator.
list l = ["Strongly Disagree", "Disagree", "Unsure", "Agree", "Strongly Agree"];
//The CHANNEL variable must be set to a different value for each ideology test in the area or the answers that are broadcasted from the dialogue boxes will interfere with each other
integer CHANNEL = -1;
integer sq1;
integer sq2;
integer sq3;
integer sq4;
integer sq5;
integer sq6;
integer sq7;
integer sq8;
integer sq9;
integer sq10;
integer sq11;
integer sq12;
key suser;

//This default state is where this script stays when a question is not being asked. Once a question is asked the script moves to that question's state where the question is given, the answer is recorded and then communicated to the Political Form script. If a user touches the prim during the political questionnaire then the questionnaire is cancelled and all three scripts are reset by sending a prim wide "reset" message.
default
{
touch_end(integer num_detected)
{
suser = llDetectedKey(0);
}

link_message(integer sender_num, integer num, string str, key id)
{
if( str=="soc1" )
{
state squestion1;
}
}
}

state betweensocquestions
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}

link_message(integer sender_num, integer num, string str, key id)
{
if( str=="soc2" )
{
state squestion2;
}
else if( str=="soc3" )
{
state squestion3;
}
else if( str=="soc4" )
{
state squestion4;
}
else if( str=="soc5" )
{
state squestion5;
}
else if( str=="soc6" )
{
state squestion6;
}
else if( str=="soc7" )
{
state squestion7;
}
else if( str=="soc8" )
{
state squestion8;
}
else if( str=="soc9" )
{
state squestion9;
}
else if( str=="soc10" )
{
state squestion10;
}
else if( str=="soc11" )
{
state squestion11;
}
else if( str=="soc12" )
{
state squestion12;
}else if(str=="reset")
{
//llSay(0, "SocReset");
llResetScript();
}
}
}

//Question 1 w/dialogue box and listener
state squestion1
{

touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq1 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "2. Abortion, when the woman's life is not threatened, should always be illegal", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq1);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq1);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq1);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq1);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq1);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 2 w/dialoge box and listener
state squestion2
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq2 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "4. All authority should be questioned.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq2);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq2);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq2);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq2);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq2);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 3 w/dialoge box and listener
state squestion3
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq3 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "6. People with serious inheritable disabilities should not be allowed to reproduce.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq3);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq3);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq3);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq3);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq3);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 4 w/dialoge box and listener
state squestion4
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq4 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "8. Civil liberties are often limited excessively in the name of counter-terrorism", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq4);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq4);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq4);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq4);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq4);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 5 w/dialoge box and listener
state squestion5
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq5 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "10. A significant advantage of a one-party state is that it avoids all the arguments that delay progress in a democratic political system.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq5);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq5);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq5);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq5);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq5);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 6 w/dialoge box and listener
state squestion6
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq6 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "12. It is important that my child's school instills moral values in each student.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq6);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq6);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq6);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq6);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq6);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 7 w/dialoge box and listener
state squestion7
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq7 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "14. Government should never censor speech, press, media or Internet.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq7);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq7);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq7);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq7);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq7);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 8 w/dialoge box and listener
state squestion8
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq8 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "16. The government should prevent marriage between gay or lesbian couples.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq8);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq8);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq8);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq8);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq8);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}
}
}

//Question 9 w/dialoge box and listener
state squestion9
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq9 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "18. The purchase and use of firearms should be heavily regulated by the government.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq9);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq9);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq9);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq9);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq9);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}
}
}
//Question 10 w/dialoge box and listener
state squestion10
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq10 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "20. I would prefer a smaller government providing fewer services to a bigger government providing more services.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq10);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq10);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq10);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq10);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq10);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}
}
}
//Question 11 w/dialoge box and listener
state squestion11
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq11 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "22. The government should provide historically underprivileged minorities more opportunities for employment and schooling, even if they receive preferential treatment over majority groups.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq11);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq11);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq11);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq11);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq11);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}
}
}
//Question 12 w/dialoge box and listener
state squestion12
{
touch_end(integer num_detected)
{
llMessageLinked(LINK_THIS , 0, "reset", NULL_KEY);
//llSay(0, "SocReset");
llResetScript();
}
state_entry()
{
sq12 = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(suser, "24. Excessive regulation of a state's borders fosters xenophobia and harm relations between countries.", l, CHANNEL);
}

//listen event catches answers from the question, updates the heading, and triggers the next question state
listen(integer channel, string name, key id,
string message)
{
if (llToLower(message) == "strongly disagree")
{
llListenRemove(sq12);
llMessageLinked(LINK_THIS , 0, "socplustwo", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "disagree")
{
llListenRemove(sq12);
llMessageLinked(LINK_THIS , 0, "socplus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "unsure")
{
llListenRemove(sq12);
llMessageLinked(LINK_THIS , 0, "socnone", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "agree")
{
llListenRemove(sq12);
llMessageLinked(LINK_THIS , 0, "socminus", NULL_KEY);
state betweensocquestions;
}

else if (llToLower(message) == "strongly agree")
{
llListenRemove(sq12);
llMessageLinked(LINK_THIS , 0, "socminustwo", NULL_KEY);
state betweensocquestions;
}
}
}


Powered by MediaWiki