integer CurrentRow = 1; //which event to show - 1 is first string URL ="https://docs.google.com/spreadsheet/pub?key=0Atezdu2xUAJJdC1JUE5sY1hxVXBDNHBMbms1anRBb1E&single=true&gid=2&output=csv"; string SimAddress; string Website; string SnapshotURL; string GridName; string SimLocation; vector LandingPoint = <128.0, 128.0, 22.0>; vector LookAt = <1.0,1.0,1.0>; list LastFewAgents; list DataList; key httpkey; integer CellCount; integer RowCount; integer ColumnCount = 8; //Sets a grid of x by y, and returns that number on touch. float x=2.0; float y=1.0; integer Pos; PerformTeleport( key WhomToTeleport ) { integer CurrentTime = llGetUnixTime(); integer AgentIndex = llListFindList( LastFewAgents, [ WhomToTeleport ] ); // Is the agent we're teleporting already in the list? if (AgentIndex != -1) // If yes, check to make sure it's been > 5 seconds { integer PreviousTime = llList2Integer( LastFewAgents, AgentIndex+1 ); // Get the last time they were teleported if (PreviousTime >= (CurrentTime - 30)) return; // Less than five seconds ago? Exit without teleporting LastFewAgents = llDeleteSubList( LastFewAgents, AgentIndex, AgentIndex+1); // Delete the agent from the list } LastFewAgents += [ WhomToTeleport, CurrentTime ]; // Add the agent and current time to the list llMapDestination( SimAddress, LandingPoint, LookAt ); } ShowEvent ( integer row) { SimAddress = llList2String(DataList,row*ColumnCount+3); Website = llList2String(DataList,row*ColumnCount+6); SnapshotURL = llList2String(DataList,row*ColumnCount+5); GridName = llList2String(DataList,row*ColumnCount+8); SimLocation = llList2String(DataList,row*ColumnCount+6); string URLTexture = osSetDynamicTextureURL("", "image", SnapshotURL, "", 600); llSetTexture(URLTexture,ALL_SIDES); llSetTexture("Grid-Website buttons",2); llSetTexture(TEXTURE_BLANK,4); string CommandList = ""; CommandList = osMovePen( CommandList, 15, 5 ); CommandList += "FontSize 16;"; CommandList = osDrawText( CommandList, llList2String(DataList,row*ColumnCount)+" on "+llList2String(DataList,row*ColumnCount+7)); CommandList = osMovePen( CommandList, 15, 35 ); CommandList += "FontSize 20;"; CommandList = osDrawText( CommandList, "At "+llList2String(DataList,row*ColumnCount+2)+" on "+llList2String(DataList,row*ColumnCount+1)); osSetDynamicTextureDataBlendFace( "", "vector", CommandList, "width:512,height:512", FALSE, 2, 0, 255, 4); } default{ state_entry() { httpkey=llHTTPRequest(URL, [] ,""); llSetTimerEvent(3600); } touch_start(integer total_number) { integer i; integer touchedFace = llDetectedTouchFace(i);; key gAvatarKey = llDetectedKey(0); vector pos = llDetectedTouchST(0); Pos = ((llFloor(((1-pos.y)*10)*y)/10)*(integer)x)+llCeil(pos.x*x); if (touchedFace == 2) { if (Pos==1) PerformTeleport( llDetectedKey( 0 )); if (Pos==2) llLoadURL(gAvatarKey, "Go to website.", Website); } if ((touchedFace == 0) && (llDetectedKey(0) == llGetOwner())) { httpkey=llHTTPRequest(URL, [] ,""); } } http_response(key id, integer status, list meta, string body) { DataList = llParseString2List(body, [",","\n"], [] ); CellCount = llGetListLength(DataList); RowCount = ((CellCount-1)/ColumnCount) -1 ; ShowEvent(CurrentRow); } timer() { httpkey=llHTTPRequest(URL, [] ,""); } }