6219fb67-fd6e-0181-3472-f206795a274f_script.lsl 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. //
  2. // The line above should be left blank to avoid script errors in OpenSim.
  3. /*********************************************
  4. * Copyright (c) 2009 - 2011 various contributors (see below)
  5. * Released under the GNU GPL 3.0
  6. * This script can be used in your scripts, but you must include this copyright header as per the GPL Licence
  7. * For more information about GPL 3.0 - see: http://www.gnu.org/copyleft/gpl.html
  8. * This script is part of the SLOODLE Project see http://sloodle.org
  9. *
  10. * sloodle_rezzer_object
  11. * Copyright:
  12. * Paul G. Preibisch (Fire Centaur in SL) fire@avatarclassroom.com
  13. * Edmund Edgar (Edmund Earp in SL) ed@avatarclassroom.com
  14. *
  15. * This script will get an httpin url, and shout it out to the rezzer. It will then wait to receive its config via httpin, and send it as a linked message to all other scripts
  16. */
  17. integer SLOODLE_CHANNEL_HTTP_RESPONSE = -1639260101; // Tells the sloodle_rezzer_object script to send the contents as an http-in response, to the key specified as key, which should be waiting for a response.
  18. integer SLOODLE_CHANNEL_OBJECT_DIALOG = -3857343;//configuration channel
  19. integer SLOODLE_CHANNEL_OBJECT_CREATOR_REQUEST_CONFIGURATION_VIA_HTTP_IN_URL = -1639270089; //Object creator telling itself it wants to rez an object at a position (specified as key)
  20. string SLOODLE_HTTP_IN_REQUEST_LINKER = "/mod/sloodle/classroom/httpin_config_linker.php";
  21. string SLOODLE_HTTP_IN_UPDATE_LINKER = "/mod/sloodle/classroom/httpin_url_update_linker.php";
  22. string SLOODLE_PING_LINKER = "/mod/sloodle/classroom/active_object_ping_linker.php";
  23. float refreshseconds = 3600.0; // Number of seconds between pings. Some jitter will sometimes be added to prevent killing the server this number of seconds after a sim full of objects starts up. We start with a fairly slow default, but this can be altered by the server when we ping or send out config.
  24. string SLOODLE_EOF = "sloodleeof";
  25. vector rezzer_position_offset;
  26. rotation rezzer_rotation_offset;
  27. key rezzer_uuid;
  28. integer isconfigured = 0;
  29. integer has_position = 0;
  30. integer http_in_password = 0;
  31. string sloodlepwd = "";
  32. string sloodleserverroot = "";
  33. string sloodlecontrollerid = "";
  34. string myUrl;
  35. string persistent_config;
  36. integer is_pinging = 0;
  37. integer is_ping_retry = 0;
  38. key current_ping_http = NULL_KEY;
  39. move_to_layout_position() {
  40. // llOwnerSay("todo: move to position "+(string)rezzer_position_offset+", rot "+(string)rezzer_rotation_offset+ " in relation to rezzer "+(string)rezzer_uuid);
  41. list rezzerdetails = llGetObjectDetails( rezzer_uuid, [ OBJECT_POS, OBJECT_ROT ] );
  42. vector rezzerpos = llList2Vector( rezzerdetails, 0 );
  43. rotation rezzerrot = llList2Rot( rezzerdetails, 1 );
  44. sloodle_set_pos( rezzerpos + ( rezzer_position_offset * rezzerrot ) );
  45. llSetRot( rezzerrot * rezzer_rotation_offset );
  46. }
  47. // Configure by receiving a linked message from another script in the object
  48. // Returns TRUE if the object has all the data it needs
  49. integer sloodle_handle_command(string str, integer do_persist)
  50. {
  51. // llOwnerSay("handling command "+str);
  52. list bits = llParseString2List(str,["|"],[]);
  53. integer numbits = llGetListLength(bits);
  54. if (numbits >= 1 ) {
  55. string name = llList2String(bits,0);
  56. string value1 = "";
  57. string value2 = "";
  58. if (numbits > 1) value1 = llList2String(bits,1);
  59. if (numbits > 2) value2 = llList2String(bits,2);
  60. if (name == "set:sloodleserverroot") { sloodleserverroot = value1;
  61. } else if (name == "set:sloodlepwd") { sloodlepwd = value1 + "|" + value2;
  62. } else if (name == "set:sloodlecontrollerid") { sloodlecontrollerid = value1;
  63. } else if (name == "set:position") {
  64. rezzer_position_offset = (vector)llList2String(bits,1);
  65. rezzer_rotation_offset = (rotation)llList2String(bits,2);
  66. rezzer_uuid = llList2Key(bits,3);
  67. has_position = 1;
  68. } else if (name == "do:derez") {
  69. llSleep(2); // This is needed to give the script a chance to finish making the http response.
  70. llDie();
  71. } else if ( (name=="do:requestconfig") || (name=="do:reset") ) {
  72. string this_script = llGetScriptName();
  73. integer n = llGetInventoryNumber(INVENTORY_SCRIPT);
  74. while(n) {
  75. string script_name = llGetInventoryName(INVENTORY_SCRIPT, --n);
  76. // Reset all sloodle scripts. If for some reason we make a sloodle script that we don't want reset, call it "sloodle_reset".
  77. if ( (script_name != this_script) && (llGetSubString( script_name, 0, 7) == "sloodle_" ) && (llGetSubString( script_name, 0, 15) != "sloodle_noreset_" ) ) {
  78. llResetOtherScript( script_name );
  79. // llOwnerSay("resetting script "+script_name);
  80. }
  81. }
  82. // Give them a second to get started to avoid trying to configure them before they're ready.
  83. llSleep(1);
  84. state reinitialize;
  85. } else {
  86. if (do_persist == 1) {
  87. // llOwnerSay("adding to persist");
  88. persistent_config = persistent_config + "&" + name + "=" + value1;
  89. }
  90. }
  91. }
  92. if ( (sloodleserverroot != "") && (sloodlecontrollerid != "") && (sloodlepwd != "") ) {
  93. isconfigured = 1;
  94. }
  95. return isconfigured;
  96. }
  97. sloodle_tell_other_scripts(string msg, integer channel, key respond_key)
  98. {
  99. integer status_code;
  100. if (channel == 0) {
  101. // Don't know the channel yet - get it from the message.
  102. list lines;
  103. lines = llParseStringKeepNulls( msg, ["\n"], [] );
  104. string status_line = llList2String(lines, 0);
  105. list status_bits;
  106. status_bits = llParseStringKeepNulls( status_line, ["|"], [] );
  107. status_code = (integer)llList2String(status_bits, 0);
  108. if (status_code == 1) {
  109. status_code = SLOODLE_CHANNEL_OBJECT_DIALOG;
  110. }
  111. } else {
  112. status_code = channel;
  113. }
  114. // config requests need a SLOODLE_EOF on the end.
  115. // this is a legacy from sending notecards line-by-line.
  116. if (status_code == SLOODLE_CHANNEL_OBJECT_DIALOG) {
  117. msg = msg + "\n"+SLOODLE_EOF;
  118. }
  119. // llOwnerSay("sending msg with status code "+(string)status_code+": "+msg);
  120. llMessageLinked(LINK_SET, status_code, msg, respond_key);
  121. }
  122. initialize()
  123. {
  124. //set timer to ask for config if config not received
  125. llSetTimerEvent(30);
  126. llSetText("", <1.0, 1.0, 1.0>, 1.0);
  127. rezzer_position_offset = <0,0,0>;
  128. rezzer_rotation_offset = <0,0,0,0>;
  129. rezzer_uuid = NULL_KEY;
  130. isconfigured = 0;
  131. has_position = 0;
  132. // http_in_password = 0;
  133. //get an httpin url
  134. if (myUrl != "") {
  135. llReleaseURL(myUrl);
  136. }
  137. llRequestURL();
  138. //llOwnerSay("initialize requesting url");
  139. }
  140. //sends our configuration to the server
  141. configure_from_persistent_config()
  142. {
  143. //llOwnerSay("got a persistent config, trying to use that");
  144. //send to httpin_config_linker
  145. string body = "sloodlecontrollerid=" + (string)sloodlecontrollerid;
  146. body += "&sloodlepwd=" + sloodlepwd;
  147. body += "&sloodleobjuuid=" + (string)llGetKey();
  148. body += "&childobjectuuid=" + (string)llGetKey();
  149. body += "&httpinurl=" + myUrl;
  150. body += "&sloodleobjname=" + llGetObjectName();
  151. body += persistent_config;
  152. //llOwnerSay("requested config with body "+body);
  153. //tell the server to initialize via httpin using the specified parameters. Server will respond by sending an http response, AND the config via httpin, however
  154. //we will ingnore the http response, and instead, just use the httpin
  155. llHTTPRequest(sloodleserverroot + SLOODLE_HTTP_IN_REQUEST_LINKER, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], body+persistent_config);
  156. }
  157. update_http_in_url()
  158. {
  159. //llOwnerSay("got a persistent config, trying to use that");
  160. //send to httpin_config_linker
  161. string body = "sloodlecontrollerid=" + (string)sloodlecontrollerid;
  162. body += "&sloodlepwd=" + sloodlepwd;
  163. body += "&sloodleobjuuid=" + (string)llGetKey();
  164. body += "&httpinurl=" + myUrl;
  165. //llOwnerSay("requested config with body "+body);
  166. llHTTPRequest(sloodleserverroot + SLOODLE_HTTP_IN_UPDATE_LINKER, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], body);
  167. }
  168. sloodle_set_pos(vector targetposition){
  169. integer counter=0;
  170. while ((llVecDist(llGetPos(), targetposition) > 0.001)&&(counter<50)) {
  171. counter+=1;
  172. llSetPos(targetposition);
  173. }
  174. }
  175. default{
  176. state_entry() {
  177. llSleep(1.0);
  178. initialize();
  179. }
  180. on_rez(integer start_param) {
  181. //llOwnerSay("default got start_param"+(string)start_param);
  182. //http_in_password is sent from the server - it is a random password per object so that malicious users can't send
  183. //commands to this object.
  184. http_in_password = start_param;
  185. //if no start_param, that means we were not rezzed by the rezzer (could have been by a user pulling fom inventory)
  186. if (start_param > 0) {
  187. //makesure config is clean
  188. sloodleserverroot = "";
  189. sloodlecontrollerid = "";
  190. sloodlepwd = "";
  191. persistent_config = "";
  192. }
  193. initialize();
  194. }
  195. http_request(key id, string method, string body){
  196. if ((method == URL_REQUEST_GRANTED)){
  197. //llOwnerSay("got url");
  198. myUrl=body;
  199. //shout it out to the rezzer our httpinUrl
  200. //persistant config is the data in memory from previous initialization
  201. // If we have a persistent config,
  202. if (persistent_config != "") {
  203. // llOwnerSay("config from persistent");
  204. //tell the server to configure us based on a configuration we had before which will will send via http request
  205. //we will then receive the returned config from the server via http-in
  206. configure_from_persistent_config();
  207. } else {
  208. // llOwnerSay("no persistent, contacting rezzer");
  209. //tell the rezzer to send us a configuration. Rezzer will tell the server to send us a configuration using our http-in
  210. llRegionSay(SLOODLE_CHANNEL_OBJECT_CREATOR_REQUEST_CONFIGURATION_VIA_HTTP_IN_URL,myUrl);
  211. //tell any other scripts our http-in
  212. llMessageLinked(LINK_THIS, SLOODLE_CHANNEL_OBJECT_CREATOR_REQUEST_CONFIGURATION_VIA_HTTP_IN_URL, myUrl, NULL_KEY);
  213. }
  214. } else if (method == "POST"){
  215. //this is where our object receives data from from our server via http-in
  216. list lines;
  217. lines = llParseStringKeepNulls( body, ["\n"], [] );
  218. list header_line;
  219. header_line = llParseStringKeepNulls( llList2String(lines,0), ["|"], [] );
  220. // Position 10 should be the http_in_password
  221. // This is set once on initial config.
  222. // Once we've implemented object persistance, it should always be set.
  223. if (http_in_password == 0) {
  224. // llOwnerSay("First time, setting http in password");
  225. http_in_password = (integer)llList2String(header_line, 10);
  226. }
  227. if (http_in_password != (integer)llList2String(header_line, 10)) {
  228. // llOwnerSay("Ignoring message - password mismatch");
  229. llHTTPResponse(id, 401, "Unauthorized - HTTP-in password mismatch");
  230. return;
  231. }
  232. // If we don't expect a response from the script that handles this, respond now to say we got the message.
  233. integer expect_response = 0;
  234. if (llGetListLength(header_line) >= 12) {
  235. if (llList2Integer(header_line, 11) == 1) {
  236. expect_response = 1;
  237. }
  238. }
  239. if (expect_response != 1) {
  240. llHTTPResponse(id, 200, "OK");
  241. }
  242. if (llGetListLength(header_line) >= 13) {
  243. if (llList2Float(header_line,12) > 0) {
  244. refreshseconds = llList2Float(header_line,12);
  245. }
  246. }
  247. string descriptor = "";
  248. if (llGetListLength(header_line) > 1) descriptor = llList2String(header_line, 3);
  249. integer do_persist = 0;
  250. if ( (descriptor == "CONFIG_PERSISTENT") || (descriptor == "CONFIG") ) {
  251. // blow the existing config away and start again
  252. sloodleserverroot = "";
  253. sloodlecontrollerid = "";
  254. sloodlepwd = "";
  255. persistent_config = "";
  256. //This CONFIG_PERSISTENT setting is primarily for development purposes. We turn this setting off via serverside
  257. //when shipping, so our old settings are not saved in shipped versions. However, users server always defaults to
  258. //CONFIG_PERSISTENT so their settings are saved, not developmental ones
  259. //when the server sends a configuration via http-in, it tells the object to keep it in its resident memory
  260. if (descriptor == "CONFIG_PERSISTENT") {
  261. //this means that the script should store the config in its memory so that when it is taken into inventory, and re-rezzed, it will
  262. //still have a configuration
  263. do_persist = 1;
  264. }
  265. }
  266. integer numlines = llGetListLength(lines);
  267. integer i = 1;
  268. for (i=1; i < numlines; i++) {
  269. isconfigured = sloodle_handle_command(llList2String(lines, i), do_persist);
  270. }
  271. sloodle_tell_other_scripts(body,0, id);
  272. // This is the end of the configuration data
  273. llSleep(0.2);
  274. sloodle_tell_other_scripts(SLOODLE_EOF, 0, id);
  275. if (isconfigured == 1) {
  276. if (has_position == 1) {
  277. move_to_layout_position();
  278. }
  279. llSetTimerEvent(0);
  280. state ready;
  281. }
  282. }//endif
  283. }//http
  284. changed(integer change) {
  285. if ( (change & CHANGED_REGION_START) || (change & CHANGED_REGION ) ) {
  286. //Request new URL
  287. if (myUrl != "") {
  288. llReleaseURL(myUrl);
  289. }
  290. llRequestURL();
  291. }
  292. }
  293. timer() {
  294. initialize();
  295. }
  296. }
  297. state ready {
  298. on_rez(integer start_param)
  299. {
  300. // llOwnerSay("ready got start_param"+(string)start_param);
  301. http_in_password = start_param;
  302. if (start_param > 0) {
  303. sloodleserverroot = "";
  304. sloodlecontrollerid = "";
  305. sloodlepwd = "";
  306. persistent_config = "";
  307. // llSleep(2.0); // Give the rezzer time to register us. Seems to be an issue on OpenSim, where everything is faster than SL.
  308. }
  309. state default;
  310. }
  311. state_entry()
  312. {
  313. // llOwnerSay("ready state");
  314. // llOwnerSay(persistent_config);
  315. if (rezzer_uuid != NULL_KEY) {
  316. llListen(232323, "", rezzer_uuid, "");
  317. }
  318. }
  319. listen(integer channel, string name, key id, string message) {
  320. // Listen to the rezzer telling us it's moved, and move accordingly.
  321. // llOwnerSay(message);
  322. list bits = llParseString2List( message, ["|"], [] );
  323. vector change_pos = (vector)llList2String( bits, 0 );
  324. rotation change_rot = (rotation)llList2String( bits, 1 );
  325. vector parent_pos = (vector)llList2String( bits, 2);
  326. // llOwnerSay("got message" + message);
  327. // Apply the position changes first, then the rotation
  328. vector before_pos = llGetPos();
  329. if (before_pos.z > 0) { // sometimes this comes out at 0, but we don't want to go to the corner of the sim
  330. sloodle_set_pos( before_pos - change_pos );
  331. }
  332. before_pos = llGetPos();
  333. rotation before_rot = llGetRot();
  334. //llOwnerSay("Rot: "+(string)llRot2Euler(change_rot));
  335. // llOwnerSay((string)(before_rot - change_rot));
  336. // llOwnerSay("new pos: "+(string)(llGetPos() + ( before_pos - parent_pos) * change_rot));
  337. //change_rot = llEuler2Rot( < 0, 0, 15 * DEG_TO_RAD > ); // pretend we rotated 15 degrees
  338. vector currentPosition = llGetPos();
  339. vector currentOffset = currentPosition - parent_pos;
  340. //llOwnerSay("I plan to be "+(string)llVecDist(currentOffset, <0,0,0>)+" from parent");
  341. vector rotatedOffset = currentOffset * change_rot;
  342. vector newPosition = parent_pos + rotatedOffset;
  343. sloodle_set_pos(newPosition);
  344. //llOwnerSay("new pos: "+(string)(llGetPos() + ( ( before_pos - parent_pos) * change_rot ) ) );
  345. // llSetPos( before_pos + ( ( parent_pos - before_pos ) * change_rot ) );
  346. llSetRot( llGetRot() * change_rot );
  347. // llGetPos() + vPosOffset * llGetRot(), ZERO_VECTOR, llGetRot()
  348. }
  349. timer()
  350. {
  351. // Send our ping request
  352. string body = "sloodlecontrollerid=" + (string)sloodlecontrollerid;
  353. body += "&sloodlepwd=" + sloodlepwd;
  354. body += "&sloodleobjuuid=" + (string)llGetKey();
  355. is_pinging = 1;
  356. current_ping_http = llHTTPRequest(sloodleserverroot + SLOODLE_PING_LINKER, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], body);
  357. }
  358. http_response( key request_id, integer status, list metadata, string body ){
  359. if (request_id != current_ping_http) {
  360. return;
  361. }
  362. list lines = llParseStringKeepNulls(body, ["\n"], []);
  363. list statusfields = llParseStringKeepNulls( llList2String(lines,0), ["|"], [] );
  364. if (llGetListLength(statusfields) >= 12) {
  365. if (llList2Float(statusfields,12) > 0) {
  366. refreshseconds = llList2Float(statusfields,12);
  367. }
  368. }
  369. is_pinging = 0;
  370. if (status == 200) {
  371. if (is_ping_retry == 1) {
  372. // Reintroduce the randomness we may have lost if the server went down.
  373. llSetTimerEvent(llFrand(refreshseconds));
  374. } else {
  375. llSetTimerEvent(refreshseconds);
  376. }
  377. is_ping_retry = 0;
  378. } else {
  379. is_ping_retry = 1;
  380. llSetTimerEvent(llFrand(refreshseconds));
  381. }
  382. }
  383. http_request(key id, string method, string body){
  384. if (method == URL_REQUEST_GRANTED){
  385. myUrl=body;
  386. update_http_in_url();
  387. } else if (method == "POST"){
  388. //this is where we receive data from from our server
  389. list lines;
  390. lines = llParseStringKeepNulls( body, ["\n"], [] );
  391. list header_line;
  392. header_line = llParseStringKeepNulls( llList2String(lines,0), ["|"], [] );
  393. // Position 10 should be the http_in_password
  394. // This is set once on initial config.
  395. // Once we've implemented object persistance, it should always be set.
  396. if (http_in_password == 0) {
  397. // llOwnerSay("First time, setting http in password");
  398. http_in_password = (integer)llList2String(header_line, 10);
  399. }
  400. if (http_in_password != (integer)llList2String(header_line, 10)) {
  401. // llOwnerSay("Ignoring message - password mismatch");
  402. llHTTPResponse(id, 401, "Unauthorized - HTTP-in password mismatch");
  403. return;
  404. }
  405. integer numlines = llGetListLength(lines);
  406. integer i = 0;
  407. // llOwnerSay(body);
  408. if (llList2String(header_line,3) == "REPORT_POSITION") {
  409. list rezzerdetails = llGetObjectDetails( rezzer_uuid, [ OBJECT_POS, OBJECT_ROT ] );
  410. vector rezzerpos = llList2Vector( rezzerdetails, 0 );
  411. rotation rezzerrot = llList2Rot( rezzerdetails, 1 );
  412. string reply = (string)( ( llGetPos() - rezzerpos ) / rezzerrot ) + "|" + (string)(llGetRot() / rezzerrot) + "|" + (string)rezzer_uuid;
  413. llHTTPResponse(id, 200, reply);
  414. return;
  415. }
  416. // If we don't expect a response from the script that handles this, respond now to say we got the message.
  417. integer expect_response = 0;
  418. if (llGetListLength(header_line) >= 12) {
  419. if (llList2Integer(header_line, 11) == 1) {
  420. expect_response = 1;
  421. }
  422. };
  423. if (expect_response != 1) {
  424. llHTTPResponse(id, 200, "OK");
  425. }
  426. string status_descriptor = "";
  427. string request_descriptor = "";
  428. integer do_persist = 0;
  429. if (llGetListLength(header_line) > 1) status_descriptor = llList2String(header_line, 1);
  430. if (llGetListLength(header_line) > 2) request_descriptor = llList2String(header_line, 3);
  431. if ( (request_descriptor == "CONFIG_PERSISTENT") || (request_descriptor == "CONFIG") ) {
  432. // blow the existing config away and start again
  433. sloodleserverroot = "";
  434. sloodlecontrollerid = "";
  435. sloodlepwd = "";
  436. persistent_config = "";
  437. if (request_descriptor == "CONFIG_PERSISTENT") {
  438. do_persist = 1;
  439. }
  440. }
  441. if ( (status_descriptor == "CONFIG") || (status_descriptor=="SYSTEM") ){
  442. for (i=1; i < numlines; i++) {
  443. isconfigured = sloodle_handle_command(llList2String(lines, i), do_persist);
  444. }
  445. }
  446. sloodle_tell_other_scripts(body, 0, id);
  447. // This is the end of the configuration data
  448. llSleep(0.2);
  449. sloodle_tell_other_scripts(SLOODLE_EOF, 0, id);
  450. // Start pinging, with jitter
  451. llSetTimerEvent(llFrand(refreshseconds));
  452. }//endif
  453. }//http
  454. changed(integer change) {
  455. if ( (change & CHANGED_REGION_START) || (change & CHANGED_REGION ) ) {
  456. //Request new URL
  457. if (myUrl != "") {
  458. llReleaseURL(myUrl);
  459. }
  460. llRequestURL();
  461. }
  462. }
  463. link_message(integer sender_num, integer num, string str, key id)
  464. {
  465. // Check the channel
  466. if (num == SLOODLE_CHANNEL_OBJECT_DIALOG) {
  467. sloodle_handle_command(str, 0);
  468. } else if (num == SLOODLE_CHANNEL_HTTP_RESPONSE) {
  469. llHTTPResponse(id, 200, str);
  470. }
  471. }
  472. }
  473. state reinitialize {
  474. // force us to go into state default and run state_entry, which calls initialize
  475. // this allows us to get to that state from a function that doesn't know whether it's already in state default or not.
  476. state_entry() {
  477. state default;
  478. }
  479. }
  480. // Please leave the following line intact to show where the script lives in Git:
  481. // SLOODLE LSL Script Git Location: mod/set-1.0/objects/default/assets/sloodle_rezzer_object.lslp