string DestinationsNoteCardName = "Destinations"; string ResultsNoteCardName = "Results"; string region; string status; string xpos; string ypos; key ahernPosQuery; key ahernStatusQuery; list results; integer n; integer NumLines; default { state_entry() { llSetTimerEvent(36000); } timer() { NumLines = osGetNumberOfNotecardLines(DestinationsNoteCardName); n = 0; region = osGetNotecardLine(DestinationsNoteCardName,n); ahernStatusQuery = llRequestSimulatorData(region, DATA_SIM_STATUS); } dataserver(key queryId, string data) { if (queryId == ahernStatusQuery) { ahernStatusQuery = ""; status = data; xpos="-1"; ypos="-1"; if (status == "up") { ahernPosQuery = llRequestSimulatorData(region, DATA_SIM_POS); } else { results += [region+", "+status+", "+xpos+", "+ypos]; string URL = "http://hg-url-status-checker-1.appspot.com/reg?hgurl=" + region + "&status=down"; key httpkey=llHTTPRequest(URL, [] ,""); n += 1; llSay(0, "Line number: " + (string)n +" of " + (string)NumLines); if (n >= NumLines) { osMakeNotecard(ResultsNoteCardName,results); llSay (0, "Processing is completed, stored in notecard "+ResultsNoteCardName); llEmail("maria@hypergridbusiness.com", "Hypergrid destination check complete", "The in-world destination checker tool just completed its scheduled check."); llSetTimerEvent(36000); } else { region = osGetNotecardLine(DestinationsNoteCardName,n); ahernStatusQuery = llRequestSimulatorData(region, DATA_SIM_STATUS); } } } else if (queryId == ahernPosQuery) { ahernPosQuery = ""; list location = llParseString2List(data,[",", "<",">"],[" "]); xpos = (string) (llList2Integer(location,0)/256); ypos = (string) (llList2Integer(location,1)/256); results += [region+", "+status+", "+xpos+", "+ypos]; // string URL = "http://hg-url-status-checker-1.appspot.com/reg?hgurl=" + region + "&status=up"; // // The line above is for reference only -- it sets the name of my Google App Engine database // The line below actually loads the data to my Google App Engine database // It's for REFERENCE only -- PLEASE do not run this script as is and mess up my database! // Thank you! // key httpkey=llHTTPRequest(URL, [] ,""); // n += 1; llSay(0, (string) n +" of " + (string)NumLines); if (n >= NumLines) { osMakeNotecard(ResultsNoteCardName,results); llSay (0, "Processing is completed, stored in notecard "+ResultsNoteCardName); llEmail("maria@hypergridbusiness.com", "Hypergrid destination check complete", "The in-world destination checker tool just completed its scheduled check."); llSetTimerEvent(36000); } else { region = osGetNotecardLine(DestinationsNoteCardName,n); ahernStatusQuery = llRequestSimulatorData(region, DATA_SIM_STATUS); } } } }