2008年07月25日
LM を記憶する仕組み(その3)
llEscapeURL というのがあるのに気付き
-----
それを使って改版(と思ったが これダメかも...)
-----
それを使って改版(と思ったが これダメかも...)
//
// File: Gorodish.lsl
// Date Author number of nodes
// 2008/7/24 walkinglint 272
// 2008/7/13 walkinglint 267
// 2008/7/11 walkinglint 266
// 2008/7/9 walkinglint 261
//
string get_time() {
integer second = llFloor(llGetGMTclock());
integer min = llFloor(second / 60);
second = second - (min * 60);
integer hour = llFloor(min / 60);
min = min - (hour * 60);
hour = hour + 9;
if (hour > 24) {
hour = hour - 24;
}
string shour = (string)hour;
string smin;
string ssecond;
if (min < 10) {
smin = "0" + (string)min;
} else {
smin = (string)min;
}
if (second < 10) {
ssecond = "0" + (string)second;
} else {
ssecond = (string)second;
}
return shour + ":" + smin + ":" + ssecond;
}
string GetJPDate() {
string DateToday = "";
string DateUTC = llGetDate();
// llOwnerSay((string)llGetGMTclock());
if (llGetGMTclock() > 15.0 * 60.0 * 60.0) { // if ... then must be adjusted.
integer year = (integer)llGetSubString(DateUTC, 0, 3);
integer month = (integer)llGetSubString(DateUTC, 5, 6);
integer day = (integer)llGetSubString(DateUTC, 8, 9);
if ((month == 2) && (day == (28 + !(year % 4) - !(year % 100) + !(year % 400)))) {
month++;
day = 1;
} else if (((month == 4) || (month == 6) || (month == 9) || (month == 11)) && (day == 30)) {
month++;
day = 1;
} else if ((month == 12) && (day == 31)) {
year++;
month = 1;
day = 1;
} else if (day == 31) {
month++;
day = 1;
} else {
day = day + 1;
}
if (month < 10) {
DateToday = "0";
}
DateToday += (string)month + "-";
if (day < 10) {
DateToday += "0";
}
DateToday += (string)day;
return (string)year + "-" + DateToday;
}
return DateUTC;
}
integer listener;
list name_list = [];
list time_list = [];
integer i;
default {
state_entry() {
listener = llListen(0, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message) {
if (message == "visited") {
for (i = 0; i < llGetListLength(name_list); i++) {
llOwnerSay("http://slurl.com/secondlife/"
+ llEscapeURL(llList2String(name_list, i)) + " " + llList2String(time_list, i));
}
}
}
changed(integer change) {
string name = llGetRegionName();
vector c_pos = llGetPos();
string c_pos_str = (string)llFloor(c_pos.x) + "/" + (string)llFloor(c_pos.y)
+ "/" + (string)llFloor(c_pos.z);
name = name + "/" + c_pos_str;
if (change & CHANGED_TELEPORT) {
if (llListFindList(name_list, [name]) == -1) {
name_list += [name];
time_list += [GetJPDate() + " " + get_time()];
}
}
if (llGetFreeMemory() < 200) {
llResetScript();
}
}
}
Posted by walkinglint at 18:03│Comments(0)
│walking のスクリプティング講座