string DestinationsNoteCardName = "Destinations"; string ResultsNoteCardName = "Results"; string region; string status; string xpos; string ypos; key PosQuery; key StatusQuery; list results; integer n; integer NumLines; default { touch_start(integer total_number) { NumLines = osGetNumberOfNotecardLines(DestinationsNoteCardName); n = 0; region = osGetNotecardLine(DestinationsNoteCardName,n); StatusQuery = llRequestSimulatorData(region, DATA_SIM_STATUS); } dataserver(key queryId, string data) { if (queryId == StatusQuery) { StatusQuery = ""; status = data; xpos="-1"; ypos="-1"; if (status == "up") { PosQuery = llRequestSimulatorData(region, DATA_SIM_POS); } else { results += [region,status,xpos,ypos]; n += 1; if (n >= NumLines) { osMakeNotecard(ResultsNoteCardName,results); llSay (0, "Processing is completed, stored in notecard "+ResultsNoteCardName); } else { region = osGetNotecardLine(DestinationsNoteCardName,n); StatusQuery = llRequestSimulatorData(region, DATA_SIM_STATUS); } } } else if (queryId == PosQuery) { PosQuery = ""; list location = llParseString2List(data,[",", "<",">"],[" "]); xpos = (string) (llList2Integer(location,0)/256); ypos = (string) (llList2Integer(location,1)/256); results += [region,status,xpos,ypos]; n += 1; if (n >= NumLines) { osMakeNotecard(ResultsNoteCardName,results); llSay (0, "Processing is completed, stored in notecard "+ResultsNoteCardName); } else { region = osGetNotecardLine(DestinationsNoteCardName,n); StatusQuery = llRequestSimulatorData(region, DATA_SIM_STATUS); } } } }