From 2ad923922ef5c1e212dd45aa5074f08d54ea9371 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 10 Dec 2013 12:47:15 -0500 Subject: [PATCH] moved to single script repository folder for the actual scripts. updated readme. --- .../a_huffotronic_update_server_v23.3.txt | 939 ------------------ .../data_cow_v3.3.txt | 227 ----- .../huff-update_client_v20.1.txt | 826 --------------- .../jaunting_library_v15.9.txt | 551 ---------- .../menutini_library_v6.1.txt | 438 -------- .../texture_mover_v3.0.txt | 237 ----- .../FPS_color_changer_v2.4.txt | 0 .../FreeView_v1.8.txt | 0 .../Hour_Hand_v0.5.txt | 0 .../Hyper_Jump_Wilder_Westen_v0.2.txt | 0 .../JukeBox_v1.6.txt | 0 .../Minute_Hand_v0.4.txt | 0 .../NC_stay_at_home_v5.2.txt | 0 .../TL_Door_fredmod_v4.5.txt | 0 .../Vote_for_me_v4.2.txt | 0 .../a_huffotronic_update_server_v23.3.txt | 0 .../a_jumping_bean_v2.7.txt | 0 .../altitudinator_v1.1.txt | 0 ...ama_omega_et_al_vendor_owner-only_v0.5.txt | 0 .../animated_texture_v0.4.txt | 0 .../anti-idler_mojo_v1.4.txt | 0 .../aqua_config_v0.5.txt | 0 .../auto-retire_v2.8.txt | 0 .../axis_rider_v2.9.txt | 0 .../base_note_read_v0.3.txt | 0 .../begging_bowl_v4.4.txt | 0 .../bouncer_v2.1.txt | 0 .../box_mover_v1.7.txt | 0 .../button_pusher_v0.5.txt | 0 .../card_configurator_v8.1.txt | 0 .../change_click_action_v1.0.txt | 0 .../chaos_picks_a_number_v3.0.txt | 0 .../child_jaunter_v85.2.txt | 0 .../clear_text_and_effects_v2.2.txt | 0 .../coastal_connector_hubs_v2.4.txt | 0 .../collider_v1.3.txt | 0 .../color_smoove_clock_v3.2.txt | 0 .../comfortable_sitting_v7.5.txt | 0 .../concussive_v19.2.txt | 0 .../cowpole_ignite_v1.2.txt | 0 .../create_objects_v1.3.txt | 0 .../data_cow_v3.3.txt | 0 .../die_on_demand_v0.3.txt | 0 .../docs_for_searchbert_v2.3.txt | 0 .../eepaw_shop_note_v0.8.txt | 0 .../email_notecards_v6.2.txt | 0 .../emptiness_jaunter_config_v0.2.txt | 0 .../fade_opacity_v3.7.txt | 0 .../fade_prim_v3.2.txt | 0 .../fred_main_hubs_v5.4.txt | 0 .../fredboxmux_no_rot_v3.0.txt | 0 .../fredboxmux_v3.0.txt | 0 .../giftorse_v7.6.txt | 0 .../hal9000_config_v0.4.txt | 0 .../hamster_sound_effects_v0.8.txt | 0 .../hamstertram_config_v7.8.txt | 0 .../html_onna_prim_v1.6.txt | 0 .../huff-pet_v18.6.txt | 0 .../huff-search_brainiac_v48.1.txt | 0 .../huff-search_pointer_v11.9.txt | 0 .../huff-update_client_v20.1.txt | 0 .../huffbee_bulb_v4.7.txt | 0 .../hufflets_v6.3.txt | 0 .../huffware_id_registry_v3.2.txt | 0 .../inventory_exchanger_v3.7.txt | 0 .../invisiprim_v0.8.txt | 0 .../invoke_nechung_v1.2.txt | 0 .../jaunt_config_funcs_v2.9.txt | 0 .../jaunt_rezolator_v22.3.txt | 0 .../jaunt_wik_rez_v86.3.txt | 0 .../jaunter_button_pusher_v0.8.txt | 0 .../jaunting_library_v15.9.txt | 0 .../jump_good_v6.0.txt | 0 ...n_osgrid_&_personal_opensims_only_v1.9.txt | 0 .../link_reporter_v0.5.txt | 0 .../logic_system_main_v1.8.txt | 0 .../mediatron_control_v7.2.txt | 0 .../megaprim_v0.3.txt | 0 .../menu_list_manager_v12.7.txt | 0 .../menutini_library_v6.1.txt | 0 .../minnow_v10.6.txt | 0 .../mu_tester_v6.0.txt | 0 .../no_sitting_on_vendor_v1.0.txt | 0 .../non-script_giver_v3.2.txt | 0 .../noteworthy_example_usage_v3.6.txt | 0 .../noteworthy_library_v12.4.txt | 0 .../noteworthy_library_v12.5.txt | 0 .../particle_projector_v3.1.txt | 0 .../party_culiar_v6.1.txt | 0 .../phantomizer_v1.6.txt | 0 .../puffer_v1.3.txt | 0 .../radio_tuner_v1.2.txt | 0 .../report_to_merchants_v1.6.txt | 0 .../rezzeroni_v21.0.txt | 0 .../rotanium_rotato_v2.7.txt | 0 .../sculpty_morpher_v0.6.txt | 0 .../searchbert_armature_v15.3.txt | 0 .../searchbert_config_v1.2.txt | 0 .../searchbert_menus_v5.2.txt | 0 .../set_comparator_library_v4.1.txt | 0 .../set_roundy_v0.6.txt | 0 .../simple_map_tp_v0.3.txt | 0 .../simpy_pet_v3.7.txt | 0 .../sit_testing_v0.6.txt | 0 .../slate_reader_v1.2.txt | 0 .../star_chair_sitting_config_v0.4.txt | 0 .../swiveller_v1.1.txt | 0 .../take_touches_v0.2.txt | 0 .../tester_for_inventory_exchanger_v1.0.txt | 0 .../text_label_v4.1.txt | 0 .../texture_mover_v3.0.txt | 0 .../texture_shower_v2.7.txt | 0 .../time_zone_picker_v0.6.txt | 0 .../timed_expiration_v2.9_(toxic)_.txt | 0 .../touchy_feely_doro_v0.4.txt | 0 .../turbo_lifter_v5.8.txt | 0 .../uuid_shower_mat_v0.3.txt | 0 .../vendor_sales_manager_v3.1.txt | 0 .../viewscreen_blitter_v3.9.txt | 0 .../weapon_fire_v2.2.txt | 0 .../welcomebot_v4.0.txt | 0 .../wylie_controller_v8.4.txt | 0 .../zap_updater_from_elevators_v1.3.txt | 0 .../zenmondos_mailbox_v0.4.txt | 0 .../a_huffotronic_update_server_v23.3.txt | 939 ------------------ .../comfortable_sitting_v7.5.txt | 882 ---------------- .../huff-update_client_v20.1.txt | 826 --------------- .../zap_updater_from_elevators_v1.3.txt | 187 ---- huffware/readme.txt | 20 +- 129 files changed, 13 insertions(+), 6059 deletions(-) delete mode 100755 huffware/huffotronic_jaunter_updater/a_huffotronic_update_server_v23.3.txt delete mode 100755 huffware/huffotronic_jaunter_updater/data_cow_v3.3.txt delete mode 100755 huffware/huffotronic_jaunter_updater/huff-update_client_v20.1.txt delete mode 100755 huffware/huffotronic_jaunter_updater/jaunting_library_v15.9.txt delete mode 100755 huffware/huffotronic_jaunter_updater/menutini_library_v6.1.txt delete mode 100755 huffware/huffotronic_jaunter_updater/texture_mover_v3.0.txt rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/FPS_color_changer_v2.4.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/FreeView_v1.8.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/Hour_Hand_v0.5.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/Hyper_Jump_Wilder_Westen_v0.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/JukeBox_v1.6.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/Minute_Hand_v0.4.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/NC_stay_at_home_v5.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/TL_Door_fredmod_v4.5.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/Vote_for_me_v4.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/a_huffotronic_update_server_v23.3.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/a_jumping_bean_v2.7.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/altitudinator_v1.1.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/ama_omega_et_al_vendor_owner-only_v0.5.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/animated_texture_v0.4.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/anti-idler_mojo_v1.4.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/aqua_config_v0.5.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/auto-retire_v2.8.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/axis_rider_v2.9.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/base_note_read_v0.3.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/begging_bowl_v4.4.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/bouncer_v2.1.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/box_mover_v1.7.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/button_pusher_v0.5.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/card_configurator_v8.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/change_click_action_v1.0.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/chaos_picks_a_number_v3.0.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/child_jaunter_v85.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/clear_text_and_effects_v2.2.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/coastal_connector_hubs_v2.4.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/collider_v1.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/color_smoove_clock_v3.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/comfortable_sitting_v7.5.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/concussive_v19.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/cowpole_ignite_v1.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/create_objects_v1.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/data_cow_v3.3.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/die_on_demand_v0.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/docs_for_searchbert_v2.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/eepaw_shop_note_v0.8.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/email_notecards_v6.2.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/emptiness_jaunter_config_v0.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/fade_opacity_v3.7.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/fade_prim_v3.2.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/fred_main_hubs_v5.4.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/fredboxmux_no_rot_v3.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/fredboxmux_v3.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/giftorse_v7.6.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/hal9000_config_v0.4.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/hamster_sound_effects_v0.8.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/hamstertram_config_v7.8.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/html_onna_prim_v1.6.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/huff-pet_v18.6.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/huff-search_brainiac_v48.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/huff-search_pointer_v11.9.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/huff-update_client_v20.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/huffbee_bulb_v4.7.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/hufflets_v6.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/huffware_id_registry_v3.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/inventory_exchanger_v3.7.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/invisiprim_v0.8.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/invoke_nechung_v1.2.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/jaunt_config_funcs_v2.9.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/jaunt_rezolator_v22.3.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/jaunt_wik_rez_v86.3.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/jaunter_button_pusher_v0.8.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/jaunting_library_v15.9.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/jump_good_v6.0.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/license__free_in_osgrid_&_personal_opensims_only_v1.9.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/link_reporter_v0.5.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/logic_system_main_v1.8.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/mediatron_control_v7.2.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/megaprim_v0.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/menu_list_manager_v12.7.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/menutini_library_v6.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/minnow_v10.6.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/mu_tester_v6.0.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/no_sitting_on_vendor_v1.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/non-script_giver_v3.2.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/noteworthy_example_usage_v3.6.txt (100%) rename huffware/{huffotronic_jaunter_updater => huffotronic_scripts}/noteworthy_library_v12.4.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/noteworthy_library_v12.5.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/particle_projector_v3.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/party_culiar_v6.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/phantomizer_v1.6.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/puffer_v1.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/radio_tuner_v1.2.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/report_to_merchants_v1.6.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/rezzeroni_v21.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/rotanium_rotato_v2.7.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/sculpty_morpher_v0.6.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/searchbert_armature_v15.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/searchbert_config_v1.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/searchbert_menus_v5.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/set_comparator_library_v4.1.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/set_roundy_v0.6.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/simple_map_tp_v0.3.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/simpy_pet_v3.7.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/sit_testing_v0.6.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/slate_reader_v1.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/star_chair_sitting_config_v0.4.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/swiveller_v1.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/take_touches_v0.2.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/tester_for_inventory_exchanger_v1.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/text_label_v4.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/texture_mover_v3.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/texture_shower_v2.7.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/time_zone_picker_v0.6.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/timed_expiration_v2.9_(toxic)_.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/touchy_feely_doro_v0.4.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/turbo_lifter_v5.8.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/uuid_shower_mat_v0.3.txt (100%) rename huffware/{huffotronic_tools_n_testers => huffotronic_scripts}/vendor_sales_manager_v3.1.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/viewscreen_blitter_v3.9.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/weapon_fire_v2.2.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/welcomebot_v4.0.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/wylie_controller_v8.4.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/zap_updater_from_elevators_v1.3.txt (100%) rename huffware/{huffotronic_eepaw_knowledge => huffotronic_scripts}/zenmondos_mailbox_v0.4.txt (100%) delete mode 100755 huffware/huffotronic_tools_n_testers/a_huffotronic_update_server_v23.3.txt delete mode 100755 huffware/huffotronic_tools_n_testers/comfortable_sitting_v7.5.txt delete mode 100755 huffware/huffotronic_tools_n_testers/huff-update_client_v20.1.txt delete mode 100755 huffware/huffotronic_tools_n_testers/zap_updater_from_elevators_v1.3.txt diff --git a/huffware/huffotronic_jaunter_updater/a_huffotronic_update_server_v23.3.txt b/huffware/huffotronic_jaunter_updater/a_huffotronic_update_server_v23.3.txt deleted file mode 100755 index fbba630b..00000000 --- a/huffware/huffotronic_jaunter_updater/a_huffotronic_update_server_v23.3.txt +++ /dev/null @@ -1,939 +0,0 @@ - -// huffware script: huff-update server, by fred huffhines. -// -// this script is the server side of the update process. it should reside in an object that -// has all the newest versions of scripts and objects that will be updated. when rezzed, and -// at periodic intervals, it announces on a private chat channel that updates are available. -// when objects respond that they might like an update, it tells them the scripts that it has -// stored inside of it. if any of those scripts are an older version inside the client -// (update requesting) object, then the client will request the newer versions. the server -// object will stuff them into it and tell them to start running. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -integer IS_OPENSIM = TRUE; // must be set to true for opensim, false for second life. - -integer DEBUGGING = FALSE; // set this to true for noisier diagnostics. - - - -// updater dependency section: -// should be moved to a notecard!!! -// -// format is a list of strings, where each string has a pair wrapped by the -// huffware item separators. the pair contains (1) the basename of a script -// that has a new dependency and (2) the basename of that new dependency. -list known_script_dependencies; - - - - -load_script_deps() -{ - known_script_dependencies = [ - llDumpList2String(["jaunt wik rez", "jaunt config funcs"], ITEM_LIST_SEPARATOR), - llDumpList2String(["jaunt wik rez", "data cow"], ITEM_LIST_SEPARATOR), - llDumpList2String(["jaunt wik rez", "jaunt rezolator"], ITEM_LIST_SEPARATOR), - llDumpList2String(["remotely personable", "inventory exchanger"], ITEM_LIST_SEPARATOR), - llDumpList2String(["animote main driver", "exchange driver hudimation"], ITEM_LIST_SEPARATOR), - llDumpList2String(["animote main driver", "avatar timer manager"], ITEM_LIST_SEPARATOR), - llDumpList2String(["animote main driver", "avatar choice memory"], ITEM_LIST_SEPARATOR), - llDumpList2String(["giftorse", "particle projector"], ITEM_LIST_SEPARATOR), - llDumpList2String(["huff-search brainiac", "searchbert armature"], ITEM_LIST_SEPARATOR), - - -//special purpose -- removes the updater from the elevator buttons... -//llDumpList2String(["comfortable sitting", "zap updater from elevators"], ITEM_LIST_SEPARATOR), -// => do not uncomment unless you want your elevators to shed their ability to update. - - - // this allows us to add or remove items above at will without complaints about comma. - llDumpList2String(["xyzzy", "hopefully-never-matches"], ITEM_LIST_SEPARATOR) - ]; -} - - - - -// global constants... - -integer USER_COMMAND_CHANNEL = 4; // channel where we listen to user commands. - -float ANNOUNCEMENT_PERIOD = 14.0; // how often we tell other objects that we have tasty treats. - -integer UPDATE_ANNOUNCEMENT_CHANNEL = -420108; // used by server to brag about itself. -integer OLD_REQUEST_INVENTORY_CHANNEL = -421008; // used by clients to request an update list. - -string UPDATE_ANNOUNCEMENT_PREFIX = "#huff-update#"; // first part of any announcement. -string REQUEST_INVENTORY_PREFIX = "#huff-reqinv#"; // first part of request for inventory list. -string REPORT_AVAILABLE_SCRIPTS = "#scripts#"; // server's keyword to let client know script inventory. -string REQUEST_SCRIPT_UPDATE = "#updatego#"; // keyword used by client to request some updates. -string SHUT_THEM_DOWN = "#huffdown#"; // server tells client to stop any non-updater scripts. -string READY_TO_UPDATE = "#listoneeds#"; // the client tells the server the scripts it wants. -string SCRIPTS_ARE_CURRENT = "#gottemthx#"; // client says this when all new scripts are in place. -string START_THEM_UP = "#huffup#"; // server tells client to start up other scripts again. -string DONE_UPDATING = "#finito#"; // the client is done updating. -string BUSY_BUSY = "#busymuch#"; // a signal that the server is too busy to update us. - -integer UPDATER_SCRIPT_PIN = -1231008; // the hook for our scripts to be modified. - -string RESTART_UPDATER_COMMAND = "#restart"; // said in open chat to recrank the updater. -string SHOW_SCRIPTS_COMMAND = "#show"; // said in open chat to list out the scripts. -string SHUTDOWN_COMMAND = "#destroy"; // shuts down object and destroys it. - -string UPDATER_PARM_SEPARATOR = "~~~"; - // three tildes is an uncommon thing to have otherwise, so we use it to separate - // our commands in linked messages. - -string SCRIPT_DEPENDENCY_MARK = "DEP"; // signals that a dependency is coming. - -integer ENTRIES_PER_LINE = 4; // number of items from a list shown on one line of text. - -integer MAXIMUM_ACTIVE_CLIENTS = 5; // number of conversations we will allow at a time. - -float LONGEST_SLACK_PER_CLIENT = 84.0; - // we allow a client to be out of touch with us for this many seconds. after that, - // we decide it's deceased and remove it from our list. - -integer MESSAGE_SIZE_LIMIT = 800; // longest thing that can be safely said without clipping (guess). - -float SCRIPT_LIST_PAUSE_INTERVAL = 1.4; // pause between large chunks of update text. - -string ITEM_LIST_SEPARATOR = "``"; // separates dependencies. - -float CHANGED_INVENTORY_SNOOZER = 7.0; - // the number of seconds we sleep once we see an inventory change. we don't want to - // react to this immediately. this overrides the normal announcement cycle until it's - // dealt with by the timer. - -string CONTINUANCE_MARKER = "..."; - // a string sent when the update list is too long and needs to be continued in another chat. - -string UPDATER_BASE_NAME = "huff-update client"; - // the name of the updater script that keeps everything in sync. - -////////////// - -// global variables... - -list scripts_available; // the list of scripts we have in our inventory for distribution. -list objects_available; // list of objects for handing out. - -list active_clients; // list of keys for clients that are updating currently. -list active_update_channels; // active conversations on client chosen channels. -list active_listen_ids; // the ids for the listener on those channels. -list active_timestamps; // tracks when the client was last active. - -integer inventory_request_channel; // our personal channel that the update client should talk with. - -integer dealing_with_change; // has the inventory changed? we will deal with this in the timer. - -// displays the status of the update server. -show_status(key who_says) -{ - string title = "[mem free=" + (string)llGetFreeMemory() + "]"; - title = "Listening for requests on channel " + (string)inventory_request_channel; - if (llGetListLength(active_update_channels)) - title += "\nactive channels=" - + dump_list(active_update_channels, FALSE, ENTRIES_PER_LINE); - else - title += "\nNo channels active."; - - if (llGetListLength(active_clients)) - title += "\nactive clients=" + dump_keyed_list(active_clients, TRUE, 2); - else - title += "\nNo clients active."; - - if (llGetOwner() == who_says) { - string addition = " "; - if (USER_COMMAND_CHANNEL != 0) addition = "/" + (string)USER_COMMAND_CHANNEL + " "; - title += "\n[ \"" + addition + SHOW_SCRIPTS_COMMAND + "\" lists all the scripts, " - + "\"" + addition + SHUTDOWN_COMMAND + "\" zaps the updater, " - + "\"" + addition + RESTART_UPDATER_COMMAND + "\" refreshes the updater ]"; - } - - llWhisper(0, title); -} - -// plink a quietous string of resonance... -squonk(integer indy) -{ - string snd = llGetInventoryName(INVENTORY_SOUND, indy); - if (snd != "") llTriggerSound(snd, 1.0); -} - -// list out the scripts that the server's object contains. -show_scripts() -{ - string title = (string)llGetListLength(scripts_available) + " scripts available:"; - show_list(title, scripts_available); - title = (string)llGetListLength(objects_available) + " objects available:"; - show_list(title, objects_available); -} - -// lets the client know that we're here and have some scripts available. -announce_presence() -{ - if (llGetListLength(active_clients) < MAXIMUM_ACTIVE_CLIENTS) { - // only announce if we're not already booked up. - llWhisper(UPDATE_ANNOUNCEMENT_CHANNEL, UPDATE_ANNOUNCEMENT_PREFIX + (string)inventory_request_channel); - } -} - -// lifted from "clear text and effects" script; should be nearly identical -// to that, except that we set the texture animation. -reset_all_effects() -{ - llSetText("", <0,0,0>, 0); // clear any text above object. - llSetSitText("Sit Here"); // reset sit text to default state. - llSetTouchText("Touch"); // similarly for touch. - llSitTarget(ZERO_VECTOR, ZERO_ROTATION); // reset sit target position. - llParticleSystem([]); // turn off all particles. - llSensorRemove(); // stop any running sensors. - llTargetOmega(<0.0, 0.0, 0.0>, 0, 1.0); // stop rotations of object. - llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); // turn off any transparency. - // keep it from being physical and from disapparating. - llSetPrimitiveParams([PRIM_TEMP_ON_REZ, FALSE, PRIM_PHYSICS, FALSE, - PRIM_PHANTOM, TRUE]); - llSetLinkColor(LINK_SET, <1.0, 1.0, 1.0>, ALL_SIDES); // reset color to white. - - // - // the following are specific to the huffotronic update server. - // - - // we re-assert our special texture set here, in case some wayward scripts have - // messed with us. - integer textures_held = llGetInventoryNumber(INVENTORY_TEXTURE); - integer indy; - for (indy = 0; indy < textures_held; indy++) { - string curr_tex = llGetInventoryName(INVENTORY_TEXTURE, indy); - // we have a simple scheme for putting textures on the updater. - // we have an inside, an outside and the ends. - if (is_prefix(curr_tex, "~~s0")) { - llSetTexture(curr_tex, ALL_SIDES); - } else if (is_prefix(curr_tex, "~~s1")) { - llSetTexture(curr_tex, 1); - } else if (is_prefix(curr_tex, "~~s2")) { - llSetTexture(curr_tex, 0); - llSetTexture(curr_tex, 3); - } - } - - // re-assert our texture animation also. - llSetTextureAnim(ANIM_ON | LOOP | SMOOTH | ROTATE, - ALL_SIDES, 0, 0, 0, TWO_PI, 1.0 / 36.0); -} - -// set up the update server object. -initialize_root() -{ - // set up our particular "look". - reset_all_effects(); - - // shut down any competing scripts in this object. - // we try to swat any other script that's been added before we let them do weird - // stuff. for example, a pet script might start acting like one. this - // function is not guaranteed to run before that bad stuff can happen, - // and that's maybe the one major issue with this approach. as long as - // the contained scripts aren't evil (like if they jump someplace else - // as soon as they start), then there shouldn't be any serious problems. - knock_down_other_scripts(); - - // reset our variables. - active_update_channels = []; - active_listen_ids = []; - active_clients = []; - active_timestamps = []; - scripts_available = []; - objects_available = []; - dealing_with_change = FALSE; // not handling any inventory changes. - - // make sure we know about any scripts that have new dependencies. - load_script_deps(); - - // clean out any older versions of the scripts before we make our - // inventory. - destroy_older_versions(); - - // now accumulate the list of scripts in our inventory. - integer items_held = llGetInventoryNumber(INVENTORY_SCRIPT); - integer indy; - for (indy = 0; indy < items_held; indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - // we don't provide our own script for updating; it must be kept from - // floating around, like into other objects that are not updaters. -//// if (curr_script != llGetScriptName()) - scripts_available += curr_script; - } - items_held = llGetInventoryNumber(INVENTORY_OBJECT); - for (indy = 0; indy < items_held; indy++) { - objects_available += llGetInventoryName(INVENTORY_OBJECT, indy); -//log_it("added obj: " + llGetInventoryName(INVENTORY_OBJECT, indy)); - } - items_held = llGetInventoryNumber(INVENTORY_NOTECARD); - for (indy = 0; indy < items_held; indy++) { - objects_available += llGetInventoryName(INVENTORY_NOTECARD, indy); -//log_it("added note: " + llGetInventoryName(INVENTORY_NOTECARD, indy)); - } - - // listen to the owner. - llListen(USER_COMMAND_CHANNEL, "", llGetOwner(), ""); - // listen for any requests from our loyal clients. - inventory_request_channel = random_channel(); - llListen(inventory_request_channel, "", NULL_KEY, ""); - // listen for older clients too. - llListen(OLD_REQUEST_INVENTORY_CHANNEL, "", NULL_KEY, ""); - - // set up the periodic announcements. - llSetTimerEvent(ANNOUNCEMENT_PERIOD); -} - -handle_timer() -{ - if (dealing_with_change) { - dealing_with_change = FALSE; - state rerun; // zoom back to the starting point. - } - integer indy; - integer timecheck = llGetUnixTime(); // use for whole loop. - for (indy = llGetListLength(active_timestamps) - 1; indy >= 0; indy--) { - integer last_time = llList2Integer(active_timestamps, indy); - if (llAbs(last_time - timecheck) > LONGEST_SLACK_PER_CLIENT) { - // we need to clear out this item. we know we can whack the client - // at the same index and that will take care of this slacker. - key curr_key = llList2Key(active_clients, indy); - log_it("timed-out client: " + llKey2Name(curr_key) + " [" + (string)curr_key + "]"); - remove_client(curr_key); - } - } - - // let the objects nearby know that we are open for business by - // announcing the script inventory. - announce_presence(); -} - -// turns a list into a nicely formatted string. -string dump_list(list to_show, integer initial_line_break, integer entries_per_line) -{ - string msg; - integer indy; - for (indy = 0; indy < llGetListLength(to_show); indy++) { - // we break every Nth entry, but not if it's the first line and - // they said to not have the initial line break. - if ( !(indy % entries_per_line) && (indy || initial_line_break) ) - msg += "\n"; - string cursc = llList2String(to_show, indy); - msg += cursc; - // add commas where needed. - if (indy < llGetListLength(to_show) - 1) - msg += ", "; - } - return msg; -} - -// similar to dump_keyed_list, but only shows the names, each on their own line. -string dump_names_for_keys(list to_show) -{ - string msg; - integer indy; - for (indy = 0; indy < llGetListLength(to_show); indy++) { - // we only line break after the first entry. - if (indy > 0) msg += "\n"; - string keystr = llList2String(to_show, indy); - msg += llKey2Name(keystr); - } - return msg; -} - -// similar to dump_list -string dump_keyed_list(list to_show, integer initial_line_break, integer entries_per_line) -{ - string msg; - integer indy; - for (indy = 0; indy < llGetListLength(to_show); indy++) { - // we break every Nth entry, but not if it's the first line and - // they said to not have the initial line break. - if ( !(indy % entries_per_line) && (indy || initial_line_break) ) - msg += "\n"; - string keystr = llList2String(to_show, indy); - msg += llKey2Name(keystr) + " (" + keystr + ")"; - // add commas where needed. - if (indy < llGetListLength(to_show) - 1) - msg += ", "; - } - return msg; -} - -// shows the list specified in a compact manner. -show_list(string title, list to_show) -{ - string to_say = title + dump_list(to_show, TRUE, ENTRIES_PER_LINE); - // flush some memory. - title = ""; - to_show = []; - integer indy; - // say the output in pieces to avoid over-clogging chat. - for (indy = 0; indy < llStringLength(to_say); indy += MESSAGE_SIZE_LIMIT) { - integer last_indy = indy + MESSAGE_SIZE_LIMIT - 1; - string addition; - if (last_indy < llStringLength(to_say)) addition = CONTINUANCE_MARKER; - llWhisper(0, llGetSubString(to_say, indy, last_indy) + addition); - } -} - -// stops all the scripts besides this one. -knock_down_other_scripts() -{ - // set all scripts but this to not be running. - integer indy; - string self_script = llGetScriptName(); - list split = compute_basename_and_version(self_script); - string self_base = llList2String(split, 0); - self_script = ""; split = []; // free memory. - integer count = llGetInventoryNumber(INVENTORY_SCRIPT); - // we set all other scripts that are not versions of this script to not be running. - for (indy = 0; indy < count; indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - if (!is_prefix(curr_script, self_base) - && !is_prefix(curr_script, UPDATER_BASE_NAME) ) { - llSetScriptState(curr_script, FALSE); - } - } -} - -// set a text label on the updater with the list of clients. -set_our_label() -{ - string label = ""; - if (llGetListLength(active_clients) > 0) label = "[updating]\n"; - llSetText(label + dump_names_for_keys(active_clients), <0.8, 0.95, 0.92>, 1.0); -} - -// clean out a client that we should be done with. -remove_client(key id) -{ - // locate said client of deceased nature... - integer indy = find_in_list(active_clients, id); - if (indy < 0) { -// if (DEBUGGING) log_it("failure to find client to remove: " + (string)id); - return; - } - active_clients = llDeleteSubList(active_clients, indy, indy); - // also clean out the channel and stop listening to it. -integer act_chan = llList2Integer(active_update_channels, indy); - active_update_channels = llDeleteSubList(active_update_channels, indy, indy); - integer listen_to_remove = llList2Integer(active_listen_ids, indy); -//log_it("remove listen " + (string)listen_to_remove + " on chan " + (string)act_chan); - llListenRemove(listen_to_remove); - active_listen_ids = llDeleteSubList(active_listen_ids, indy, indy); - active_timestamps = llDeleteSubList(active_timestamps, indy, indy); - set_our_label(); -} - -// fix a partial match to a script name if we can't find the exact item. -string backpatch_script_name(string partial) -{ - if (llGetInventoryType(partial) == INVENTORY_SCRIPT) return partial; // all set. - integer dep_indy; - for (dep_indy = 0; dep_indy < llGetInventoryNumber(INVENTORY_SCRIPT); dep_indy++) { - string curr_name = llGetInventoryName(INVENTORY_SCRIPT, dep_indy); - if (is_prefix(curr_name, partial)) { -// log_it("found real name " + curr_name + " for part: " + partial); - return curr_name; - } - } -// log_it("no matches for partial script name!"); - return ""; // no matches! -} - -// moves the upgrade process with "id" along to the next step given the request in -// the message. -propel_upgrade_process(integer channel, key id, string message) -{ - if (DEBUGGING) log_it("got upgrade note from " + (string)id + " with msg=" + message); - if (message == REQUEST_SCRIPT_UPDATE) { - // begins the update process with the client. - llSay(channel, SHUT_THEM_DOWN); - } else if (is_prefix(message, READY_TO_UPDATE)) { - // whack the prefix so we can get the list they want. - message = llDeleteSubString(message, 0, llStringLength(READY_TO_UPDATE) - 1); - list requests = llParseString2List(message, [UPDATER_PARM_SEPARATOR], []); - message = ""; - // send over the scripts the client asked for, since it seems to be ready for them. - if (llGetListLength(requests)) { - show_list("updating " + llKey2Name(id) + " (key " + (string)id + ") with", requests); - integer indy; - for (indy = 0; indy < llGetListLength(requests); indy++) { - string curr = llList2String(requests, indy); - if (find_in_list(objects_available, curr) >= 0) { -//log_it("handing object over: " + curr); - // it's an object, so treat it that way. - llGiveInventory(id, curr); - } else { -//log_it("handing script over: " + curr); - // assume it's a script, and use script pin to stuff it. - curr = backpatch_script_name(curr); - if (curr != "") { - // second life was okay with scripts being plugged in unstarted; opensim is not. - // and second life appears to be unhappy when scripts are added to objects in - // a running state. so we have an impasse. so 'running' should be true - // for opensim, and false for second life. - integer running = IS_OPENSIM; -// if (DEBUGGING) log_it("installing script using updater pin."); - llRemoteLoadScriptPin(id, curr, UPDATER_SCRIPT_PIN, running, 0); - } - } - } - } - } else if (message == SCRIPTS_ARE_CURRENT) { - // the client thinks it's ready to get back up and running. -//log_it("heard client is ready!"); - llSay(channel, START_THEM_UP); - // kludge for older clients (pre 10.4 version) to try to help them start up. -//old and not useful. llSleep(0.2); llSay(channel, START_THEM_UP); llSleep(0.2); llSay(channel, START_THEM_UP); - remove_client(id); - } else if (message == DONE_UPDATING) { - // this client has nothing to do for now. -//log_it("heard client is done: " + (string)id); - remove_client(id); - } else { -//log_it("weird note from client: " + message); - return; // not used. - } - -} - -// blasts out the inventory list to a curious client. -spew_inventory_list(integer channel, string message, key id) -{ - if (!is_prefix(message, REQUEST_INVENTORY_PREFIX)) { - - // this is an old style update alert that we still use at startup of the client - // to ensure that finishing replacement of the updater script is never unnoticed. - if (is_prefix(message, DONE_UPDATING)) { -// if (DEBUGGING) log_it("found very special message from startup of updater."); - propel_upgrade_process(channel, id, message); - } - - // argh, this is not the right kind of message on our channel. - return; - } - string chan_str = llDeleteSubString(message, 0, llStringLength(REQUEST_INVENTORY_PREFIX) - 1); - integer new_update_channel = (integer)chan_str; - if (llGetListLength(active_clients) >= MAXIMUM_ACTIVE_CLIENTS) { - // got to tell them "not right now". we'll pretend we have no - // scripts; they'll know what we mean if the update client is - // recent enough. really old clients will just go to sleep until later. - if (DEBUGGING) log_it("having to disallow new client '" + llKey2Name(id) + "', too many now."); - llSay(new_update_channel, REPORT_AVAILABLE_SCRIPTS + BUSY_BUSY); - return; - } - - // looks like we're going to try to handle the request for them. - if (DEBUGGING) log_it("server heard update req on chan " + (string)channel + " from: " + llKey2Name(id)); - -//log_it("add client convo chan " + (string)new_update_channel); - integer existing_indy = find_in_list(active_clients, id); - if (existing_indy < 0) { - active_clients += id; - active_update_channels += new_update_channel; - integer new_listen_id = llListen(new_update_channel, "", id, ""); -//log_it("add listen " + (string)new_listen_id + " on chan " + (string)new_update_channel); - active_listen_ids += new_listen_id; - active_timestamps += llGetUnixTime(); - set_our_label(); - } else { -// if (DEBUGGING) log_it("same client came back before finishing previous upgrade, rolling with it."); - // delete old listener so we don't leave it dangling. - integer old_listen_id = llList2Integer(active_listen_ids, existing_indy); -//log_it("remove old listen " + (string)old_listen_id); - llListenRemove(old_listen_id); - // update the channel and listener id for the new registration. - active_update_channels = chop_list(active_update_channels, 0, existing_indy - 1) - + [ new_update_channel ] - + chop_list(active_update_channels, existing_indy + 1, - llGetListLength(active_update_channels) - 1); - integer new_listen_id = llListen(new_update_channel, "", id, ""); -//log_it("add new listen " + (string)new_listen_id); - active_listen_ids = chop_list(active_listen_ids, 0, existing_indy - 1) - + [ new_listen_id ] - + chop_list(active_listen_ids, existing_indy + 1, - llGetListLength(active_listen_ids) - 1); - active_timestamps = chop_list(active_timestamps, 0, existing_indy - 1) - + [ new_listen_id ] - + chop_list(active_timestamps, existing_indy + 1, - llGetListLength(active_timestamps) - 1); - } - - // our report name is always called available scripts, but it can actually have - // script dependency definitions, script names and object names. - string msg = REPORT_AVAILABLE_SCRIPTS; - string curr; // temp. - - // add in the huff updater, since that's the most crucial that they know we have. - integer posn; - string UPDATE_CLIENT_SCRIPT = "huff-update client"; - for (posn = 0; posn < llGetListLength(scripts_available); posn++) { - curr = llList2String(scripts_available, posn); - if (llDeleteSubString(curr, llStringLength(UPDATE_CLIENT_SCRIPT), -1) - == UPDATE_CLIENT_SCRIPT) { -//log_it("found " + curr); - msg += curr + UPDATER_PARM_SEPARATOR; - posn = 99999; // jump out. - } - if (DEBUGGING && (posn == llGetListLength(scripts_available) - 1) ) { - log_it("epic fail, found no updater client script."); - } - } - - // speak about the dependencies that we know. - for (posn = 0; posn < llGetListLength(known_script_dependencies); posn++) { - msg += SCRIPT_DEPENDENCY_MARK - + llList2String(known_script_dependencies, posn) + UPDATER_PARM_SEPARATOR; - if (llStringLength(msg) > MESSAGE_SIZE_LIMIT - 50) { - llSay(new_update_channel, msg + CONTINUANCE_MARKER); -//log_it(msg + CONTINUANCE_MARKER); - llSleep(SCRIPT_LIST_PAUSE_INTERVAL); - msg = REPORT_AVAILABLE_SCRIPTS; - } - } - // tell this new client what scripts we have. - for (posn = 0; posn < llGetListLength(scripts_available); posn++) { - curr = llList2String(scripts_available, posn); - if (llDeleteSubString(curr, llStringLength(UPDATE_CLIENT_SCRIPT), -1) - != UPDATE_CLIENT_SCRIPT) { - // add in the next item, along with the parameter separator. - msg += curr + UPDATER_PARM_SEPARATOR; -//log_it("adding " + curr); - if (llStringLength(msg) > MESSAGE_SIZE_LIMIT - 50) { - llSay(new_update_channel, msg + CONTINUANCE_MARKER); -//log_it(msg + CONTINUANCE_MARKER); - if (channel == OLD_REQUEST_INVENTORY_CHANNEL) { - // stop sending the list to them since they may not know how - // to interpret a multiple part update list. - return; - } - llSleep(SCRIPT_LIST_PAUSE_INTERVAL); - msg = REPORT_AVAILABLE_SCRIPTS; - } - } - } - // mention any objects that are available. - for (posn = 0; posn < llGetListLength(objects_available); posn++) { - // add in the next item, along with the parameter separator. - msg += llList2String(objects_available, posn) - + UPDATER_PARM_SEPARATOR; - if (llStringLength(msg) > MESSAGE_SIZE_LIMIT - 50) { - llSay(new_update_channel, msg + CONTINUANCE_MARKER); -//log_it(msg + CONTINUANCE_MARKER); - llSleep(SCRIPT_LIST_PAUSE_INTERVAL); - msg = REPORT_AVAILABLE_SCRIPTS; - } - } - // say final bit, even if it's mostly blank. we need to let them know - // that we're done and not adding that continuation flag string. - llSay(new_update_channel, msg); -} - -// handles verbal commands from objects that want updates. -process_verbal_requests(integer channel, string name, key id, string message) -{ - if ( (channel == OLD_REQUEST_INVENTORY_CHANNEL) || (channel == inventory_request_channel) ) { - spew_inventory_list(channel, message, id); - return; - } else if (channel == USER_COMMAND_CHANNEL) { -if (DEBUGGING) log_it("heard orders: " + message); - // simple verbal commands. - if (message == RESTART_UPDATER_COMMAND) { - log_it("Restarting now."); - llResetScript(); - } else if (message == SHOW_SCRIPTS_COMMAND) { - show_scripts(); - } else if (message == SHUTDOWN_COMMAND) { - // we will de-rez now (i.e., die) if we are not one of the special names that is undying. - if (!matches_substring(llGetObjectName(), "keeper")) { -// log_it("server " + (string)inventory_request_channel + " now disintegrating."); - squonk(1); - llDie(); - } - } - return; - } - - integer indy; - // see if the channel is for one of our valid updates that's in progress. - for (indy = 0; indy < llGetListLength(active_update_channels); indy++) { - integer cur_chan = llList2Integer(active_update_channels, indy); - if (cur_chan == channel) { - // yes, this is really for that guy. - propel_upgrade_process(channel, id, message); - return; - } - } -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - // tell this to the owner. -// llOwnerSay(llGetDate() + ": " + llGetScriptName() + "[" + (string)debug_num + "] " + to_say); -llWhisper(0, llGetDate() + ": " + llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on an unusual channel for chat if it's not intended for general public. -// llSay(108, llGetDate() + ": " + llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on open chat that anyone can hear. we take off the bling for this one. -// llSay(0, to_say); -} - -// returns TRUE if the "pattern" is found in the "full_string". -integer matches_substring(string full_string, string pattern) -{ return (find_substring(full_string, pattern) >= 0); } - -// returns the index of the first occurrence of "pattern" inside -// the "full_string". if it is not found, then a negative number is returned. -integer find_substring(string full_string, string pattern) -{ return llSubStringIndex(llToLower(full_string), llToLower(pattern)); } - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return find_substring(compare_with, prefix) == 0; } - -// joins a list of parameters using the parameter sentinel for the library. -string wrap_parameters(list to_flatten) -{ return llDumpList2String(to_flatten, UPDATER_PARM_SEPARATOR); } - -// locates the string "text" in the list to "search_in". -integer find_in_list(list search_in, string text) -{ - integer len = llGetListLength(search_in); - integer i; - for (i = 0; i < len; i++) { - if (llList2String(search_in, i) == text) - return i; - } - return -1; -} - -// returns the portion of the list between start and end, but only if they are -// valid compared with the list length. an attempt to use negative start or -// end values also returns a blank list. -list chop_list(list to_chop, integer start, integer end) -{ - integer last_len = llGetListLength(to_chop) - 1; - if ( (start < 0) || (end < 0) || (start > last_len) || (end > last_len) ) return []; - return llList2List(to_chop, start, end); -} - -// a random channel for the first interaction with the client. -integer random_channel() { return -(integer)(llFrand(800000) + 20000); } - -// note that this new, lower memory version, depends on the inventory functions returning -// items in alphabetical order. -scrub_items_by_type(string this_guy, integer inventory_type) -{ - list removal_list; - integer outer; - for (outer = 0; outer < llGetInventoryNumber(inventory_type); outer++) { - string curr = llGetInventoryName(inventory_type, outer); - list split = compute_basename_and_version(curr); - // make sure there was a comparable version number in this name. - if ( (curr != this_guy) && llGetListLength(split)) { - string curr_base = llList2String(split, 0); - float curr_ver = (float)llList2String(split, 1); -//log_it("outer: " + curr_base + " / " + (string)curr_ver); - integer inner; - for (inner = outer + 1; inner < llGetInventoryNumber(inventory_type); inner++) { - string next_guy = llGetInventoryName(inventory_type, inner); - list comp_split = compute_basename_and_version(next_guy); - if (llGetListLength(comp_split)) { - string comp_base = llList2String(comp_split, 0); - float comp_ver = (float)llList2String(comp_split, 1); - // okay, now we can actually compare. - if (curr_base != comp_base) { - // break out of inner loop. we are past where the names can matter. - inner = 2 * llGetInventoryNumber(inventory_type); - } else { -//log_it("inner: " + comp_base + " / " + (string)comp_ver); - if (curr_ver <= comp_ver) { - // the script at inner index is comparable or better than - // the script at the outer index. - removal_list += curr; - } else { - // this inner script must be inferior to the outer one, - // somehow, which defies our expectation of alphabetical ordering. - removal_list += next_guy; - } - } - } - } - } - } - - // now actually do the deletions. - for (outer = 0; outer < llGetListLength(removal_list); outer++) { - string to_whack = llList2String(removal_list, outer); - log_it("removing older asset: " + to_whack); - llRemoveInventory(to_whack); - } - - if (IS_OPENSIM && (llGetListLength(removal_list) > 0) ) { -// log_it("now restarting to avoid opensim late updating change event."); - llResetScript(); - } -} - -// ensures that only the latest version of any script or object is kept in our inventory. -destroy_older_versions() -{ - // firstly, iterate across scripts to clean out older versions. - scrub_items_by_type(llGetScriptName(), INVENTORY_SCRIPT); - // secondly, try to clean out the objects. - scrub_items_by_type(llGetScriptName(), INVENTORY_OBJECT); - // thirdly, try to clean out the notecards. - scrub_items_by_type(llGetScriptName(), INVENTORY_NOTECARD); -} - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.4. -// distributed under BSD-like license. -// partly based on the self-upgrading scripts from markov brodsky and jippen faddoul. -// the function auto_retire() should be added *inside* a version numbered script that -// you wish to give the capability of self-upgrading. -// this script supports a notation for versions embedded in script names where a 'v' -// is followed by a number in the form "major.minor", e.g. "grunkle script by ted v8.2". -// when the containing script is dropped into an object with a different version, the -// most recent version eats any existing ones. -// keep in mind that this code must be *copied* into your script you wish to add -// auto-retirement capability to. -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -// end hufflets. -////////////// - -default -{ - state_entry() - { - auto_retire(); - initialize_root(); // get set up to start answering requests. - llWhisper(0, llGetScriptName() + " started... touch for more info."); - squonk(0); - } - - state_exit() { llSetTimerEvent(0); } - - on_rez(integer parm) { - state rerun; - } - - timer() { handle_timer(); } - - touch_start(integer count) { - show_status(llDetectedKey(0)); - } - - listen(integer channel, string name, key id, string message) { - // make sure that the object is something we should even talk to. - if (llGetOwnerKey(id) != llGetOwner()) { - return; - } - // looks okay, let's see if this is useful communication. - process_verbal_requests(channel, name, id, message); - } - - changed(integer change) { - if (change & CHANGED_INVENTORY) { - log_it("inventory changed, scheduled a restart."); - // sleep a little bit; otherwise we get SL noise about scripts not being - // there when it told us they were there. this can lead to some scripts - // doing bizarre things if they are running when added. - dealing_with_change = TRUE; - llSetTimerEvent(0.0); // kludge to get around second life bug. - llSetTimerEvent(CHANGED_INVENTORY_SNOOZER); - } - } -} - -state rerun { state_entry() { state default; } } - diff --git a/huffware/huffotronic_jaunter_updater/data_cow_v3.3.txt b/huffware/huffotronic_jaunter_updater/data_cow_v3.3.txt deleted file mode 100755 index c03cb4c5..00000000 --- a/huffware/huffotronic_jaunter_updater/data_cow_v3.3.txt +++ /dev/null @@ -1,227 +0,0 @@ - -// huffware script: data cow, by fred huffhines. -// -// a data cow is a script that manages a list of text items. it allows an object -// to offload the memory burden of managing a list of items, since LSL is very tight -// on memory, even when compiled to mono. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// global variables. - -list the_list; - // the main list that we manage here. we support adding to it, retrieving it - // and modifying it via our API. -list the_names; - // the short names for each item in our list. we are basically supporting a - // symbol table data structure here. - -// link message API for the data cow library. -////////////// -// do not redefine these constants. -integer DATA_COW_HUFFWARE_ID = 10017; - // the unique id within the huffware system for the jaunt script to - // accept commands on. this is used in llMessageLinked as the num parameter. -string HUFFWARE_PARM_SEPARATOR = "{~~~}"; - // this pattern is an uncommon thing to see in text, so we use it to separate - // our commands in link messages. -///string HUFFWARE_ITEM_SEPARATOR = "{|||}"; - // used to separate lists of items from each other when stored inside a parameter. - // this allows lists to be passed as single string parameters if needed. -integer REPLY_DISTANCE = 100008; // offset added to service's huffware id in reply IDs. -////////////// -// -string RESET_LIST_COMMAND = "reset_L"; - // flushes out the currently held list. does not send a reply. -string ADD_ITEM_COMMAND = "add_I"; - // adds items to the list. this is a list of pairs of name/value, where the name is - // how the item will be looked up from the list, and the value is the contents to be stored. - // this command has no reply. -string REMOVE_ITEM_COMMAND = "rm_I"; - // accepts a list of names for items. all the mentioned ones will be removed from the list. - // this command also has no reply. -string GET_COW_LENGTH = "get_Lc"; - // returns a single integer which is the length of the cow's list currently. -string GET_ITEM_COMMAND = "get_I"; - // retrieves the item's contents for a given name. first parm is the name. if there - // are other parameters, then they are taken as other items to return also. - // the return data will be pairs of for each of the names in the request - // that is not empty. note that you can use an integer index by prefacing it with a - // '#' sign. for example, asking for item "#32" will return index 32 in the list of items. -string TAGGED_GET_ITEM_COMMAND = "get_T"; - // like get item, except the first parameter is an identifier that the caller wants to - // use to tag this request. the other parameters are still taken as names. the response - // will contain the tag as the first item, then the pairs that were found. -////////////// - -// sets up the data cow for business. -initialize() -{ - // flush all contents. - the_list = []; - the_names = []; -} - -// find a named item in our list, if it exists. -integer lookup_item(string name) -{ - integer indy; - if (llGetSubString(name, 0, 0) == "#") { - // our special sign for just using an index. - indy = (integer)llGetSubString(name, 1, -1); - if ( (indy >= 0) && (indy < llGetListLength(the_names)) ) return indy; - } else { - for (indy = 0; indy < llGetListLength(the_names); indy++) { - if (name == llList2String(the_names, indy)) return indy; // we know where it is now. - } - } - return -1; // never found it. -} - -// places a named item in our list. if there's an existing item with -// that name, then it's replaced. -integer global_mem_complained = FALSE; -add_item(string name, string content) -{ - if (llGetFreeMemory() < 2000) { - if (!global_mem_complained) { - global_mem_complained = TRUE; - llOwnerSay("out of memory at " + name); - } - return; - } - integer current = lookup_item(name); - if (current < 0) { -//llOwnerSay("new item: " + name); - // this is a new item. - the_names += name; - the_list += content; - } else { -//llOwnerSay("reusing slot " + (string)current + " for " + name); - // this is an old item to be replaced. - the_list = chop_list(the_list, 0, current - 1) - + [ content ] - + chop_list(the_list, current + 1, llGetListLength(the_list) - 1); - } -//log_it("mem=" + (string)llGetFreeMemory()); -} - -// deletes an existing item if possible. TRUE is returned on success. -integer remove_item(string name) -{ - integer indy = lookup_item(name); - if (indy < 0) return FALSE; // not present. - // found our sad whackee. we know the name and content should be - // stored at the exact same index in the two lists. - the_names = chop_list(the_names, 0, indy - 1) - + chop_list(the_names, indy + 1, llGetListLength(the_names) - 1); - the_list = chop_list(the_list, 0, indy - 1) - + chop_list(the_list, indy + 1, llGetListLength(the_list) - 1); - return TRUE; // all done here. -} - -// supports our link message API by answering requests from clients. -handle_link_message(integer sender, integer num, string msg, key id) -{ - if (num != DATA_COW_HUFFWARE_ID) return; // not for us. -//log_it("hlm--mem free=" + (string)llGetFreeMemory()); -//log_it("rcvd: " + msg + " " + (string)num + " " + (string)id); - if (msg == RESET_LIST_COMMAND) { - initialize(); - } else if (msg == ADD_ITEM_COMMAND) { - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); - integer indy; - for (indy = 0; indy < llGetListLength(parms); indy += 2) { - add_item(llList2String(parms, indy), llList2String(parms, indy + 1)); - } - } else if (msg == REMOVE_ITEM_COMMAND) { - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); - integer indy; - for (indy = 0; indy < llGetListLength(parms); indy++) { - remove_item(llList2String(parms, indy)); - } - } else if (msg == GET_COW_LENGTH) { - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); - string tag = llList2String(parms, 0); - list to_reply; - if (tag != "") to_reply = [ tag ]; - to_reply += [ llGetListLength(the_list) ]; - send_reply(LINK_THIS, to_reply, msg); - } else if ( (msg == GET_ITEM_COMMAND) || (msg == TAGGED_GET_ITEM_COMMAND) ) { - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); - integer indy; - string tag; - if (msg == TAGGED_GET_ITEM_COMMAND) { - // extract the tag, if they want that type of command handling. - tag = llList2String(parms, 0); - parms = llDeleteSubList(parms, 0, 0); - } - list to_reply; - // make sure we return the tag if they gave us one. - if (tag != "") to_reply = [ tag ]; - for (indy = 0; indy < llGetListLength(parms); indy++) { - // iterate through the parameters and reply about any that we find. - integer found_posn = lookup_item(llList2String(parms, indy)); - if (found_posn >= 0) { - // this item did exist. - to_reply += [ llList2String(the_names, found_posn), llList2String(the_list, found_posn) ]; - } - } - send_reply(LINK_THIS, to_reply, msg); - } -} - -////////////// -// from hufflets... -// -//integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -//log_it(string to_say) -//{ -// debug_num++; -// // tell this to the owner. -// llOwnerSay(llGetScriptName() + "[" + (string)debug_num + "] " + to_say); -// // say this on open chat, but use an unusual channel. -//// llSay(108, llGetScriptName() + "[" + (string)debug_num + "] " + to_say); -//} - -// returns the portion of the list between start and end, but only if they are -// valid compared with the list length. an attempt to use negative start or -// end values also returns a blank list. -list chop_list(list to_chop, integer start, integer end) -{ - integer last_len = llGetListLength(to_chop) - 1; - if ( (start < 0) || (end < 0) || (start > last_len) || (end > last_len) ) return []; - return llList2List(to_chop, start, end); -} - -// a simple version of a reply for a command that has been executed. the parameters -// might contain an outcome or result of the operation that was requested. -send_reply(integer destination, list parms, string command) -{ - llMessageLinked(destination, DATA_COW_HUFFWARE_ID + REPLY_DISTANCE, - command, llDumpList2String(parms, HUFFWARE_PARM_SEPARATOR)); -} - -// -// end hufflets -////////////// - -default -{ - state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } - on_rez(integer parm) { state rerun; } -} -state rerun { state_entry() { state default; } } - -state real_default -{ - state_entry() { initialize(); } - - link_message(integer sender, integer num, string msg, key id) - { handle_link_message(sender, num, msg, id); } -} - diff --git a/huffware/huffotronic_jaunter_updater/huff-update_client_v20.1.txt b/huffware/huffotronic_jaunter_updater/huff-update_client_v20.1.txt deleted file mode 100755 index 4a458bb5..00000000 --- a/huffware/huffotronic_jaunter_updater/huff-update_client_v20.1.txt +++ /dev/null @@ -1,826 +0,0 @@ - -// huffware script: huff-update client, by fred huffhines. -// -// this script is the client side of the update process. it should reside in an object that -// has scripts which should be automatically updated. it will listen for announcements by -// an update server and communicate with the server to ensure that all of its scripts are -// the most up to date available with the server. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// global constants... - -integer DEBUGGING = FALSE; // if TRUE, the script will output status information. - -integer SERVER_IGNORE_TIME = 1200; // number of seconds between performing an upgrade with the same server. - -integer MAXIMUM_UPDATE_TIME_ALLOWED = 140; // we allow one upgrade process to take this long overall. - -integer UPDATE_ANNOUNCEMENT_CHANNEL = -420108; // used by server to brag about itself. -integer OLD_REQUEST_INVENTORY_CHANNEL = -421008; // used by clients to request an update list. - -string UPDATE_ANNOUNCEMENT_PREFIX = "#huff-update#"; // first part of any announcement. -string REQUEST_INVENTORY_PREFIX = "#huff-reqinv#"; // first part of request for inventory list. -string REPORT_AVAILABLE_SCRIPTS = "#scripts#"; // server's keyword to let client know script inventory. -string REQUEST_SCRIPT_UPDATE = "#updatego#"; // keyword used by client to request some updates. -string SHUT_THEM_DOWN = "#huffdown#"; // server tells client to stop any non-updater scripts. -string READY_TO_UPDATE = "#listoneeds#"; // the client tells the server the scripts it wants. -string SCRIPTS_ARE_CURRENT = "#gottemthx#"; // client says this when all new scripts are in place. -string START_THEM_UP = "#huffup#"; // server tells client to start up other scripts again. -string DONE_UPDATING = "#finito#"; // the client is done updating. -string BUSY_BUSY = "#busymuch#"; // a signal that the server is too busy to update us. - -float UPDATE_TIMER_INTERVAL = 2.0; // interval between checks on our update status. - -integer UPDATER_SCRIPT_PIN = -1231008; // the hook for our scripts to be modified. - -///float BUSY_SERVER_PAUSE_TIME = 38.0; // num seconds to delay when server says it's too busy. - -string UPDATER_PARM_SEPARATOR = "~~~"; - // three tildes is an uncommon thing to have otherwise, so we use it to separate - // our commands in linked messages. - -string SCRIPT_DEPENDENCY_MARK = "DEP"; // signals that a dependency is coming. -string ITEM_LIST_SEPARATOR = "``"; // separates dependencies. - -integer MAXIMUM_SERVERS_TRACKED = 32; - // we will listen to this many servers before we decide to remove one. - -string CONTINUANCE_MARKER = "..."; - // a string sent when the update list is too long and needs to be continued in another chat. - -string SERVER_SCRIPT = "a huffotronic update server"; - // the prefix of our server script that hands out updates. - -// global variables... - -integer inventory_request_channel; // used for newer version servers to cut down cross chatter. -list updaters_heard; // the update servers we've heard from recently. -list last_interactions; // times of the last update process engaged with the updater. -integer update_channel; // current channel for interaction with specific server. -key current_server; // the updater that is active right now, if any. -integer update_start_time; // when the last update process began. -list updates_needed; // stores the set of scripts that are in need of an update. -list known_script_dependencies; // stores the list of dependency info. - -careful_crankup() -{ - knock_around_other_scripts(TRUE); - // clean out the older items and scripts. we do this after getting everyone running - // since we might be whacking ourselves. - destroy_older_versions(); -} - -// reset our variables. -initialize() -{ - updaters_heard = []; - last_interactions = []; - inventory_request_channel = 0; - update_channel = 0; - current_server = NULL_KEY; - llSetTimerEvent(0.0); - llSetRemoteScriptAccessPin(UPDATER_SCRIPT_PIN); - // a new enhancements; tells the server that this guy has finished an update cycle. this - // only comes into play when the updater script itself has just been updated, but it's - // nice for the server to avoid claiming erroneous timeouts occurred. - llSay(OLD_REQUEST_INVENTORY_CHANNEL, DONE_UPDATING); - llSleep(0.4); // snooze and repeat to overcome occasionally lossy chats. - llSay(OLD_REQUEST_INVENTORY_CHANNEL, DONE_UPDATING); -} - -whack_updater_record(key id) -{ - integer prev_indy = find_in_list(updaters_heard, id); - if (prev_indy < 0) return; // not there. - updaters_heard = chop_list(updaters_heard, 0, prev_indy - 1) - + chop_list(updaters_heard, prev_indy + 1, llGetListLength(updaters_heard) - 1); - last_interactions = chop_list(last_interactions, 0, prev_indy - 1) - + chop_list(last_interactions, prev_indy + 1, llGetListLength(last_interactions) - 1); -} - -// note that this new, lower memory version, depends on the inventory functions returning -// items in alphabetical order. -scrub_items_by_type(string this_guy, integer inventory_type) -{ - list removal_list; - integer outer; - for (outer = 0; outer < llGetInventoryNumber(inventory_type); outer++) { - string curr = llGetInventoryName(inventory_type, outer); - list split = compute_basename_and_version(curr); - // make sure there was a comparable version number in this name. - if ( (curr != this_guy) && llGetListLength(split)) { - string curr_base = llList2String(split, 0); - float curr_ver = (float)llList2String(split, 1); -//log_it("outer: " + curr_base + " / " + (string)curr_ver); - integer inner; - for (inner = outer + 1; inner < llGetInventoryNumber(inventory_type); inner++) { - string next_guy = llGetInventoryName(inventory_type, inner); - list comp_split = compute_basename_and_version(next_guy); - if (llGetListLength(comp_split)) { - string comp_base = llList2String(comp_split, 0); - float comp_ver = (float)llList2String(comp_split, 1); - // okay, now we can actually compare. - if (curr_base != comp_base) { - // break out of inner loop. we are past where the names can matter. - inner = 2 * llGetInventoryNumber(inventory_type); - } else { -//log_it("inner: " + comp_base + " / " + (string)comp_ver); - if (curr_ver <= comp_ver) { - // the script at inner index is comparable or better than - // the script at the outer index. - removal_list += curr; - } else { - // this inner script must be inferior to the outer one, - // somehow, which defies our expectation of alphabetical ordering. - removal_list += next_guy; - } - } - } - } - } - } - - // now actually do the deletions. - for (outer = 0; outer < llGetListLength(removal_list); outer++) { - string to_whack = llList2String(removal_list, outer); - if (DEBUGGING) - log_it("removing older asset: " + to_whack); - llRemoveInventory(to_whack); - } -} - -// ensures that only the latest version of any script or object is kept in our inventory. -destroy_older_versions() -{ - // firstly, iterate across scripts to clean out older versions. - scrub_items_by_type(llGetScriptName(), INVENTORY_SCRIPT); - // secondly, try to clean out the objects. - scrub_items_by_type(llGetScriptName(), INVENTORY_OBJECT); - // thirdly, try to clean out the notecards. - scrub_items_by_type(llGetScriptName(), INVENTORY_NOTECARD); -} - -// sets the object to be listening for update info. -// if "just_owner" is true, then we will not listen on the general announcement channel. -listen_for_orders(integer just_owner) -{ - if (!just_owner) { - // try to hear an update being announced. - llListen(UPDATE_ANNOUNCEMENT_CHANNEL, "", NULL_KEY, ""); - } - - // super secret owner controls. - llListen(0, "", llGetOwner(), ""); -} - -// returns true if this object is a huffotronic updater of some sort. -integer inside_of_updater() -{ - return find_substring(llGetObjectName(), "huffotronic") >= 0; -} - -// returns true if a script is a version of our update server. -integer matches_server_script(string to_check) -{ - return is_prefix(to_check, SERVER_SCRIPT); -} - -// stops all the scripts besides this one. -knock_around_other_scripts(integer running_state) -{ - integer insider = inside_of_updater(); - if (running_state == TRUE) { - // make sure we crank up the scripts that are new first. we want to reset them - // as well, which we don't want to do for any existing scripts. - integer crank_indy; - for (crank_indy = 0; crank_indy < llGetListLength(updates_needed); crank_indy++) { - string crankee = llList2String(updates_needed, crank_indy); - if (find_in_inventory(crankee, INVENTORY_SCRIPT, TRUE) >= 0) { - if (!insider || matches_server_script(crankee)) { - // allow it to run again. - llSetScriptState(crankee, TRUE); - // reset it, to make sure it starts at the top. - llResetOtherScript(crankee); - } - } - } - } - - integer indy; - string self_script = llGetScriptName(); - // we set all other scripts to the running state requested. - for (indy = 0; indy < llGetInventoryNumber(INVENTORY_SCRIPT); indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - if ( (curr_script != self_script) - && (!insider || matches_server_script(curr_script)) ) { - // this one seems ripe for being set to the state requested. - llSetScriptState(curr_script, running_state); - } - } -} - -// a random channel for the interaction with the server. -integer random_channel() { return -(integer)(llFrand(800000) + 20000); } - -// make sure that any dependencies for the script with "basename" are added to the list -// of requests we make during an update. -list add_dependencies(string basename) -{ - list to_return; - integer indy; - for (indy = 0; indy < llGetListLength(known_script_dependencies); indy++) { - list deps = llParseString2List(llList2String(known_script_dependencies, indy), - [ITEM_LIST_SEPARATOR], []); -//log_it("base=" + llList2String(dep, 0) + " lastver=" + llList2String(dep, 1) + " newdep=" + llList2String(dep, 2)); - if (basename == llList2String(deps, 0)) { - // first off, is this item with new dependencies actually present? - integer where = find_in_inventory(basename, INVENTORY_SCRIPT, FALSE); - if (where >= 0) { - // we do use the script with deps, but is the dependent item really missing? - where = find_in_inventory(llList2String(deps, 1), INVENTORY_SCRIPT, FALSE); - if (where < 0) { - // we found a dependency match for this script, so we'll ask for the missing item. - if (DEBUGGING) - log_it("missing dep: " + llList2String(deps, 1)); - to_return += [ llList2String(deps, 1) ]; - } - } - } - } - return to_return; -} - -// complains if memory seems to be getting tight. -test_memory() -{ - if (llGetFreeMemory() < 4096) - log_it("mem_free = " + (string)llGetFreeMemory()); -} - -// starts an update given a list of scripts that the server has available, encoded as -// a string in the "encoded_list". -integer initiate_update(string encoded_list) -{ - list scripts_avail = llParseString2List(encoded_list, [UPDATER_PARM_SEPARATOR], []); - integer continue_listening_for_scripts = FALSE; - // if true, we aren't done hearing about available scripts yet. - encoded_list = ""; - // figure out which scripts we need by comparing the list available from the server - // against our current inventory. we only want scripts with newer version numbers. - integer sindy; - for (sindy = 0; sindy < llGetListLength(scripts_avail); sindy++) { - string curr = llList2String(scripts_avail, sindy); - if (curr == CONTINUANCE_MARKER) { - // this is a special continuation signal. we need to hear the rest of the list. - continue_listening_for_scripts = TRUE; - } else if (is_prefix(curr, SCRIPT_DEPENDENCY_MARK)) { - // we've found a dependency item. - known_script_dependencies += [ llGetSubString(curr, llStringLength(SCRIPT_DEPENDENCY_MARK), -1) ]; -//log_it("script dep: " + llGetSubString(curr, llStringLength(SCRIPT_DEPENDENCY_MARK), -1)); - } else { - list split = compute_basename_and_version(curr); - if (llGetListLength(split) == 2) { - string basename = llList2String(split, 0); - string version = llList2String(split, 1); - split = []; - integer oy_indy; -//replace common code with func. - for (oy_indy = 0; oy_indy < llGetInventoryNumber(INVENTORY_OBJECT); oy_indy++) { - list srv_split = compute_basename_and_version - (llGetInventoryName(INVENTORY_OBJECT, oy_indy)); - if ( (llGetListLength(srv_split) == 2) - && (basename == llList2String(srv_split, 0)) - && ((float)version > (float)llList2String(srv_split, 1)) ) { -// if (DEBUGGING) { - log_it("i need '" + curr + "' from server " + (string)inventory_request_channel); -// } - test_memory(); - updates_needed += [ curr ]; - } - } - for (oy_indy = 0; oy_indy < llGetInventoryNumber(INVENTORY_NOTECARD); oy_indy++) { - list srv_split = compute_basename_and_version - (llGetInventoryName(INVENTORY_NOTECARD, oy_indy)); - if ( (llGetListLength(srv_split) == 2) - && (basename == llList2String(srv_split, 0)) - && ((float)version > (float)llList2String(srv_split, 1)) ) { - if (DEBUGGING) { - log_it("i need '" + curr + "' from server " + (string)inventory_request_channel); - } - test_memory(); - updates_needed += [ curr ]; - } - } - for (oy_indy = 0; oy_indy < llGetInventoryNumber(INVENTORY_SCRIPT); oy_indy++) { - list srv_split = compute_basename_and_version - (llGetInventoryName(INVENTORY_SCRIPT, oy_indy)); - if ( (llGetListLength(srv_split) == 2) - && (basename == llList2String(srv_split, 0)) - && ((float)version > (float)llList2String(srv_split, 1)) ) { - if (DEBUGGING) { - log_it("i need '" + curr + "' from server " + (string)inventory_request_channel); - } - test_memory(); - updates_needed += [ curr ]; - } - } - updates_needed += add_dependencies(basename); - } - } - } - // we skip the next step if we're still waiting to hear about more. - if (continue_listening_for_scripts) { -//log_it("still listening for more updates..."); - return FALSE; - } - if (llGetListLength(updates_needed)) { -//log_it("update chan=" + (string)update_channel); - llSay(update_channel, REQUEST_SCRIPT_UPDATE); - if (DEBUGGING) { - log_it("told server " + (string)inventory_request_channel + " that i need updating."); - } - } else { - if (DEBUGGING) { - log_it("told server " + (string)inventory_request_channel + " that i am done updating."); - } - llSay(update_channel, DONE_UPDATING); - } - return TRUE; -} - -// this alerts the server to our most desired scripts. -tell_server_our_wish_list() -{ - llSay(update_channel, READY_TO_UPDATE + wrap_parameters(updates_needed)); -} - -// checks whether all of the updates needed are present yet. -integer check_on_update_presence() -{ - integer indy; - for (indy = 0; indy < llGetListLength(updates_needed); indy++) { - integer found = find_in_inventory(llList2String(updates_needed, indy), INVENTORY_ALL, TRUE); - // any single missing guy means they aren't up to date yet. - if (found < 0) { - if (DEBUGGING) log_it(llList2String(updates_needed, indy) + " not seen as updated yet."); - return FALSE; - } - } - // nothing was detected as missing anymore. - return TRUE; -} - -// respond to spoken commands from the server. -integer process_update_news(integer channel, string name, key id, string message) -{ - if (!channel) { - // this is a command. - if (message == "ureset") { - llResetScript(); // start over. - } - if (message == "ushow") { - integer sindy; - integer script_count = llGetInventoryNumber(INVENTORY_SCRIPT); - list script_list = [ "scripts--" ]; // first item is just a header. - for (sindy = 0; sindy < script_count; sindy++) { - script_list += [ llGetInventoryName(INVENTORY_SCRIPT, sindy) ]; - } - dump_list_to_log(script_list); - } - return FALSE; // nothing to do here. - } - if (!update_channel && (channel == UPDATE_ANNOUNCEMENT_CHANNEL)) { -/* never seen. if (id == llGetKey()) { -if (DEBUGGING) log_it("ignoring update from self."); - return FALSE; // ack, that's our very object. - } -*/ - if (llStringLength(message) > llStringLength(UPDATE_ANNOUNCEMENT_PREFIX)) { - // this is a new style update message. we can set a different request channel. - string just_chan = llDeleteSubString(message, 0, llStringLength(UPDATE_ANNOUNCEMENT_PREFIX) - 1); - inventory_request_channel = (integer)just_chan; - } - integer prev_indy = find_in_list(updaters_heard, id); - // find the talker in our list. - if (prev_indy >= 0) { - // that guy was already heard from. check when last interacted. - integer last_heard = llList2Integer(last_interactions, prev_indy); - if (llAbs(llGetUnixTime() - last_heard) < SERVER_IGNORE_TIME) { - return FALSE; // not time to update with this guy again yet. - } -// if (DEBUGGING) { log_it("started listening again to server " + (string)id); } - // make sure we think of this as a new updater now. - whack_updater_record(id); - } - - if (DEBUGGING) { log_it("heard server " + (string)inventory_request_channel + "'s announcement."); } - // record our new server. - current_server = id; - // make a random pause so not all updaters try to crank up at same time. - llSleep(randomize_within_range(2.8, 18.2, FALSE)); - - if (llGetListLength(updaters_heard) > MAXIMUM_SERVERS_TRACKED) { - // oops, this is not good. we have too many servers now. -//hmmm: room for improvement here by tossing out the server that is oldest. - updaters_heard = llDeleteSubList(updaters_heard, 0, 0); - last_interactions = llDeleteSubList(last_interactions, 0, 0); - } - - // add the talker to our list. - updaters_heard += id; - last_interactions += llGetUnixTime(); - - // begin the update interaction with this guy. - update_channel = random_channel(); - return TRUE; - } - if (update_channel && (channel == update_channel) ) { - if (is_prefix(message, REPORT_AVAILABLE_SCRIPTS)) { - // tasty, this is a list of scripts that can be had. - message = llDeleteSubString(message, 0, llStringLength(REPORT_AVAILABLE_SCRIPTS) - 1); - if (message == BUSY_BUSY) { - // server has signified that it's too busy (or its owner is a moron) because it is - // claiming it has no scripts at all. - if (DEBUGGING) { - log_it("server " + (string)inventory_request_channel + " is too busy to update us now."); - } - // make it seem like we need to do this one again sooner than normal. - whack_updater_record(id); - // busy server means move no further forward. - return FALSE; - } - return initiate_update(message); - } else if (is_prefix(message, SHUT_THEM_DOWN)) { - if (DEBUGGING) { log_it("stopping other scripts."); } - knock_around_other_scripts(FALSE); - // now that we know for sure the server's ready to update us, - // we tell it what we need. - tell_server_our_wish_list(); - return FALSE; - } else if (is_prefix(message, START_THEM_UP)) { - // let the server know that we've finished, for all intents and purposes. - llSay(update_channel, DONE_UPDATING); - // we pause a random bit first; we want to ensure we aren't swamping - // SL with our inventory loading. - llSleep(randomize_within_range(2.5, 8.2, FALSE)); - if (DEBUGGING) { log_it("starting other scripts."); } - careful_crankup(); - return TRUE; // change state now. -// } else { -//log_it("unknown command on update channel: " + message); - } - } - return FALSE; -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - llWhisper(0, llGetScriptName() + " [" + (string)debug_num + "] (" + (string)llGetFreeMemory() + ") " + to_say); -} - -// returns a number at most "maximum" and at least "minimum". -// if "allow_negative" is TRUE, then the return may be positive or negative. -float randomize_within_range(float minimum, float maximum, integer allow_negative) -{ - if (minimum > maximum) { - // flip the two if they are reversed. - float temp = minimum; minimum = maximum; maximum = temp; - } - float to_return = minimum + llFrand(maximum - minimum); - if (allow_negative) { - if (llFrand(1.0) < 0.5) to_return *= -1.0; - } - return to_return; -} - -// returns TRUE if the "pattern" is found in the "full_string". -integer matches_substring(string full_string, string pattern) -{ return (find_substring(full_string, pattern) >= 0); } - -// returns the index of the first occurrence of "pattern" inside -// the "full_string". if it is not found, then a negative number is returned. -integer find_substring(string full_string, string pattern) -{ return llSubStringIndex(llToLower(full_string), llToLower(pattern)); } - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return find_substring(compare_with, prefix) == 0; } - -// locates the string "text" in the list to "search_in". -integer find_in_list(list search_in, string text) -{ - integer len = llGetListLength(search_in); - integer i; - for (i = 0; i < len; i++) { - if (llList2String(search_in, i) == text) - return i; - } - return -1; -} - -// returns the portion of the list between start and end, but only if they are -// valid compared with the list length. an attempt to use negative start or -// end values also returns a blank list. -list chop_list(list to_chop, integer start, integer end) -{ - integer last_len = llGetListLength(to_chop) - 1; - if ( (start < 0) || (end < 0) || (start > last_len) || (end > last_len) ) return []; - return llList2List(to_chop, start, end); -} - -// joins a list of parameters using the parameter sentinel for the library. -string wrap_parameters(list to_flatten) -{ return llDumpList2String(to_flatten, UPDATER_PARM_SEPARATOR); } - -// locates the item with "name_to_find" in the inventory items with the "type". -// a value from 0 to N-1 is returned if it's found, where N is the number of -// items in the inventory. -integer find_in_inventory(string name_to_find, integer inv_type, integer exact_match) -{ - integer num_inv = llGetInventoryNumber(inv_type); - if (num_inv == 0) return -1; // nothing there! - integer inv; - for (inv = 0; inv < num_inv; inv++) { - if (exact_match && (llGetInventoryName(inv_type, inv) == name_to_find) ) - return inv; - else if (!exact_match && is_prefix(llGetInventoryName(inv_type, inv), name_to_find)) - return inv; - } - return -2; // failed to find it. -} - -////////////// - -integer MAX_CHAT_LINE = 900; - // the most characters we'll try to say in one chat. - -dump_list_to_log(list to_show) -{ - string text = dump_list(to_show); // get some help from the other version. - integer len = llStringLength(text); - integer i; - for (i = 0; i < len; i += MAX_CHAT_LINE) { - integer last_bit = i + MAX_CHAT_LINE - 1; - if (last_bit >= len) last_bit = len - 1; - string next_line = llGetSubString(text, i, last_bit); - llWhisper(0, next_line); - } -} - -// returns a printable form of the list. -string dump_list(list to_show) -{ - integer len = llGetListLength(to_show); - integer i; - string text; - for (i = 0; i < len; i++) { - string next_line = llList2String(to_show, i); - if (find_substring(next_line, " ") >= 0) { - // this guy has a space in it, so quote it. - next_line = "\"" + next_line + "\""; - } - text = text + next_line; - if (i < len - 1) text = text + " "; - } - return text; -} - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.8. -// distributed under BSD-like license. -// !! keep in mind that this code must be *copied* into another -// !! script that you wish to add auto-retirement capability to. -// when a script has auto_retire in it, it can be dropped into an -// object and the most recent version of the script will destroy -// all older versions. -// -// the version numbers are embedded into the script names themselves. -// the notation for versions uses a letter 'v', followed by two numbers -// in the form "major.minor". -// major and minor versions are implicitly considered as a floating point -// number that increases with each newer version of the script. thus, -// "hazmap v0.1" might be the first script in the "hazmap" script continuum, -// and "hazmap v3.2" is a more recent version. -// -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -// this script is partly based on the self-upgrading scripts from markov brodsky -// and jippen faddoul. -////////////// -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -// end hufflets. -////////////// - -// no huffotronic trap state for startup, because this script will actually -// run (and is expected) inside a huffotronic updater object. - -default -{ - state_entry() - { - auto_retire(); // only allow the most recent revision. - initialize(); - state awaiting_commands; - } -} - -state awaiting_commands -{ - state_entry() - { - if (DEBUGGING) log_it(""); - careful_crankup(); // we always start by getting everyone running. - current_server = NULL_KEY; // forget previous server. - listen_for_orders(FALSE); - inventory_request_channel = 0; // no inventory request channel either. - update_channel = 0; // no channel currently. - updates_needed = []; // we know of no needs right now. - known_script_dependencies = []; // no deps either. - } - - state_exit() { llSetTimerEvent(0.0); } - - listen(integer channel, string name, key id, string message) - { - if ((id != llGetOwner()) && (llGetOwnerKey(id) != llGetOwner())) { - return; // must be same owner to ensure proper perms. - } - if (process_update_news(channel, name, id, message)) - state establish_private_channel; - } -} - -state establish_private_channel -{ - state_entry() - { - if (DEBUGGING) log_it(""); - llListen(update_channel, "", current_server, ""); - listen_for_orders(TRUE); - if (inventory_request_channel) - llSay(inventory_request_channel, REQUEST_INVENTORY_PREFIX + (string)update_channel); - else - llSay(OLD_REQUEST_INVENTORY_CHANNEL, REQUEST_INVENTORY_PREFIX + (string)update_channel); - llSetTimerEvent(MAXIMUM_UPDATE_TIME_ALLOWED); - } - - state_exit() { llSetTimerEvent(0); } - - listen(integer channel, string name, key id, string message) - { - if ((id != llGetOwner()) && (llGetOwnerKey(id) != llGetOwner())) { - return; // must be same owner to ensure proper perms. - } - if (process_update_news(channel, name, id, message)) { - // ready for a state change, but what kind? - if (llGetListLength(updates_needed)) { -//log_it("have a list of updates now."); - state performing_update; - } else { -//log_it("no updates needed in list, going back"); - state awaiting_commands; - } - } - } - - timer() { - if (DEBUGGING) { - log_it("timed out establishing channel with server " + (string)inventory_request_channel); - } - whack_updater_record(current_server); - state awaiting_commands; - } - - on_rez(integer parm) { state default; } -} - -state performing_update -{ - state_entry() - { - // must re-listen after a state change. - llListen(update_channel, "", current_server, ""); - listen_for_orders(TRUE); - if (DEBUGGING) log_it(""); - llSetTimerEvent(UPDATE_TIMER_INTERVAL); - update_start_time = llGetUnixTime(); - } - - state_exit() { llSetTimerEvent(0.0); } - - listen(integer channel, string name, key id, string message) - { - if ((id != llGetOwner()) && (llGetOwnerKey(id) != llGetOwner())) { - return; // must be same owner to ensure proper perms. - } - if (process_update_news(channel, name, id, message)) { - // normal finish of update process. - state awaiting_commands; - } - } - - timer() { - if (llGetListLength(updates_needed) == 0) { -//log_it("nothing to update, leaving perform state."); - state awaiting_commands; // we've got nothing to do. - } else { - // see if all our requested scripts are there yet; if not, we're not done updating. - integer ready = check_on_update_presence(); - if (ready) { - if (DEBUGGING) log_it("reporting scripts are current."); - llSay(update_channel, SCRIPTS_ARE_CURRENT); - } - } - if (llAbs(update_start_time - llGetUnixTime()) >= MAXIMUM_UPDATE_TIME_ALLOWED) { - if (DEBUGGING) { log_it("timeout during update process with server " + (string)inventory_request_channel); } - whack_updater_record(current_server); - state awaiting_commands; - } - } - - on_rez(integer parm) { state default; } -} - diff --git a/huffware/huffotronic_jaunter_updater/jaunting_library_v15.9.txt b/huffware/huffotronic_jaunter_updater/jaunting_library_v15.9.txt deleted file mode 100755 index 4d65cee3..00000000 --- a/huffware/huffotronic_jaunter_updater/jaunting_library_v15.9.txt +++ /dev/null @@ -1,551 +0,0 @@ - -// huffware script: jaunting library, by fred huffhines, released under GPL-v3 license. -// -// this script is a library of useful teleportation and movement calls. it should be added -// into an object along with other scripts that use the library. the jaunting library -// responds to linked messages as commands. -// parts of this script are based on warpPos from "Teleporter Script v 3.0 by Asira Sakai", -// which was found at the LSL wiki. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// global constants... - -float PROXIMITY_REQUIRED = 0.1; - // how close we must be to the target location to call the jaunt done. - // we make this fairly low accuracy since we don't want jumps in space to immediately - // be counted as failures. - -// the most jumps the script will try to take. the overall distance from the start -// to the end can be 10 * MAXIMUM_JUMPS_PER_CALL meters. -integer MAXIMUM_JUMPS_PER_CALL = 84; - -// global variables... - -vector last_posn; // used to calculate jump distances. - -// jaunting library link message API... -////////////// -// do not redefine these constants. -integer JAUNT_HUFFWARE_ID = 10008; - // the unique id within the huffware system for the jaunt script to - // accept commands on. this is used in llMessageLinked as the num parameter. -string HUFFWARE_PARM_SEPARATOR = "{~~~}"; - // this pattern is an uncommon thing to see in text, so we use it to separate - // our commands in link messages. -string HUFFWARE_ITEM_SEPARATOR = "{|||}"; - // used to separate lists of items from each other when stored inside a parameter. - // this allows lists to be passed as single string parameters if needed. -integer REPLY_DISTANCE = 100008; // offset added to service's huffware id in reply IDs. -// commands available via the jaunting library: -string JAUNT_COMMAND = "#jaunt#"; - // command used to tell jaunt script to move object. pass a vector with the location. -string FULL_STOP_COMMAND = "#fullstop#"; - // command used to bring object to a halt. -string REVERSE_VELOCITY_COMMAND = "#reverse#"; - // makes the object reverse its velocity and travel back from whence it came. -string SET_VELOCITY_COMMAND = "#setvelocity#"; - // makes the velocity equal to the vector passed as the first parameter. -string JAUNT_UP_COMMAND = "#jauntup#"; -string JAUNT_DOWN_COMMAND = "#jauntdown#"; - // commands for height adjustment. pass a float for number of meters to move. -string JAUNT_LIST_COMMAND = "#jauntlist#"; - // like regular jaunt, but expects a list of vectors as the first parameter; this list - // should be in the jaunter notecard format (separated by pipe characters). - // the second parameter, if any, should be 1 for forwards traversal and 0 for backwards. -////////////// - -// returns what we consider to be safe to do in one big jump. -float distance_safe_to_jaunt() { return (float)(MAXIMUM_JUMPS_PER_CALL - 4) * 10.0; } - -// tests whether the destination is safe for an object to enter. -integer safe_for_entry(vector where) -{ - if (outside_of_sim(where)) { - // that's an obvious wrong idea; it tends to break us. - return FALSE; - } - return TRUE; -} - -// helper function for warp_across_list. this adds one jump vector to the -// list of rules as long as the destination is interesting. -list process_warp_item(vector next_jump) -{ -//log_it("mem: " + (string)llGetFreeMemory()); - // calculate the number of jumps needed. - integer jumps = (integer)(llVecDist(next_jump, last_posn) / 10.0) + 1; - last_posn = next_jump; // record for next check. - // set up our list which we'll replicate. - list rules = [ PRIM_POSITION, next_jump ]; - // Try and avoid stack/heap collisions. - if (jumps > MAXIMUM_JUMPS_PER_CALL - 1) jumps = MAXIMUM_JUMPS_PER_CALL; - // add the rules repeatedly to get the effective overall jump done. - integer count = 1; - while ( (count = count << 1) < jumps) - rules += rules; - // magnify the rule list before really adding it. this gets us to the proper - // final number of jumps. - return rules + llList2List(rules, (count - jumps) << 1 - 2, count); -} - -// originally based on warpPos from lsl wiki but drastically modified. -// uses a set of transfer points instead of a single target. -list warp_across_list(list full_journey, integer forwards) -{ - // make sure the list didn't run out. - if (llGetListLength(full_journey) == 0) return []; - if (forwards) { - // forwards traversal of the list. - vector next_jump = (vector)llList2String(full_journey, 0); - // shortcut the jumps if we're already there. - if (next_jump == llGetPos()) - return warp_across_list(chop_list(full_journey, 1, - llGetListLength(full_journey) - 1), forwards); - // calculate our trajectory for the next jump and add in all subsequent jumps. - return process_warp_item(next_jump) - + warp_across_list(chop_list(full_journey, 1, llGetListLength(full_journey) - 1), forwards); - } else { - // reverse traversal of the list. - vector next_jump = (vector)llList2String(full_journey, llGetListLength(full_journey) - 1); - // shortcut the jumps if we're already there. - if (next_jump == llGetPos()) - return warp_across_list(chop_list(full_journey, 0, - llGetListLength(full_journey) - 2), forwards); - // calculate our trajectory for the next jump and add in all subsequent jumps. - return process_warp_item(next_jump) - + warp_across_list(chop_list(full_journey, 0, llGetListLength(full_journey) - 2), forwards); - } -} - -// the main function that performs the jaunting process. -// now also supports adding a rotation into the mix to avoid paying the extra delay -// cost of calling llSetRot. -jaunt(list full_journey, integer forwards, string command_used, - integer use_rotation, rotation rot, integer reply_to_request) -{ -//log_it("jaunt: fullj=" + (string)full_journey + " forew=" + (string)forwards); - // set up our global variables... - last_posn = llGetPos(); - // calculate the trip and run it. - list rot_add; - if (use_rotation) - rot_add = [ PRIM_ROTATION, rot ]; - llSetPrimitiveParams(warp_across_list(full_journey, forwards) + rot_add); - if (reply_to_request) { - // pick out the last target in the list based on the direction we're moving. - integer last_indy = 0; - if (forwards == TRUE) last_indy = llGetListLength(full_journey) - 1; - vector last_jump = (vector)llList2String(full_journey, last_indy); - // final judge of success here is how close we got to the target. - integer landed_there = (llVecDist(llGetPos(), last_jump) <= PROXIMITY_REQUIRED); - send_reply(LINK_THIS, [landed_there, llGetPos()], command_used); - } -} - -////////////// - -// sets the object's speed to "new_velocity". -// if "local_axis" is TRUE, then it will be relative to the object's -// own local coordinates. -set_velocity(vector new_velocity, integer local_axis) -{ - vector current_velocity = llGetVel(); - - if (local_axis) { - rotation rot = llGetRot(); - current_velocity /= rot; // undo the rotation. - } - - new_velocity -= current_velocity; - new_velocity *= llGetMass(); - - llApplyImpulse(new_velocity, local_axis); -} - -// attempts to bring the object to a complete stop. -full_stop() -{ - llSetForce(<0,0,0>, FALSE); - set_velocity(<0,0,0>, FALSE); -} - -// sends an object back along its trajectory. -reverse_velocity(integer local_axis) -{ - vector current_velocity = llGetVel(); - if (local_axis) { - rotation rot = llGetRot(); - current_velocity /= rot; // undo the rotation. - } - vector new_velocity = -2 * current_velocity; - new_velocity *= llGetMass(); - llApplyImpulse(new_velocity, local_axis); -} - -// teleports to the new "location", if possible. does not change object's phantom / physical -// states. this will do the jaunt in multiple steps if the distance from here to "location" -// is too large. -apportioned_jaunt(vector location, string command_used, integer use_rotation, rotation rot, - integer should_send_reply) -{ - if (!safe_for_entry(location)) { - // that's not good. we should not allow the script to get broken. - if (should_send_reply) - send_reply(LINK_THIS, [FALSE, llGetPos()], command_used); - return; - } - // go to position specified, by leapfrogs if too long. - integer chunk_of_jump; - integer MAX_CHUNKS = 200; // multiplies the distance a single jaunt can cover. - for (chunk_of_jump = 0; chunk_of_jump < MAX_CHUNKS; chunk_of_jump++) { - vector interim_vec = location - llGetPos(); - float jump_dist = llVecDist(llGetPos(), location); - integer reply_needed = TRUE; - if (jump_dist > distance_safe_to_jaunt()) { - // the entire distance cannot be jumped. do the part of it that fits. - float proportion_can_do = distance_safe_to_jaunt() / jump_dist; - interim_vec *= proportion_can_do; - reply_needed = FALSE; // don't reply when this is not full jump. - } - interim_vec += llGetPos(); // bias jump back to where we are. -//log_it("jumping from " + (string)llGetPos() + " to " + (string)interim_vec); - jaunt([llGetPos(), interim_vec], TRUE, command_used, use_rotation, rot, - reply_needed && should_send_reply); - float dist_now = llVecDist(llGetPos(), interim_vec); - if (dist_now > PROXIMITY_REQUIRED) { -//log_it("failed to make interim jump, dist left is " + (string)dist_now); - // bail out. we failed to get as far as we thought we should. - chunk_of_jump = MAX_CHUNKS + 10; - if (!reply_needed) { - // we need to send the reply we hadn't sent yet. - if (should_send_reply) - send_reply(LINK_THIS, [FALSE, llGetPos()], command_used); - } - } else if (llVecDist(llGetPos(), location) <= PROXIMITY_REQUIRED) { - // leave loop for a different reason; we got there. - chunk_of_jump = MAX_CHUNKS + 10; - if (!reply_needed) { - // we need to send the reply we hadn't sent yet. - if (should_send_reply) - send_reply(LINK_THIS, [TRUE, llGetPos()], command_used); - } - } - } -} - -// the entire distance embodied in the list of targets. this is a little smart, -// in that if there's only one target, we assume we're going from "here" to that -// one target. -float total_jaunt_distance(list targets) -{ - if (!llGetListLength(targets)) return 0.0; - // add in "this" location if they omitted it. - if (llGetListLength(targets) < 2) - targets = [ llGetPos() ] + targets; - integer disindy; - float total_dist = 0.0; - vector prev = (vector)llList2String(targets, 0); - for (disindy = 1; disindy < llGetListLength(targets); disindy++) { - vector next = (vector)llList2String(targets, disindy); - total_dist += llVecDist(prev, next); - prev = next; - } - return total_dist; -} - -// jaunts to a target via a set of intermediate locations. can either go forwards -// through the list or backwards. -phantom_jaunt_to_list(list targets, integer forwards, string command_used, - integer use_rotation, rotation rot) -{ - vector final_loc; - if (forwards) final_loc = (vector)llList2String(targets, llGetListLength(targets) - 1); - else final_loc = (vector)llList2String(targets, 0); - -//hmmm: check each destination in list?? - if (!safe_for_entry(final_loc)) { - // that's not good. we should not allow the script to get broken. - send_reply(LINK_THIS, [FALSE, llGetPos()], command_used); - return; - } - - // this turns off the physics property for the object, so that jaunt and - // llSetPos will still work. this became necessary due to havok4. - integer original_phantomosity = llGetStatus(STATUS_PHANTOM); - integer original_physicality = llGetStatus(STATUS_PHYSICS); - if (original_physicality != FALSE) llSetStatus(STATUS_PHYSICS, FALSE); - if (original_phantomosity != TRUE) llSetStatus(STATUS_PHANTOM, TRUE); - - integer send_reply_still = TRUE; // true if we should send a reply when done. - - // iterate through our list of targets and either we will jaunt to the next - // place directly or we will have to wrap a few destinations due to sim crossing. - while (llGetListLength(targets) > 0) { - vector next_loc; - if (forwards) next_loc = (vector)llList2String(targets, 0); - else next_loc = (vector)llList2String(targets, llGetListLength(targets) - 1); - if (outside_of_sim(next_loc)) { - log_it("bad jaunt path: first target is out of sim."); - send_reply(LINK_THIS, [FALSE, llGetPos()], command_used); - return; // skip that badness. - } - - // check how much total distance we have in the path that's left. if it's under our - // limit, then we'll just take it in one jump. - float total_dist = total_jaunt_distance(targets); - - // if we're below the threshold, we'll just jump now. - integer already_jumped = FALSE; - if (total_dist < distance_safe_to_jaunt()) { - jaunt(targets, forwards, command_used, use_rotation, rot, TRUE); - targets = []; // reset the list now. - send_reply_still = FALSE; // we have already sent the reply in jaunt(). - already_jumped = TRUE; // don't do anything else. - } - if (!already_jumped) { - vector next_plus_1 = ZERO_VECTOR; // default cannot fail our "is inside sim" check. - if (llGetListLength(targets) > 1) { - if (forwards) next_plus_1 = (vector)llList2String(targets, 1); - else next_plus_1 = (vector)llList2String(targets, llGetListLength(targets) - 2); - } - if (outside_of_sim(next_plus_1)) { -//hmmm: eventually find all the negative ones in a row and do them in combo, rather than -// just giving up here and doing a jaunt to the rest.. - jaunt(targets, forwards, command_used, use_rotation, rot, TRUE); - targets = []; // reset the list now. - send_reply_still = FALSE; // we have already sent the reply in jaunt(). - } else { - // we've passed the negativity test, so we can at least jump to the next place. - - // zap the next location, since we're about to jump there. - integer zap_pos = 0; - if (!forwards) zap_pos = llGetListLength(targets) - 1; - targets = llDeleteSubList(targets, zap_pos, zap_pos); - - // only bother jumping if we're not already there. - if (llVecDist(next_loc, llGetPos()) > PROXIMITY_REQUIRED) { - apportioned_jaunt(next_loc, command_used, use_rotation, rot, FALSE); - } - } - } - } - - if (send_reply_still) { - integer yippee = TRUE; // assume we succeeded until we prove otherwise. - if (llVecDist(final_loc, llGetPos()) > PROXIMITY_REQUIRED) - yippee = FALSE; - send_reply(LINK_THIS, [yippee, llGetPos()], command_used); - } - - // return to prior characteristics. - if (original_phantomosity != TRUE) llSetStatus(STATUS_PHANTOM, original_phantomosity); - if (original_physicality != FALSE) llSetStatus(STATUS_PHYSICS, original_physicality); -} - -// implements our API for jumping around. -handle_link_message(integer sender, integer huff_id, string msg, key id) -{ - // separate the list out - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); - if (msg == JAUNT_COMMAND) { - // use list to string to avoid non-conversions. - vector v = (vector)llList2String(parms, 0); - rotation rot = <0.0, 0.0, 0.0, 1.0>; - integer gave_rot = llGetListLength(parms) > 1; - if (gave_rot) rot = (rotation)llList2String(parms, 1); // ooh, they gave us a rotational value also. -// log_it("gave rot? " + (string)gave_rot + " rot=" + (string)rot); - phantom_jaunt_to_list([llGetPos(), v], TRUE, msg, gave_rot, rot); - } else if (msg == FULL_STOP_COMMAND) { - full_stop(); - } else if (msg == REVERSE_VELOCITY_COMMAND) { - reverse_velocity(FALSE); - } else if (msg == SET_VELOCITY_COMMAND) { - vector v = (vector)llList2String(parms, 0); -//log_it("jaunting lib received set velocity request for " + (string)v); - set_velocity(v, FALSE); - } else if (msg == JAUNT_UP_COMMAND) { - phantom_jaunt_to_list([ llGetPos(), llGetPos() + <0.0, 0.0, llList2Float(parms, 0)> ], - TRUE, msg, FALSE, ZERO_ROTATION); - } else if (msg == JAUNT_DOWN_COMMAND) { - phantom_jaunt_to_list([ llGetPos(), llGetPos() + <0.0, 0.0, -llList2Float(parms, 0)> ], - TRUE, msg, FALSE, ZERO_ROTATION); - } else if (msg == JAUNT_LIST_COMMAND) { - string destination_list = llList2String(parms, 0); - list targets = llParseString2List(destination_list, [HUFFWARE_ITEM_SEPARATOR], []); - destination_list = ""; - integer forwards = TRUE; - // snag the directionality for the list, if specified. - if (llGetListLength(parms) > 1) forwards = llList2Integer(parms, 1); - rotation rot = <0.0, 0.0, 0.0, 1.0>; - integer gave_rot = llGetListLength(parms) > 2; - if (gave_rot) rot = llList2Rot(parms, 2); // ooh, they gave us a rotational value also. - phantom_jaunt_to_list(targets, forwards, msg, gave_rot, rot); - targets = []; - } -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - // tell this to the owner. - llOwnerSay(llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on open chat, but use an unusual channel. -// llSay(108, llGetScriptName() + "--" + (string)debug_num + ": " + to_say); -} -////////////// - -// a simple version of a reply for a command that has been executed. the parameters -// might contain an outcome or result of the operation that was requested. -send_reply(integer destination, list parms, string command) -{ - llMessageLinked(destination, JAUNT_HUFFWARE_ID + REPLY_DISTANCE, command, - llDumpList2String(parms, HUFFWARE_PARM_SEPARATOR)); -} - -// returns TRUE if the value in "to_check" specifies a legal x or y value in a sim. -integer valid_sim_value(float to_check) -{ - if (to_check < 0.0) return FALSE; - if (to_check >= 257.0) return FALSE; - return TRUE; -} - -integer outside_of_sim(vector to_check) -{ - return !valid_sim_value(to_check.x) || !valid_sim_value(to_check.y); -} - -/////////////// - -// returns the portion of the list between start and end, but only if they are -// valid compared with the list length. an attempt to use negative start or -// end values also returns a blank list. -list chop_list(list to_chop, integer start, integer end) -{ - integer last_len = llGetListLength(to_chop) - 1; - if ( (start < 0) || (end < 0) || (start > last_len) || (end > last_len) ) return []; - return llList2List(to_chop, start, end); -} - -////////////// - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.5. -// distributed under BSD-like license. -// !! keep in mind that this code must be *copied* into another -// !! script that you wish to add auto-retirement capability to. -// when a script has auto_retire in it, it can be dropped into an -// object and the most recent version of the script will destroy -// all older versions. -// -// the version numbers are embedded into the script names themselves. -// the notation for versions uses a letter 'v', followed by two numbers -// in the form "major.minor". -// major and minor versions are implicitly considered as a floating point -// number that increases with each newer version of the script. thus, -// "hazmap v0.1" might be the first script in the "hazmap" script continuum, -// and "hazmap v3.2" is a more recent version. -// -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -// this script is partly based on the self-upgrading scripts from markov brodsky -// and jippen faddoul. -////////////// -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -default { - state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } - on_rez(integer parm) { state rerun; } -} -state rerun { state_entry() { state default; } } - -state real_default -{ - state_entry() { auto_retire(); } - - link_message(integer sender, integer huff_id, string msg, key id) { - if (huff_id != JAUNT_HUFFWARE_ID) return; // not our responsibility. - handle_link_message(sender, huff_id, msg, id); - } -} diff --git a/huffware/huffotronic_jaunter_updater/menutini_library_v6.1.txt b/huffware/huffotronic_jaunter_updater/menutini_library_v6.1.txt deleted file mode 100755 index 347d2590..00000000 --- a/huffware/huffotronic_jaunter_updater/menutini_library_v6.1.txt +++ /dev/null @@ -1,438 +0,0 @@ - -// huffware script: menutini library, by fred huffhines. -// -// this is a library script for menuing that provides a way to remote control the -// menu, somewhat. another script can zing link messages at this script and a menu -// will be shown based on the specified description and buttons. when the user -// selects an answer, that result is sent back in a link message reply. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// useful constants you might want to change: - -integer TIMEOUT_FOR_MENU = 42; - // timeout for the menu in seconds. -//hmmm: may want this to be selectable from menu request. -// or may even want to never time out! -// if we managed a list of ongoing menus, that would work. -// currently it cannot. - -integer DEBUGGING = FALSE; - // if this is true, then extra info will be printed when handling a menu. - -string NEXT_MENU_TEXT = "Next >>"; - // what the next item will say for showing next menu page. - -// menutini link message API... -////////////// -// do not redefine these constants. -integer MENUTINI_HUFFWARE_ID = 10009; - // the unique id within the huffware system for the jaunt script to - // accept commands on. this is used in llMessageLinked as the num parameter. -string HUFFWARE_PARM_SEPARATOR = "{~~~}"; - // this pattern is an uncommon thing to see in text, so we use it to separate - // our commands in link messages. -string HUFFWARE_ITEM_SEPARATOR = "{|||}"; - // used to separate lists of items from each other when stored inside a parameter. - // this allows lists to be passed as single string parameters if needed. -integer REPLY_DISTANCE = 100008; // offset added to service's huffware id in reply IDs. -string SHOW_MENU_COMMAND = "#menu#"; - // the command that tells menutini to show a menu defined by parameters - // that are passed along. these must be: the menu name, the menu's title - // (which is really the info to show as content in the main box of the menu), - // the wrapped list of commands to show as menu buttons, the menu system - // channel's for listening, and the key to listen to. - // the reply will include: the menu name, the choice made and the key for - // the avatar. -// -////////////// -// joins a list of sub-items using the item sentinel for the library. -string wrap_item_list(list to_wrap) -{ return llDumpList2String(to_wrap, HUFFWARE_ITEM_SEPARATOR); } -// -////////////// - -// global variables... - -list _private_global_buttons; // holds onto the active set of menu options. -string _private_global_av_key; // the key for the avatar who clicks the menu. -string _private_global_title; // holds onto current title text. - -integer _menu_base_start = 0; // position in the items of the current menu. - -integer listening_id = 0; - // the current id of our listening for the menu. it's an id returned by LSL - // that we need to track so we can cancel the listen. - -integer menu_system_channel = 0; - // messages come back to us from this channel when user clicks the dialog. - // this is set later and the default is meaningless. - -string global_menu_name = ""; - // hangs onto the current menu's name. - -//hmmm: note; to manage multiple concurrent menus on different channels, -// we must make these into lists. then the timeouts should apply -// individually to these instead of overall (if we even do timeouts; -// it's nicer if menus never stop being active). - - -// displays the menu requested. it's "menu_name" is an internal name that is -// not displayed to the user. the "title" is the content shown in the main area -// of the menu. "commands_in" is the list of menu items to show as buttons. -// the "menu_channel" is where the user's clicked response will be sent. the -// "listen_to" key is the avatar expected to click the menu, which is needed to -// listen to his response. -show_menu(string menu_name, string title, list buttons, - integer menu_channel, key listen_to) -{ - // save our new parms. - global_menu_name = menu_name; - _private_global_title = title; - _private_global_buttons = buttons; - menu_system_channel = menu_channel; - _private_global_av_key = listen_to; -//log_it("showing menu to " + llKey2Name(listen_to) + " with key " + (string)listen_to); - if (DEBUGGING) { - log_it("menu name: " + global_menu_name); - log_it("title: " + _private_global_title); - log_it("buttons: " + (string)buttons); - log_it("channel: " + (string)menu_system_channel); - log_it("listen key: " + (string)listen_to); - } - - integer add_next = FALSE; // true if we should add a next menu item. - - // the math here incorporates current button position. - integer current = _menu_base_start; - integer max_buttons = llGetListLength(buttons) - current; - - if (max_buttons > 12) { - // limitation of SL: menus have a max of 12 buttons. - max_buttons = 12; - add_next = TRUE; - } else if (llGetListLength(buttons) > 12) { - // we already have been adding next. let's make sure this gets - // a wrap-around next button. - add_next = TRUE; - } - // chop out what we can use in a menu. - list trunc_buttons = llList2List(buttons, current, current + max_buttons - 1); - if (add_next) { - // we were asked to add a menu item for the next screen. - trunc_buttons = llList2List(trunc_buttons, 0, 10) + NEXT_MENU_TEXT; - } - - listening_id = llListen(menu_channel, "", listen_to, ""); - list commands; - integer i; - // take only the prefix of the string, to avoid getting a length complaint. - for (i = 0; i < llGetListLength(trunc_buttons); i++) { - string curr = llList2String(trunc_buttons, i); - integer last_pos = 23; // default maximum, highest possible is 24. - if (llStringLength(curr) - 1 < last_pos) last_pos = llStringLength(curr) - 1; - curr = llGetSubString(curr, 0, last_pos); - commands += curr; - } - llDialog(listen_to, title, commands, menu_channel); - llSetTimerEvent(TIMEOUT_FOR_MENU); -} - -// shuts down any connection we might have had with any active menu. we will not -// send any responses after this point (although we might already have responded when -// the user clicked the menu). -clear_menu() -{ - llListenRemove(listening_id); - llSetTimerEvent(0.0); -} - -// a simple version of a reply for a command that has been executed. the parameters -// might contain an outcome or result of the operation that was requested. -// ours do differ from normal in that we send back the channel as the number parameter -// instead of enforcing that being MENU_HUFFWARE_ID. -send_reply(integer destination, integer channel, list parms, string command) -{ - llMessageLinked(destination, channel, command, - llDumpList2String(parms, HUFFWARE_PARM_SEPARATOR)); -} - -// processes the menu requests. -handle_link_message(integer sender, integer huff_id, string msg, key id) -{ - if (huff_id != MENUTINI_HUFFWARE_ID) return; // not for us. - - if (msg == SHOW_MENU_COMMAND) { - _menu_base_start = 0; // reset the position in the menus. - // separate the list out. -//log_it("id showing: " + (string)id); - list parms = llParseStringKeepNulls(id, [HUFFWARE_PARM_SEPARATOR], []); -//log_it("parm len " + (string)llGetListLength(parms) + ", parms are: " + (string)parms); - // toss any existing menu info. - clear_menu(); -//log_it("key here early: " + llList2String(parms, 4)); - show_menu(llList2String(parms, 0), llList2String(parms, 1), - llParseStringKeepNulls(llList2String(parms, 2), - [HUFFWARE_ITEM_SEPARATOR], []), - (integer)llList2String(parms, 3), - (key)llList2String(parms, 4)); - } -} - -// process the response when the user chooses a menu item. this causes our -// caller to be told what was selected. -process_menu_response(integer channel, string name, key id, string message) -{ - if (channel != menu_system_channel) return; // not for us. - - if (message == NEXT_MENU_TEXT) { - // this is the special choice, so we need to go to the next page. - _menu_base_start += 11; - if (_menu_base_start > llGetListLength(_private_global_buttons)) { - // we have wrapped around the list. go to the start again. - _menu_base_start = 0; - } - show_menu(global_menu_name, _private_global_title, - _private_global_buttons, menu_system_channel, - _private_global_av_key); - return; // handled by opening a new menu. - } - - string calculated_name; - integer indy; - // first try for an exact match. - for (indy = 0; indy < llGetListLength(_private_global_buttons); indy++) { - string curr = llList2String(_private_global_buttons, indy); - if (curr == message) { - // correct the answer based on the full button string. - calculated_name = curr; - } - } - if (calculated_name == "") { - // try an imprecise match if the exact matching didn't work. - for (indy = 0; indy < llGetListLength(_private_global_buttons); indy++) { - string curr = llList2String(_private_global_buttons, indy); - if (is_prefix(curr, message)) { - // correct the answer based on the full button string. - calculated_name = curr; - } - } - } - if (calculated_name != "") { - // only send a response if that menu choice made sense to us. - send_reply(LINK_THIS, MENUTINI_HUFFWARE_ID + REPLY_DISTANCE, - [ global_menu_name, calculated_name, _private_global_av_key ], - SHOW_MENU_COMMAND); - } -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - // tell this to the owner. - llOwnerSay(llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on open chat, but use an unusual channel. -// llSay(108, llGetScriptName() + "[" + (string)debug_num + "] " + to_say); -} - -////////////// - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return (llSubStringIndex(compare_with, prefix) == 0); } - -////////////// - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.8. -// distributed under BSD-like license. -// !! keep in mind that this code must be *copied* into another -// !! script that you wish to add auto-retirement capability to. -// when a script has auto_retire in it, it can be dropped into an -// object and the most recent version of the script will destroy -// all older versions. -// -// the version numbers are embedded into the script names themselves. -// the notation for versions uses a letter 'v', followed by two numbers -// in the form "major.minor". -// major and minor versions are implicitly considered as a floating point -// number that increases with each newer version of the script. thus, -// "hazmap v0.1" might be the first script in the "hazmap" script continuum, -// and "hazmap v3.2" is a more recent version. -// -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -// this script is partly based on the self-upgrading scripts from markov brodsky -// and jippen faddoul. -////////////// -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -//hmmm: extract this code to a menutini example! - -////////////// -// how to invoke a menu (assuming menutini is in same prim as calling script): -// -list buttons; // holds onto the set of menu options. -// -integer random_channel() { return -(integer)(llFrand(40000) + 20000); } -// -example_invocation() -{ - string menu_name = "grumfazoid"; - string title = "These united colors of ben's futon have unfortunately run."; - buttons = [ "garp out", "sklonar", "fuzzlenog" ]; - integer menu_channel = random_channel(); - key listen_to = llGetOwner(); - llMessageLinked(LINK_THIS, MENUTINI_HUFFWARE_ID, SHOW_MENU_COMMAND, - menu_name + HUFFWARE_PARM_SEPARATOR - + title + HUFFWARE_PARM_SEPARATOR - + wrap_item_list(buttons) + HUFFWARE_PARM_SEPARATOR - + (string)menu_channel + HUFFWARE_PARM_SEPARATOR - + (string)listen_to); -} -// -// how to handle the response message when the user chooses a button. -// -react_to_menu(string menu_name, string which_choice) -{ - // one might use the menu_name when dealing with multiple different menus. - - integer indy = 0; - // find the specified item and process it. - while (indy < llGetListLength(buttons)) { - // see if the current destination matches. - if (llSubStringIndex(llList2String(buttons, indy), which_choice) == 0) { - // this is the chosen item. -// process_menu_item(indy); // using numerical numbering. -// this function must be implemented in your own code; it is what handles the -// user picking a particular button on the menu. - return; - } - indy++; - } - llSay(0, "did not find menu option"); -} - -// an example for menu handling. this gets the response from menutini library -// and calls the menu processing method "react_to_menu". -example_handle_link_message(integer sender, integer num, string msg, key id) -{ - if (num != MENUTINI_HUFFWARE_ID + REPLY_DISTANCE) return; // not for us. - if (msg != SHOW_MENU_COMMAND) return; // also not for us. - list parms = llParseStringKeepNulls(id, [HUFFWARE_PARM_SEPARATOR], []); - string menu_name = llList2String(parms, 0); - string which_choice = llList2String(parms, 1); - react_to_menu(menu_name, which_choice); -} - -// then inside a state, you need an event handler like so: -// -// link_message(integer sender, integer num, string msg, key id) -// { example_handle_link_message(sender, num, msg, id); } - -// -// end invocation sample code... -////////////// - -default -{ - state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } - on_rez(integer parm) { state rerun; } -} -state rerun { state_entry() { state default; } } - -state real_default -{ - state_entry() { auto_retire(); } - - link_message(integer sender, integer huff_id, string msg, key id) - { handle_link_message(sender, huff_id, msg, id); } - - listen(integer channel, string name, key id, string message) - { process_menu_response(channel, name, id, message); } - - // if the timer goes off, then the user has ignored the menu for longer than the - // timeout. we need to turn off our listen and ignore that menu. - timer() { clear_menu(); } -} - diff --git a/huffware/huffotronic_jaunter_updater/texture_mover_v3.0.txt b/huffware/huffotronic_jaunter_updater/texture_mover_v3.0.txt deleted file mode 100755 index 57a1e641..00000000 --- a/huffware/huffotronic_jaunter_updater/texture_mover_v3.0.txt +++ /dev/null @@ -1,237 +0,0 @@ - -// huffware script: texture mover, by fred huffhines -// -// moves a texture across the object, either by smooth animation or brute force offsetting. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// constants... - -integer USE_TEXTURE_ANIMATION = TRUE; - // by default, we use texture animation which is a lower-lag way to - // make the texture move. if this is false, then we use a timed update - // to move the texture instead. - // note: these modes are actually really different. the texture animation - // is included here because i wanted to smooth out some objects that used - // texture movement. - -// used in both types... - -float TIMER_INTERVAL = 0.2; // how fast do we move texture? - -// for timed movement... - -vector OFFSET_MOVEMENT = ZERO_VECTOR; // no movement. -//vector OFFSET_MOVEMENT = <0.0, -0.02, 0.0>; - // how much to move the texture by in x,y,z directions. - -//float OFFSET_ROTATION = 0.0; // in degrees. -float OFFSET_ROTATION = -1.0; // in degrees. - -// for texture animations... - -float MOVER_TIMER_DIVISOR = 30.0; - // makes the movement comparable to timed method. - -float ROTATER_TIMER_DIVISOR = 7.0; - // makes the rotation comparable to timed method. - -// iterative movement of texture. -move_texture(vector offset) -{ - vector current = llGetTextureOffset(ALL_SIDES); - current += offset; - if (current.x > 1.0) current.x = -1.0; - if (current.x < -1.0) current.x = 1.0; - if (current.y > 1.0) current.y = -1.0; - if (current.y < -1.0) current.y = 1.0; - llOffsetTexture(current.x, current.y, ALL_SIDES); -} - -// iterative rotation of texture. "spin" is measured in degrees. -spin_texture(float spin) -{ - float rot = llGetTextureRot(ALL_SIDES); // get our current state. - rot += spin * DEG_TO_RAD; // add some rotation. - llRotateTexture(rot, ALL_SIDES); //rotate the object -} - -initialize_texture_mover() -{ - if (!USE_TEXTURE_ANIMATION) { - // we're stuck with the timed update style for movement. - llSetTimerEvent(TIMER_INTERVAL); - // turn off previous animation. - llSetTextureAnim(0, ALL_SIDES, 0, 0, 0, 0, 0); - } else { - // we can just set the texture movement here and be done with it. - integer x_frames = 1; - integer y_frames = 1; - llSetTimerEvent(0); // we don't use a timer. - -//hmmm: how do we combine rotation and offsets? currently mutually exclusive. - - if (OFFSET_MOVEMENT != ZERO_VECTOR) { - float timer_interval = TIMER_INTERVAL / MOVER_TIMER_DIVISOR; -log_it("getting x_frames=" + (string)x_frames -+ " y_frames=" + (string)y_frames -+ " timer_intvl=" + (string)timer_interval); - - llSetTextureAnim(ANIM_ON | LOOP | SMOOTH, ALL_SIDES, - x_frames, y_frames, - 0, 100, timer_interval); - } else if (OFFSET_ROTATION != 0.0) { - float timer_interval = TIMER_INTERVAL / ROTATER_TIMER_DIVISOR; - // we're actually not using the rotation at all here, except for - // the sign. that seems pretty busted. - if (OFFSET_ROTATION < 0) timer_interval *= -1.0; - llSetTextureAnim(ANIM_ON | LOOP | SMOOTH | ROTATE, ALL_SIDES, - 0, 0, - 0, TWO_PI, timer_interval); - } - } -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - // tell this to the owner. - llOwnerSay(llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on an unusual channel for chat if it's not intended for general public. -// llSay(108, llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on open chat that anyone can hear. we take off the bling for this one. -// llSay(0, to_say); -} -// -////////////// - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.5. -// distributed under BSD-like license. -// !! keep in mind that this code must be *copied* into another -// !! script that you wish to add auto-retirement capability to. -// when a script has auto_retire in it, it can be dropped into an -// object and the most recent version of the script will destroy -// all older versions. -// -// the version numbers are embedded into the script names themselves. -// the notation for versions uses a letter 'v', followed by two numbers -// in the form "major.minor". -// major and minor versions are implicitly considered as a floating point -// number that increases with each newer version of the script. thus, -// "hazmap v0.1" might be the first script in the "hazmap" script continuum, -// and "hazmap v3.2" is a more recent version. -// -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -// this script is partly based on the self-upgrading scripts from markov brodsky -// and jippen faddoul. -////////////// -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { -//log_it("invpo=" + (string)posn); - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. -//log_it("pos=" + (string)space_v_posn); - } - if (space_v_posn < 2) return []; // no space found. -//log_it("space v@" + (string)space_v_posn); - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { -//log_it("indy=" + (string)space_v_posn); - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); -//log_it("saw case of previously redundant item, aieee. flattened: " + to_chop_up); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -default { - state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } - on_rez(integer parm) { state rerun; } -} -state rerun { state_entry() { state default; } } - -state real_default -{ - state_entry() { - auto_retire(); - initialize_texture_mover(); - } - - timer() { - // the timed approach is the only one so far that allows both a - // movement of the texture and a rotation. - if (OFFSET_MOVEMENT != ZERO_VECTOR) move_texture(OFFSET_MOVEMENT); - if (OFFSET_ROTATION != 0.0) spin_texture(OFFSET_ROTATION); - } -} - diff --git a/huffware/huffotronic_eepaw_knowledge/FPS_color_changer_v2.4.txt b/huffware/huffotronic_scripts/FPS_color_changer_v2.4.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/FPS_color_changer_v2.4.txt rename to huffware/huffotronic_scripts/FPS_color_changer_v2.4.txt diff --git a/huffware/huffotronic_eepaw_knowledge/FreeView_v1.8.txt b/huffware/huffotronic_scripts/FreeView_v1.8.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/FreeView_v1.8.txt rename to huffware/huffotronic_scripts/FreeView_v1.8.txt diff --git a/huffware/huffotronic_tools_n_testers/Hour_Hand_v0.5.txt b/huffware/huffotronic_scripts/Hour_Hand_v0.5.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/Hour_Hand_v0.5.txt rename to huffware/huffotronic_scripts/Hour_Hand_v0.5.txt diff --git a/huffware/huffotronic_jaunter_updater/Hyper_Jump_Wilder_Westen_v0.2.txt b/huffware/huffotronic_scripts/Hyper_Jump_Wilder_Westen_v0.2.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/Hyper_Jump_Wilder_Westen_v0.2.txt rename to huffware/huffotronic_scripts/Hyper_Jump_Wilder_Westen_v0.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/JukeBox_v1.6.txt b/huffware/huffotronic_scripts/JukeBox_v1.6.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/JukeBox_v1.6.txt rename to huffware/huffotronic_scripts/JukeBox_v1.6.txt diff --git a/huffware/huffotronic_tools_n_testers/Minute_Hand_v0.4.txt b/huffware/huffotronic_scripts/Minute_Hand_v0.4.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/Minute_Hand_v0.4.txt rename to huffware/huffotronic_scripts/Minute_Hand_v0.4.txt diff --git a/huffware/huffotronic_tools_n_testers/NC_stay_at_home_v5.2.txt b/huffware/huffotronic_scripts/NC_stay_at_home_v5.2.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/NC_stay_at_home_v5.2.txt rename to huffware/huffotronic_scripts/NC_stay_at_home_v5.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/TL_Door_fredmod_v4.5.txt b/huffware/huffotronic_scripts/TL_Door_fredmod_v4.5.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/TL_Door_fredmod_v4.5.txt rename to huffware/huffotronic_scripts/TL_Door_fredmod_v4.5.txt diff --git a/huffware/huffotronic_tools_n_testers/Vote_for_me_v4.2.txt b/huffware/huffotronic_scripts/Vote_for_me_v4.2.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/Vote_for_me_v4.2.txt rename to huffware/huffotronic_scripts/Vote_for_me_v4.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/a_huffotronic_update_server_v23.3.txt b/huffware/huffotronic_scripts/a_huffotronic_update_server_v23.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/a_huffotronic_update_server_v23.3.txt rename to huffware/huffotronic_scripts/a_huffotronic_update_server_v23.3.txt diff --git a/huffware/huffotronic_tools_n_testers/a_jumping_bean_v2.7.txt b/huffware/huffotronic_scripts/a_jumping_bean_v2.7.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/a_jumping_bean_v2.7.txt rename to huffware/huffotronic_scripts/a_jumping_bean_v2.7.txt diff --git a/huffware/huffotronic_tools_n_testers/altitudinator_v1.1.txt b/huffware/huffotronic_scripts/altitudinator_v1.1.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/altitudinator_v1.1.txt rename to huffware/huffotronic_scripts/altitudinator_v1.1.txt diff --git a/huffware/huffotronic_tools_n_testers/ama_omega_et_al_vendor_owner-only_v0.5.txt b/huffware/huffotronic_scripts/ama_omega_et_al_vendor_owner-only_v0.5.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/ama_omega_et_al_vendor_owner-only_v0.5.txt rename to huffware/huffotronic_scripts/ama_omega_et_al_vendor_owner-only_v0.5.txt diff --git a/huffware/huffotronic_tools_n_testers/animated_texture_v0.4.txt b/huffware/huffotronic_scripts/animated_texture_v0.4.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/animated_texture_v0.4.txt rename to huffware/huffotronic_scripts/animated_texture_v0.4.txt diff --git a/huffware/huffotronic_eepaw_knowledge/anti-idler_mojo_v1.4.txt b/huffware/huffotronic_scripts/anti-idler_mojo_v1.4.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/anti-idler_mojo_v1.4.txt rename to huffware/huffotronic_scripts/anti-idler_mojo_v1.4.txt diff --git a/huffware/huffotronic_jaunter_updater/aqua_config_v0.5.txt b/huffware/huffotronic_scripts/aqua_config_v0.5.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/aqua_config_v0.5.txt rename to huffware/huffotronic_scripts/aqua_config_v0.5.txt diff --git a/huffware/huffotronic_eepaw_knowledge/auto-retire_v2.8.txt b/huffware/huffotronic_scripts/auto-retire_v2.8.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/auto-retire_v2.8.txt rename to huffware/huffotronic_scripts/auto-retire_v2.8.txt diff --git a/huffware/huffotronic_tools_n_testers/axis_rider_v2.9.txt b/huffware/huffotronic_scripts/axis_rider_v2.9.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/axis_rider_v2.9.txt rename to huffware/huffotronic_scripts/axis_rider_v2.9.txt diff --git a/huffware/huffotronic_tools_n_testers/base_note_read_v0.3.txt b/huffware/huffotronic_scripts/base_note_read_v0.3.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/base_note_read_v0.3.txt rename to huffware/huffotronic_scripts/base_note_read_v0.3.txt diff --git a/huffware/huffotronic_tools_n_testers/begging_bowl_v4.4.txt b/huffware/huffotronic_scripts/begging_bowl_v4.4.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/begging_bowl_v4.4.txt rename to huffware/huffotronic_scripts/begging_bowl_v4.4.txt diff --git a/huffware/huffotronic_tools_n_testers/bouncer_v2.1.txt b/huffware/huffotronic_scripts/bouncer_v2.1.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/bouncer_v2.1.txt rename to huffware/huffotronic_scripts/bouncer_v2.1.txt diff --git a/huffware/huffotronic_tools_n_testers/box_mover_v1.7.txt b/huffware/huffotronic_scripts/box_mover_v1.7.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/box_mover_v1.7.txt rename to huffware/huffotronic_scripts/box_mover_v1.7.txt diff --git a/huffware/huffotronic_tools_n_testers/button_pusher_v0.5.txt b/huffware/huffotronic_scripts/button_pusher_v0.5.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/button_pusher_v0.5.txt rename to huffware/huffotronic_scripts/button_pusher_v0.5.txt diff --git a/huffware/huffotronic_eepaw_knowledge/card_configurator_v8.1.txt b/huffware/huffotronic_scripts/card_configurator_v8.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/card_configurator_v8.1.txt rename to huffware/huffotronic_scripts/card_configurator_v8.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/change_click_action_v1.0.txt b/huffware/huffotronic_scripts/change_click_action_v1.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/change_click_action_v1.0.txt rename to huffware/huffotronic_scripts/change_click_action_v1.0.txt diff --git a/huffware/huffotronic_tools_n_testers/chaos_picks_a_number_v3.0.txt b/huffware/huffotronic_scripts/chaos_picks_a_number_v3.0.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/chaos_picks_a_number_v3.0.txt rename to huffware/huffotronic_scripts/chaos_picks_a_number_v3.0.txt diff --git a/huffware/huffotronic_jaunter_updater/child_jaunter_v85.2.txt b/huffware/huffotronic_scripts/child_jaunter_v85.2.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/child_jaunter_v85.2.txt rename to huffware/huffotronic_scripts/child_jaunter_v85.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/clear_text_and_effects_v2.2.txt b/huffware/huffotronic_scripts/clear_text_and_effects_v2.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/clear_text_and_effects_v2.2.txt rename to huffware/huffotronic_scripts/clear_text_and_effects_v2.2.txt diff --git a/huffware/huffotronic_jaunter_updater/coastal_connector_hubs_v2.4.txt b/huffware/huffotronic_scripts/coastal_connector_hubs_v2.4.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/coastal_connector_hubs_v2.4.txt rename to huffware/huffotronic_scripts/coastal_connector_hubs_v2.4.txt diff --git a/huffware/huffotronic_tools_n_testers/collider_v1.3.txt b/huffware/huffotronic_scripts/collider_v1.3.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/collider_v1.3.txt rename to huffware/huffotronic_scripts/collider_v1.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/color_smoove_clock_v3.2.txt b/huffware/huffotronic_scripts/color_smoove_clock_v3.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/color_smoove_clock_v3.2.txt rename to huffware/huffotronic_scripts/color_smoove_clock_v3.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/comfortable_sitting_v7.5.txt b/huffware/huffotronic_scripts/comfortable_sitting_v7.5.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/comfortable_sitting_v7.5.txt rename to huffware/huffotronic_scripts/comfortable_sitting_v7.5.txt diff --git a/huffware/huffotronic_eepaw_knowledge/concussive_v19.2.txt b/huffware/huffotronic_scripts/concussive_v19.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/concussive_v19.2.txt rename to huffware/huffotronic_scripts/concussive_v19.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/cowpole_ignite_v1.2.txt b/huffware/huffotronic_scripts/cowpole_ignite_v1.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/cowpole_ignite_v1.2.txt rename to huffware/huffotronic_scripts/cowpole_ignite_v1.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/create_objects_v1.3.txt b/huffware/huffotronic_scripts/create_objects_v1.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/create_objects_v1.3.txt rename to huffware/huffotronic_scripts/create_objects_v1.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/data_cow_v3.3.txt b/huffware/huffotronic_scripts/data_cow_v3.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/data_cow_v3.3.txt rename to huffware/huffotronic_scripts/data_cow_v3.3.txt diff --git a/huffware/huffotronic_tools_n_testers/die_on_demand_v0.3.txt b/huffware/huffotronic_scripts/die_on_demand_v0.3.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/die_on_demand_v0.3.txt rename to huffware/huffotronic_scripts/die_on_demand_v0.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/docs_for_searchbert_v2.3.txt b/huffware/huffotronic_scripts/docs_for_searchbert_v2.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/docs_for_searchbert_v2.3.txt rename to huffware/huffotronic_scripts/docs_for_searchbert_v2.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/eepaw_shop_note_v0.8.txt b/huffware/huffotronic_scripts/eepaw_shop_note_v0.8.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/eepaw_shop_note_v0.8.txt rename to huffware/huffotronic_scripts/eepaw_shop_note_v0.8.txt diff --git a/huffware/huffotronic_tools_n_testers/email_notecards_v6.2.txt b/huffware/huffotronic_scripts/email_notecards_v6.2.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/email_notecards_v6.2.txt rename to huffware/huffotronic_scripts/email_notecards_v6.2.txt diff --git a/huffware/huffotronic_jaunter_updater/emptiness_jaunter_config_v0.2.txt b/huffware/huffotronic_scripts/emptiness_jaunter_config_v0.2.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/emptiness_jaunter_config_v0.2.txt rename to huffware/huffotronic_scripts/emptiness_jaunter_config_v0.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/fade_opacity_v3.7.txt b/huffware/huffotronic_scripts/fade_opacity_v3.7.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/fade_opacity_v3.7.txt rename to huffware/huffotronic_scripts/fade_opacity_v3.7.txt diff --git a/huffware/huffotronic_eepaw_knowledge/fade_prim_v3.2.txt b/huffware/huffotronic_scripts/fade_prim_v3.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/fade_prim_v3.2.txt rename to huffware/huffotronic_scripts/fade_prim_v3.2.txt diff --git a/huffware/huffotronic_jaunter_updater/fred_main_hubs_v5.4.txt b/huffware/huffotronic_scripts/fred_main_hubs_v5.4.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/fred_main_hubs_v5.4.txt rename to huffware/huffotronic_scripts/fred_main_hubs_v5.4.txt diff --git a/huffware/huffotronic_eepaw_knowledge/fredboxmux_no_rot_v3.0.txt b/huffware/huffotronic_scripts/fredboxmux_no_rot_v3.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/fredboxmux_no_rot_v3.0.txt rename to huffware/huffotronic_scripts/fredboxmux_no_rot_v3.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/fredboxmux_v3.0.txt b/huffware/huffotronic_scripts/fredboxmux_v3.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/fredboxmux_v3.0.txt rename to huffware/huffotronic_scripts/fredboxmux_v3.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/giftorse_v7.6.txt b/huffware/huffotronic_scripts/giftorse_v7.6.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/giftorse_v7.6.txt rename to huffware/huffotronic_scripts/giftorse_v7.6.txt diff --git a/huffware/huffotronic_jaunter_updater/hal9000_config_v0.4.txt b/huffware/huffotronic_scripts/hal9000_config_v0.4.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/hal9000_config_v0.4.txt rename to huffware/huffotronic_scripts/hal9000_config_v0.4.txt diff --git a/huffware/huffotronic_tools_n_testers/hamster_sound_effects_v0.8.txt b/huffware/huffotronic_scripts/hamster_sound_effects_v0.8.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/hamster_sound_effects_v0.8.txt rename to huffware/huffotronic_scripts/hamster_sound_effects_v0.8.txt diff --git a/huffware/huffotronic_jaunter_updater/hamstertram_config_v7.8.txt b/huffware/huffotronic_scripts/hamstertram_config_v7.8.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/hamstertram_config_v7.8.txt rename to huffware/huffotronic_scripts/hamstertram_config_v7.8.txt diff --git a/huffware/huffotronic_tools_n_testers/html_onna_prim_v1.6.txt b/huffware/huffotronic_scripts/html_onna_prim_v1.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/html_onna_prim_v1.6.txt rename to huffware/huffotronic_scripts/html_onna_prim_v1.6.txt diff --git a/huffware/huffotronic_eepaw_knowledge/huff-pet_v18.6.txt b/huffware/huffotronic_scripts/huff-pet_v18.6.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/huff-pet_v18.6.txt rename to huffware/huffotronic_scripts/huff-pet_v18.6.txt diff --git a/huffware/huffotronic_eepaw_knowledge/huff-search_brainiac_v48.1.txt b/huffware/huffotronic_scripts/huff-search_brainiac_v48.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/huff-search_brainiac_v48.1.txt rename to huffware/huffotronic_scripts/huff-search_brainiac_v48.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/huff-search_pointer_v11.9.txt b/huffware/huffotronic_scripts/huff-search_pointer_v11.9.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/huff-search_pointer_v11.9.txt rename to huffware/huffotronic_scripts/huff-search_pointer_v11.9.txt diff --git a/huffware/huffotronic_eepaw_knowledge/huff-update_client_v20.1.txt b/huffware/huffotronic_scripts/huff-update_client_v20.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/huff-update_client_v20.1.txt rename to huffware/huffotronic_scripts/huff-update_client_v20.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/huffbee_bulb_v4.7.txt b/huffware/huffotronic_scripts/huffbee_bulb_v4.7.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/huffbee_bulb_v4.7.txt rename to huffware/huffotronic_scripts/huffbee_bulb_v4.7.txt diff --git a/huffware/huffotronic_eepaw_knowledge/hufflets_v6.3.txt b/huffware/huffotronic_scripts/hufflets_v6.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/hufflets_v6.3.txt rename to huffware/huffotronic_scripts/hufflets_v6.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/huffware_id_registry_v3.2.txt b/huffware/huffotronic_scripts/huffware_id_registry_v3.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/huffware_id_registry_v3.2.txt rename to huffware/huffotronic_scripts/huffware_id_registry_v3.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/inventory_exchanger_v3.7.txt b/huffware/huffotronic_scripts/inventory_exchanger_v3.7.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/inventory_exchanger_v3.7.txt rename to huffware/huffotronic_scripts/inventory_exchanger_v3.7.txt diff --git a/huffware/huffotronic_tools_n_testers/invisiprim_v0.8.txt b/huffware/huffotronic_scripts/invisiprim_v0.8.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/invisiprim_v0.8.txt rename to huffware/huffotronic_scripts/invisiprim_v0.8.txt diff --git a/huffware/huffotronic_eepaw_knowledge/invoke_nechung_v1.2.txt b/huffware/huffotronic_scripts/invoke_nechung_v1.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/invoke_nechung_v1.2.txt rename to huffware/huffotronic_scripts/invoke_nechung_v1.2.txt diff --git a/huffware/huffotronic_jaunter_updater/jaunt_config_funcs_v2.9.txt b/huffware/huffotronic_scripts/jaunt_config_funcs_v2.9.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/jaunt_config_funcs_v2.9.txt rename to huffware/huffotronic_scripts/jaunt_config_funcs_v2.9.txt diff --git a/huffware/huffotronic_jaunter_updater/jaunt_rezolator_v22.3.txt b/huffware/huffotronic_scripts/jaunt_rezolator_v22.3.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/jaunt_rezolator_v22.3.txt rename to huffware/huffotronic_scripts/jaunt_rezolator_v22.3.txt diff --git a/huffware/huffotronic_jaunter_updater/jaunt_wik_rez_v86.3.txt b/huffware/huffotronic_scripts/jaunt_wik_rez_v86.3.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/jaunt_wik_rez_v86.3.txt rename to huffware/huffotronic_scripts/jaunt_wik_rez_v86.3.txt diff --git a/huffware/huffotronic_jaunter_updater/jaunter_button_pusher_v0.8.txt b/huffware/huffotronic_scripts/jaunter_button_pusher_v0.8.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/jaunter_button_pusher_v0.8.txt rename to huffware/huffotronic_scripts/jaunter_button_pusher_v0.8.txt diff --git a/huffware/huffotronic_eepaw_knowledge/jaunting_library_v15.9.txt b/huffware/huffotronic_scripts/jaunting_library_v15.9.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/jaunting_library_v15.9.txt rename to huffware/huffotronic_scripts/jaunting_library_v15.9.txt diff --git a/huffware/huffotronic_eepaw_knowledge/jump_good_v6.0.txt b/huffware/huffotronic_scripts/jump_good_v6.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/jump_good_v6.0.txt rename to huffware/huffotronic_scripts/jump_good_v6.0.txt diff --git a/huffware/huffotronic_tools_n_testers/license__free_in_osgrid_&_personal_opensims_only_v1.9.txt b/huffware/huffotronic_scripts/license__free_in_osgrid_&_personal_opensims_only_v1.9.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/license__free_in_osgrid_&_personal_opensims_only_v1.9.txt rename to huffware/huffotronic_scripts/license__free_in_osgrid_&_personal_opensims_only_v1.9.txt diff --git a/huffware/huffotronic_tools_n_testers/link_reporter_v0.5.txt b/huffware/huffotronic_scripts/link_reporter_v0.5.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/link_reporter_v0.5.txt rename to huffware/huffotronic_scripts/link_reporter_v0.5.txt diff --git a/huffware/huffotronic_tools_n_testers/logic_system_main_v1.8.txt b/huffware/huffotronic_scripts/logic_system_main_v1.8.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/logic_system_main_v1.8.txt rename to huffware/huffotronic_scripts/logic_system_main_v1.8.txt diff --git a/huffware/huffotronic_eepaw_knowledge/mediatron_control_v7.2.txt b/huffware/huffotronic_scripts/mediatron_control_v7.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/mediatron_control_v7.2.txt rename to huffware/huffotronic_scripts/mediatron_control_v7.2.txt diff --git a/huffware/huffotronic_tools_n_testers/megaprim_v0.3.txt b/huffware/huffotronic_scripts/megaprim_v0.3.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/megaprim_v0.3.txt rename to huffware/huffotronic_scripts/megaprim_v0.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/menu_list_manager_v12.7.txt b/huffware/huffotronic_scripts/menu_list_manager_v12.7.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/menu_list_manager_v12.7.txt rename to huffware/huffotronic_scripts/menu_list_manager_v12.7.txt diff --git a/huffware/huffotronic_eepaw_knowledge/menutini_library_v6.1.txt b/huffware/huffotronic_scripts/menutini_library_v6.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/menutini_library_v6.1.txt rename to huffware/huffotronic_scripts/menutini_library_v6.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/minnow_v10.6.txt b/huffware/huffotronic_scripts/minnow_v10.6.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/minnow_v10.6.txt rename to huffware/huffotronic_scripts/minnow_v10.6.txt diff --git a/huffware/huffotronic_tools_n_testers/mu_tester_v6.0.txt b/huffware/huffotronic_scripts/mu_tester_v6.0.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/mu_tester_v6.0.txt rename to huffware/huffotronic_scripts/mu_tester_v6.0.txt diff --git a/huffware/huffotronic_tools_n_testers/no_sitting_on_vendor_v1.0.txt b/huffware/huffotronic_scripts/no_sitting_on_vendor_v1.0.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/no_sitting_on_vendor_v1.0.txt rename to huffware/huffotronic_scripts/no_sitting_on_vendor_v1.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/non-script_giver_v3.2.txt b/huffware/huffotronic_scripts/non-script_giver_v3.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/non-script_giver_v3.2.txt rename to huffware/huffotronic_scripts/non-script_giver_v3.2.txt diff --git a/huffware/huffotronic_tools_n_testers/noteworthy_example_usage_v3.6.txt b/huffware/huffotronic_scripts/noteworthy_example_usage_v3.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/noteworthy_example_usage_v3.6.txt rename to huffware/huffotronic_scripts/noteworthy_example_usage_v3.6.txt diff --git a/huffware/huffotronic_jaunter_updater/noteworthy_library_v12.4.txt b/huffware/huffotronic_scripts/noteworthy_library_v12.4.txt similarity index 100% rename from huffware/huffotronic_jaunter_updater/noteworthy_library_v12.4.txt rename to huffware/huffotronic_scripts/noteworthy_library_v12.4.txt diff --git a/huffware/huffotronic_eepaw_knowledge/noteworthy_library_v12.5.txt b/huffware/huffotronic_scripts/noteworthy_library_v12.5.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/noteworthy_library_v12.5.txt rename to huffware/huffotronic_scripts/noteworthy_library_v12.5.txt diff --git a/huffware/huffotronic_eepaw_knowledge/particle_projector_v3.1.txt b/huffware/huffotronic_scripts/particle_projector_v3.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/particle_projector_v3.1.txt rename to huffware/huffotronic_scripts/particle_projector_v3.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/party_culiar_v6.1.txt b/huffware/huffotronic_scripts/party_culiar_v6.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/party_culiar_v6.1.txt rename to huffware/huffotronic_scripts/party_culiar_v6.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/phantomizer_v1.6.txt b/huffware/huffotronic_scripts/phantomizer_v1.6.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/phantomizer_v1.6.txt rename to huffware/huffotronic_scripts/phantomizer_v1.6.txt diff --git a/huffware/huffotronic_eepaw_knowledge/puffer_v1.3.txt b/huffware/huffotronic_scripts/puffer_v1.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/puffer_v1.3.txt rename to huffware/huffotronic_scripts/puffer_v1.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/radio_tuner_v1.2.txt b/huffware/huffotronic_scripts/radio_tuner_v1.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/radio_tuner_v1.2.txt rename to huffware/huffotronic_scripts/radio_tuner_v1.2.txt diff --git a/huffware/huffotronic_tools_n_testers/report_to_merchants_v1.6.txt b/huffware/huffotronic_scripts/report_to_merchants_v1.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/report_to_merchants_v1.6.txt rename to huffware/huffotronic_scripts/report_to_merchants_v1.6.txt diff --git a/huffware/huffotronic_eepaw_knowledge/rezzeroni_v21.0.txt b/huffware/huffotronic_scripts/rezzeroni_v21.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/rezzeroni_v21.0.txt rename to huffware/huffotronic_scripts/rezzeroni_v21.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/rotanium_rotato_v2.7.txt b/huffware/huffotronic_scripts/rotanium_rotato_v2.7.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/rotanium_rotato_v2.7.txt rename to huffware/huffotronic_scripts/rotanium_rotato_v2.7.txt diff --git a/huffware/huffotronic_tools_n_testers/sculpty_morpher_v0.6.txt b/huffware/huffotronic_scripts/sculpty_morpher_v0.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/sculpty_morpher_v0.6.txt rename to huffware/huffotronic_scripts/sculpty_morpher_v0.6.txt diff --git a/huffware/huffotronic_eepaw_knowledge/searchbert_armature_v15.3.txt b/huffware/huffotronic_scripts/searchbert_armature_v15.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/searchbert_armature_v15.3.txt rename to huffware/huffotronic_scripts/searchbert_armature_v15.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/searchbert_config_v1.2.txt b/huffware/huffotronic_scripts/searchbert_config_v1.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/searchbert_config_v1.2.txt rename to huffware/huffotronic_scripts/searchbert_config_v1.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/searchbert_menus_v5.2.txt b/huffware/huffotronic_scripts/searchbert_menus_v5.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/searchbert_menus_v5.2.txt rename to huffware/huffotronic_scripts/searchbert_menus_v5.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/set_comparator_library_v4.1.txt b/huffware/huffotronic_scripts/set_comparator_library_v4.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/set_comparator_library_v4.1.txt rename to huffware/huffotronic_scripts/set_comparator_library_v4.1.txt diff --git a/huffware/huffotronic_tools_n_testers/set_roundy_v0.6.txt b/huffware/huffotronic_scripts/set_roundy_v0.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/set_roundy_v0.6.txt rename to huffware/huffotronic_scripts/set_roundy_v0.6.txt diff --git a/huffware/huffotronic_tools_n_testers/simple_map_tp_v0.3.txt b/huffware/huffotronic_scripts/simple_map_tp_v0.3.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/simple_map_tp_v0.3.txt rename to huffware/huffotronic_scripts/simple_map_tp_v0.3.txt diff --git a/huffware/huffotronic_tools_n_testers/simpy_pet_v3.7.txt b/huffware/huffotronic_scripts/simpy_pet_v3.7.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/simpy_pet_v3.7.txt rename to huffware/huffotronic_scripts/simpy_pet_v3.7.txt diff --git a/huffware/huffotronic_tools_n_testers/sit_testing_v0.6.txt b/huffware/huffotronic_scripts/sit_testing_v0.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/sit_testing_v0.6.txt rename to huffware/huffotronic_scripts/sit_testing_v0.6.txt diff --git a/huffware/huffotronic_eepaw_knowledge/slate_reader_v1.2.txt b/huffware/huffotronic_scripts/slate_reader_v1.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/slate_reader_v1.2.txt rename to huffware/huffotronic_scripts/slate_reader_v1.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/star_chair_sitting_config_v0.4.txt b/huffware/huffotronic_scripts/star_chair_sitting_config_v0.4.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/star_chair_sitting_config_v0.4.txt rename to huffware/huffotronic_scripts/star_chair_sitting_config_v0.4.txt diff --git a/huffware/huffotronic_tools_n_testers/swiveller_v1.1.txt b/huffware/huffotronic_scripts/swiveller_v1.1.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/swiveller_v1.1.txt rename to huffware/huffotronic_scripts/swiveller_v1.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/take_touches_v0.2.txt b/huffware/huffotronic_scripts/take_touches_v0.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/take_touches_v0.2.txt rename to huffware/huffotronic_scripts/take_touches_v0.2.txt diff --git a/huffware/huffotronic_tools_n_testers/tester_for_inventory_exchanger_v1.0.txt b/huffware/huffotronic_scripts/tester_for_inventory_exchanger_v1.0.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/tester_for_inventory_exchanger_v1.0.txt rename to huffware/huffotronic_scripts/tester_for_inventory_exchanger_v1.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/text_label_v4.1.txt b/huffware/huffotronic_scripts/text_label_v4.1.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/text_label_v4.1.txt rename to huffware/huffotronic_scripts/text_label_v4.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/texture_mover_v3.0.txt b/huffware/huffotronic_scripts/texture_mover_v3.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/texture_mover_v3.0.txt rename to huffware/huffotronic_scripts/texture_mover_v3.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/texture_shower_v2.7.txt b/huffware/huffotronic_scripts/texture_shower_v2.7.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/texture_shower_v2.7.txt rename to huffware/huffotronic_scripts/texture_shower_v2.7.txt diff --git a/huffware/huffotronic_tools_n_testers/time_zone_picker_v0.6.txt b/huffware/huffotronic_scripts/time_zone_picker_v0.6.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/time_zone_picker_v0.6.txt rename to huffware/huffotronic_scripts/time_zone_picker_v0.6.txt diff --git a/huffware/huffotronic_tools_n_testers/timed_expiration_v2.9_(toxic)_.txt b/huffware/huffotronic_scripts/timed_expiration_v2.9_(toxic)_.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/timed_expiration_v2.9_(toxic)_.txt rename to huffware/huffotronic_scripts/timed_expiration_v2.9_(toxic)_.txt diff --git a/huffware/huffotronic_tools_n_testers/touchy_feely_doro_v0.4.txt b/huffware/huffotronic_scripts/touchy_feely_doro_v0.4.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/touchy_feely_doro_v0.4.txt rename to huffware/huffotronic_scripts/touchy_feely_doro_v0.4.txt diff --git a/huffware/huffotronic_tools_n_testers/turbo_lifter_v5.8.txt b/huffware/huffotronic_scripts/turbo_lifter_v5.8.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/turbo_lifter_v5.8.txt rename to huffware/huffotronic_scripts/turbo_lifter_v5.8.txt diff --git a/huffware/huffotronic_tools_n_testers/uuid_shower_mat_v0.3.txt b/huffware/huffotronic_scripts/uuid_shower_mat_v0.3.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/uuid_shower_mat_v0.3.txt rename to huffware/huffotronic_scripts/uuid_shower_mat_v0.3.txt diff --git a/huffware/huffotronic_tools_n_testers/vendor_sales_manager_v3.1.txt b/huffware/huffotronic_scripts/vendor_sales_manager_v3.1.txt similarity index 100% rename from huffware/huffotronic_tools_n_testers/vendor_sales_manager_v3.1.txt rename to huffware/huffotronic_scripts/vendor_sales_manager_v3.1.txt diff --git a/huffware/huffotronic_eepaw_knowledge/viewscreen_blitter_v3.9.txt b/huffware/huffotronic_scripts/viewscreen_blitter_v3.9.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/viewscreen_blitter_v3.9.txt rename to huffware/huffotronic_scripts/viewscreen_blitter_v3.9.txt diff --git a/huffware/huffotronic_eepaw_knowledge/weapon_fire_v2.2.txt b/huffware/huffotronic_scripts/weapon_fire_v2.2.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/weapon_fire_v2.2.txt rename to huffware/huffotronic_scripts/weapon_fire_v2.2.txt diff --git a/huffware/huffotronic_eepaw_knowledge/welcomebot_v4.0.txt b/huffware/huffotronic_scripts/welcomebot_v4.0.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/welcomebot_v4.0.txt rename to huffware/huffotronic_scripts/welcomebot_v4.0.txt diff --git a/huffware/huffotronic_eepaw_knowledge/wylie_controller_v8.4.txt b/huffware/huffotronic_scripts/wylie_controller_v8.4.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/wylie_controller_v8.4.txt rename to huffware/huffotronic_scripts/wylie_controller_v8.4.txt diff --git a/huffware/huffotronic_eepaw_knowledge/zap_updater_from_elevators_v1.3.txt b/huffware/huffotronic_scripts/zap_updater_from_elevators_v1.3.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/zap_updater_from_elevators_v1.3.txt rename to huffware/huffotronic_scripts/zap_updater_from_elevators_v1.3.txt diff --git a/huffware/huffotronic_eepaw_knowledge/zenmondos_mailbox_v0.4.txt b/huffware/huffotronic_scripts/zenmondos_mailbox_v0.4.txt similarity index 100% rename from huffware/huffotronic_eepaw_knowledge/zenmondos_mailbox_v0.4.txt rename to huffware/huffotronic_scripts/zenmondos_mailbox_v0.4.txt diff --git a/huffware/huffotronic_tools_n_testers/a_huffotronic_update_server_v23.3.txt b/huffware/huffotronic_tools_n_testers/a_huffotronic_update_server_v23.3.txt deleted file mode 100755 index fbba630b..00000000 --- a/huffware/huffotronic_tools_n_testers/a_huffotronic_update_server_v23.3.txt +++ /dev/null @@ -1,939 +0,0 @@ - -// huffware script: huff-update server, by fred huffhines. -// -// this script is the server side of the update process. it should reside in an object that -// has all the newest versions of scripts and objects that will be updated. when rezzed, and -// at periodic intervals, it announces on a private chat channel that updates are available. -// when objects respond that they might like an update, it tells them the scripts that it has -// stored inside of it. if any of those scripts are an older version inside the client -// (update requesting) object, then the client will request the newer versions. the server -// object will stuff them into it and tell them to start running. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -integer IS_OPENSIM = TRUE; // must be set to true for opensim, false for second life. - -integer DEBUGGING = FALSE; // set this to true for noisier diagnostics. - - - -// updater dependency section: -// should be moved to a notecard!!! -// -// format is a list of strings, where each string has a pair wrapped by the -// huffware item separators. the pair contains (1) the basename of a script -// that has a new dependency and (2) the basename of that new dependency. -list known_script_dependencies; - - - - -load_script_deps() -{ - known_script_dependencies = [ - llDumpList2String(["jaunt wik rez", "jaunt config funcs"], ITEM_LIST_SEPARATOR), - llDumpList2String(["jaunt wik rez", "data cow"], ITEM_LIST_SEPARATOR), - llDumpList2String(["jaunt wik rez", "jaunt rezolator"], ITEM_LIST_SEPARATOR), - llDumpList2String(["remotely personable", "inventory exchanger"], ITEM_LIST_SEPARATOR), - llDumpList2String(["animote main driver", "exchange driver hudimation"], ITEM_LIST_SEPARATOR), - llDumpList2String(["animote main driver", "avatar timer manager"], ITEM_LIST_SEPARATOR), - llDumpList2String(["animote main driver", "avatar choice memory"], ITEM_LIST_SEPARATOR), - llDumpList2String(["giftorse", "particle projector"], ITEM_LIST_SEPARATOR), - llDumpList2String(["huff-search brainiac", "searchbert armature"], ITEM_LIST_SEPARATOR), - - -//special purpose -- removes the updater from the elevator buttons... -//llDumpList2String(["comfortable sitting", "zap updater from elevators"], ITEM_LIST_SEPARATOR), -// => do not uncomment unless you want your elevators to shed their ability to update. - - - // this allows us to add or remove items above at will without complaints about comma. - llDumpList2String(["xyzzy", "hopefully-never-matches"], ITEM_LIST_SEPARATOR) - ]; -} - - - - -// global constants... - -integer USER_COMMAND_CHANNEL = 4; // channel where we listen to user commands. - -float ANNOUNCEMENT_PERIOD = 14.0; // how often we tell other objects that we have tasty treats. - -integer UPDATE_ANNOUNCEMENT_CHANNEL = -420108; // used by server to brag about itself. -integer OLD_REQUEST_INVENTORY_CHANNEL = -421008; // used by clients to request an update list. - -string UPDATE_ANNOUNCEMENT_PREFIX = "#huff-update#"; // first part of any announcement. -string REQUEST_INVENTORY_PREFIX = "#huff-reqinv#"; // first part of request for inventory list. -string REPORT_AVAILABLE_SCRIPTS = "#scripts#"; // server's keyword to let client know script inventory. -string REQUEST_SCRIPT_UPDATE = "#updatego#"; // keyword used by client to request some updates. -string SHUT_THEM_DOWN = "#huffdown#"; // server tells client to stop any non-updater scripts. -string READY_TO_UPDATE = "#listoneeds#"; // the client tells the server the scripts it wants. -string SCRIPTS_ARE_CURRENT = "#gottemthx#"; // client says this when all new scripts are in place. -string START_THEM_UP = "#huffup#"; // server tells client to start up other scripts again. -string DONE_UPDATING = "#finito#"; // the client is done updating. -string BUSY_BUSY = "#busymuch#"; // a signal that the server is too busy to update us. - -integer UPDATER_SCRIPT_PIN = -1231008; // the hook for our scripts to be modified. - -string RESTART_UPDATER_COMMAND = "#restart"; // said in open chat to recrank the updater. -string SHOW_SCRIPTS_COMMAND = "#show"; // said in open chat to list out the scripts. -string SHUTDOWN_COMMAND = "#destroy"; // shuts down object and destroys it. - -string UPDATER_PARM_SEPARATOR = "~~~"; - // three tildes is an uncommon thing to have otherwise, so we use it to separate - // our commands in linked messages. - -string SCRIPT_DEPENDENCY_MARK = "DEP"; // signals that a dependency is coming. - -integer ENTRIES_PER_LINE = 4; // number of items from a list shown on one line of text. - -integer MAXIMUM_ACTIVE_CLIENTS = 5; // number of conversations we will allow at a time. - -float LONGEST_SLACK_PER_CLIENT = 84.0; - // we allow a client to be out of touch with us for this many seconds. after that, - // we decide it's deceased and remove it from our list. - -integer MESSAGE_SIZE_LIMIT = 800; // longest thing that can be safely said without clipping (guess). - -float SCRIPT_LIST_PAUSE_INTERVAL = 1.4; // pause between large chunks of update text. - -string ITEM_LIST_SEPARATOR = "``"; // separates dependencies. - -float CHANGED_INVENTORY_SNOOZER = 7.0; - // the number of seconds we sleep once we see an inventory change. we don't want to - // react to this immediately. this overrides the normal announcement cycle until it's - // dealt with by the timer. - -string CONTINUANCE_MARKER = "..."; - // a string sent when the update list is too long and needs to be continued in another chat. - -string UPDATER_BASE_NAME = "huff-update client"; - // the name of the updater script that keeps everything in sync. - -////////////// - -// global variables... - -list scripts_available; // the list of scripts we have in our inventory for distribution. -list objects_available; // list of objects for handing out. - -list active_clients; // list of keys for clients that are updating currently. -list active_update_channels; // active conversations on client chosen channels. -list active_listen_ids; // the ids for the listener on those channels. -list active_timestamps; // tracks when the client was last active. - -integer inventory_request_channel; // our personal channel that the update client should talk with. - -integer dealing_with_change; // has the inventory changed? we will deal with this in the timer. - -// displays the status of the update server. -show_status(key who_says) -{ - string title = "[mem free=" + (string)llGetFreeMemory() + "]"; - title = "Listening for requests on channel " + (string)inventory_request_channel; - if (llGetListLength(active_update_channels)) - title += "\nactive channels=" - + dump_list(active_update_channels, FALSE, ENTRIES_PER_LINE); - else - title += "\nNo channels active."; - - if (llGetListLength(active_clients)) - title += "\nactive clients=" + dump_keyed_list(active_clients, TRUE, 2); - else - title += "\nNo clients active."; - - if (llGetOwner() == who_says) { - string addition = " "; - if (USER_COMMAND_CHANNEL != 0) addition = "/" + (string)USER_COMMAND_CHANNEL + " "; - title += "\n[ \"" + addition + SHOW_SCRIPTS_COMMAND + "\" lists all the scripts, " - + "\"" + addition + SHUTDOWN_COMMAND + "\" zaps the updater, " - + "\"" + addition + RESTART_UPDATER_COMMAND + "\" refreshes the updater ]"; - } - - llWhisper(0, title); -} - -// plink a quietous string of resonance... -squonk(integer indy) -{ - string snd = llGetInventoryName(INVENTORY_SOUND, indy); - if (snd != "") llTriggerSound(snd, 1.0); -} - -// list out the scripts that the server's object contains. -show_scripts() -{ - string title = (string)llGetListLength(scripts_available) + " scripts available:"; - show_list(title, scripts_available); - title = (string)llGetListLength(objects_available) + " objects available:"; - show_list(title, objects_available); -} - -// lets the client know that we're here and have some scripts available. -announce_presence() -{ - if (llGetListLength(active_clients) < MAXIMUM_ACTIVE_CLIENTS) { - // only announce if we're not already booked up. - llWhisper(UPDATE_ANNOUNCEMENT_CHANNEL, UPDATE_ANNOUNCEMENT_PREFIX + (string)inventory_request_channel); - } -} - -// lifted from "clear text and effects" script; should be nearly identical -// to that, except that we set the texture animation. -reset_all_effects() -{ - llSetText("", <0,0,0>, 0); // clear any text above object. - llSetSitText("Sit Here"); // reset sit text to default state. - llSetTouchText("Touch"); // similarly for touch. - llSitTarget(ZERO_VECTOR, ZERO_ROTATION); // reset sit target position. - llParticleSystem([]); // turn off all particles. - llSensorRemove(); // stop any running sensors. - llTargetOmega(<0.0, 0.0, 0.0>, 0, 1.0); // stop rotations of object. - llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); // turn off any transparency. - // keep it from being physical and from disapparating. - llSetPrimitiveParams([PRIM_TEMP_ON_REZ, FALSE, PRIM_PHYSICS, FALSE, - PRIM_PHANTOM, TRUE]); - llSetLinkColor(LINK_SET, <1.0, 1.0, 1.0>, ALL_SIDES); // reset color to white. - - // - // the following are specific to the huffotronic update server. - // - - // we re-assert our special texture set here, in case some wayward scripts have - // messed with us. - integer textures_held = llGetInventoryNumber(INVENTORY_TEXTURE); - integer indy; - for (indy = 0; indy < textures_held; indy++) { - string curr_tex = llGetInventoryName(INVENTORY_TEXTURE, indy); - // we have a simple scheme for putting textures on the updater. - // we have an inside, an outside and the ends. - if (is_prefix(curr_tex, "~~s0")) { - llSetTexture(curr_tex, ALL_SIDES); - } else if (is_prefix(curr_tex, "~~s1")) { - llSetTexture(curr_tex, 1); - } else if (is_prefix(curr_tex, "~~s2")) { - llSetTexture(curr_tex, 0); - llSetTexture(curr_tex, 3); - } - } - - // re-assert our texture animation also. - llSetTextureAnim(ANIM_ON | LOOP | SMOOTH | ROTATE, - ALL_SIDES, 0, 0, 0, TWO_PI, 1.0 / 36.0); -} - -// set up the update server object. -initialize_root() -{ - // set up our particular "look". - reset_all_effects(); - - // shut down any competing scripts in this object. - // we try to swat any other script that's been added before we let them do weird - // stuff. for example, a pet script might start acting like one. this - // function is not guaranteed to run before that bad stuff can happen, - // and that's maybe the one major issue with this approach. as long as - // the contained scripts aren't evil (like if they jump someplace else - // as soon as they start), then there shouldn't be any serious problems. - knock_down_other_scripts(); - - // reset our variables. - active_update_channels = []; - active_listen_ids = []; - active_clients = []; - active_timestamps = []; - scripts_available = []; - objects_available = []; - dealing_with_change = FALSE; // not handling any inventory changes. - - // make sure we know about any scripts that have new dependencies. - load_script_deps(); - - // clean out any older versions of the scripts before we make our - // inventory. - destroy_older_versions(); - - // now accumulate the list of scripts in our inventory. - integer items_held = llGetInventoryNumber(INVENTORY_SCRIPT); - integer indy; - for (indy = 0; indy < items_held; indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - // we don't provide our own script for updating; it must be kept from - // floating around, like into other objects that are not updaters. -//// if (curr_script != llGetScriptName()) - scripts_available += curr_script; - } - items_held = llGetInventoryNumber(INVENTORY_OBJECT); - for (indy = 0; indy < items_held; indy++) { - objects_available += llGetInventoryName(INVENTORY_OBJECT, indy); -//log_it("added obj: " + llGetInventoryName(INVENTORY_OBJECT, indy)); - } - items_held = llGetInventoryNumber(INVENTORY_NOTECARD); - for (indy = 0; indy < items_held; indy++) { - objects_available += llGetInventoryName(INVENTORY_NOTECARD, indy); -//log_it("added note: " + llGetInventoryName(INVENTORY_NOTECARD, indy)); - } - - // listen to the owner. - llListen(USER_COMMAND_CHANNEL, "", llGetOwner(), ""); - // listen for any requests from our loyal clients. - inventory_request_channel = random_channel(); - llListen(inventory_request_channel, "", NULL_KEY, ""); - // listen for older clients too. - llListen(OLD_REQUEST_INVENTORY_CHANNEL, "", NULL_KEY, ""); - - // set up the periodic announcements. - llSetTimerEvent(ANNOUNCEMENT_PERIOD); -} - -handle_timer() -{ - if (dealing_with_change) { - dealing_with_change = FALSE; - state rerun; // zoom back to the starting point. - } - integer indy; - integer timecheck = llGetUnixTime(); // use for whole loop. - for (indy = llGetListLength(active_timestamps) - 1; indy >= 0; indy--) { - integer last_time = llList2Integer(active_timestamps, indy); - if (llAbs(last_time - timecheck) > LONGEST_SLACK_PER_CLIENT) { - // we need to clear out this item. we know we can whack the client - // at the same index and that will take care of this slacker. - key curr_key = llList2Key(active_clients, indy); - log_it("timed-out client: " + llKey2Name(curr_key) + " [" + (string)curr_key + "]"); - remove_client(curr_key); - } - } - - // let the objects nearby know that we are open for business by - // announcing the script inventory. - announce_presence(); -} - -// turns a list into a nicely formatted string. -string dump_list(list to_show, integer initial_line_break, integer entries_per_line) -{ - string msg; - integer indy; - for (indy = 0; indy < llGetListLength(to_show); indy++) { - // we break every Nth entry, but not if it's the first line and - // they said to not have the initial line break. - if ( !(indy % entries_per_line) && (indy || initial_line_break) ) - msg += "\n"; - string cursc = llList2String(to_show, indy); - msg += cursc; - // add commas where needed. - if (indy < llGetListLength(to_show) - 1) - msg += ", "; - } - return msg; -} - -// similar to dump_keyed_list, but only shows the names, each on their own line. -string dump_names_for_keys(list to_show) -{ - string msg; - integer indy; - for (indy = 0; indy < llGetListLength(to_show); indy++) { - // we only line break after the first entry. - if (indy > 0) msg += "\n"; - string keystr = llList2String(to_show, indy); - msg += llKey2Name(keystr); - } - return msg; -} - -// similar to dump_list -string dump_keyed_list(list to_show, integer initial_line_break, integer entries_per_line) -{ - string msg; - integer indy; - for (indy = 0; indy < llGetListLength(to_show); indy++) { - // we break every Nth entry, but not if it's the first line and - // they said to not have the initial line break. - if ( !(indy % entries_per_line) && (indy || initial_line_break) ) - msg += "\n"; - string keystr = llList2String(to_show, indy); - msg += llKey2Name(keystr) + " (" + keystr + ")"; - // add commas where needed. - if (indy < llGetListLength(to_show) - 1) - msg += ", "; - } - return msg; -} - -// shows the list specified in a compact manner. -show_list(string title, list to_show) -{ - string to_say = title + dump_list(to_show, TRUE, ENTRIES_PER_LINE); - // flush some memory. - title = ""; - to_show = []; - integer indy; - // say the output in pieces to avoid over-clogging chat. - for (indy = 0; indy < llStringLength(to_say); indy += MESSAGE_SIZE_LIMIT) { - integer last_indy = indy + MESSAGE_SIZE_LIMIT - 1; - string addition; - if (last_indy < llStringLength(to_say)) addition = CONTINUANCE_MARKER; - llWhisper(0, llGetSubString(to_say, indy, last_indy) + addition); - } -} - -// stops all the scripts besides this one. -knock_down_other_scripts() -{ - // set all scripts but this to not be running. - integer indy; - string self_script = llGetScriptName(); - list split = compute_basename_and_version(self_script); - string self_base = llList2String(split, 0); - self_script = ""; split = []; // free memory. - integer count = llGetInventoryNumber(INVENTORY_SCRIPT); - // we set all other scripts that are not versions of this script to not be running. - for (indy = 0; indy < count; indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - if (!is_prefix(curr_script, self_base) - && !is_prefix(curr_script, UPDATER_BASE_NAME) ) { - llSetScriptState(curr_script, FALSE); - } - } -} - -// set a text label on the updater with the list of clients. -set_our_label() -{ - string label = ""; - if (llGetListLength(active_clients) > 0) label = "[updating]\n"; - llSetText(label + dump_names_for_keys(active_clients), <0.8, 0.95, 0.92>, 1.0); -} - -// clean out a client that we should be done with. -remove_client(key id) -{ - // locate said client of deceased nature... - integer indy = find_in_list(active_clients, id); - if (indy < 0) { -// if (DEBUGGING) log_it("failure to find client to remove: " + (string)id); - return; - } - active_clients = llDeleteSubList(active_clients, indy, indy); - // also clean out the channel and stop listening to it. -integer act_chan = llList2Integer(active_update_channels, indy); - active_update_channels = llDeleteSubList(active_update_channels, indy, indy); - integer listen_to_remove = llList2Integer(active_listen_ids, indy); -//log_it("remove listen " + (string)listen_to_remove + " on chan " + (string)act_chan); - llListenRemove(listen_to_remove); - active_listen_ids = llDeleteSubList(active_listen_ids, indy, indy); - active_timestamps = llDeleteSubList(active_timestamps, indy, indy); - set_our_label(); -} - -// fix a partial match to a script name if we can't find the exact item. -string backpatch_script_name(string partial) -{ - if (llGetInventoryType(partial) == INVENTORY_SCRIPT) return partial; // all set. - integer dep_indy; - for (dep_indy = 0; dep_indy < llGetInventoryNumber(INVENTORY_SCRIPT); dep_indy++) { - string curr_name = llGetInventoryName(INVENTORY_SCRIPT, dep_indy); - if (is_prefix(curr_name, partial)) { -// log_it("found real name " + curr_name + " for part: " + partial); - return curr_name; - } - } -// log_it("no matches for partial script name!"); - return ""; // no matches! -} - -// moves the upgrade process with "id" along to the next step given the request in -// the message. -propel_upgrade_process(integer channel, key id, string message) -{ - if (DEBUGGING) log_it("got upgrade note from " + (string)id + " with msg=" + message); - if (message == REQUEST_SCRIPT_UPDATE) { - // begins the update process with the client. - llSay(channel, SHUT_THEM_DOWN); - } else if (is_prefix(message, READY_TO_UPDATE)) { - // whack the prefix so we can get the list they want. - message = llDeleteSubString(message, 0, llStringLength(READY_TO_UPDATE) - 1); - list requests = llParseString2List(message, [UPDATER_PARM_SEPARATOR], []); - message = ""; - // send over the scripts the client asked for, since it seems to be ready for them. - if (llGetListLength(requests)) { - show_list("updating " + llKey2Name(id) + " (key " + (string)id + ") with", requests); - integer indy; - for (indy = 0; indy < llGetListLength(requests); indy++) { - string curr = llList2String(requests, indy); - if (find_in_list(objects_available, curr) >= 0) { -//log_it("handing object over: " + curr); - // it's an object, so treat it that way. - llGiveInventory(id, curr); - } else { -//log_it("handing script over: " + curr); - // assume it's a script, and use script pin to stuff it. - curr = backpatch_script_name(curr); - if (curr != "") { - // second life was okay with scripts being plugged in unstarted; opensim is not. - // and second life appears to be unhappy when scripts are added to objects in - // a running state. so we have an impasse. so 'running' should be true - // for opensim, and false for second life. - integer running = IS_OPENSIM; -// if (DEBUGGING) log_it("installing script using updater pin."); - llRemoteLoadScriptPin(id, curr, UPDATER_SCRIPT_PIN, running, 0); - } - } - } - } - } else if (message == SCRIPTS_ARE_CURRENT) { - // the client thinks it's ready to get back up and running. -//log_it("heard client is ready!"); - llSay(channel, START_THEM_UP); - // kludge for older clients (pre 10.4 version) to try to help them start up. -//old and not useful. llSleep(0.2); llSay(channel, START_THEM_UP); llSleep(0.2); llSay(channel, START_THEM_UP); - remove_client(id); - } else if (message == DONE_UPDATING) { - // this client has nothing to do for now. -//log_it("heard client is done: " + (string)id); - remove_client(id); - } else { -//log_it("weird note from client: " + message); - return; // not used. - } - -} - -// blasts out the inventory list to a curious client. -spew_inventory_list(integer channel, string message, key id) -{ - if (!is_prefix(message, REQUEST_INVENTORY_PREFIX)) { - - // this is an old style update alert that we still use at startup of the client - // to ensure that finishing replacement of the updater script is never unnoticed. - if (is_prefix(message, DONE_UPDATING)) { -// if (DEBUGGING) log_it("found very special message from startup of updater."); - propel_upgrade_process(channel, id, message); - } - - // argh, this is not the right kind of message on our channel. - return; - } - string chan_str = llDeleteSubString(message, 0, llStringLength(REQUEST_INVENTORY_PREFIX) - 1); - integer new_update_channel = (integer)chan_str; - if (llGetListLength(active_clients) >= MAXIMUM_ACTIVE_CLIENTS) { - // got to tell them "not right now". we'll pretend we have no - // scripts; they'll know what we mean if the update client is - // recent enough. really old clients will just go to sleep until later. - if (DEBUGGING) log_it("having to disallow new client '" + llKey2Name(id) + "', too many now."); - llSay(new_update_channel, REPORT_AVAILABLE_SCRIPTS + BUSY_BUSY); - return; - } - - // looks like we're going to try to handle the request for them. - if (DEBUGGING) log_it("server heard update req on chan " + (string)channel + " from: " + llKey2Name(id)); - -//log_it("add client convo chan " + (string)new_update_channel); - integer existing_indy = find_in_list(active_clients, id); - if (existing_indy < 0) { - active_clients += id; - active_update_channels += new_update_channel; - integer new_listen_id = llListen(new_update_channel, "", id, ""); -//log_it("add listen " + (string)new_listen_id + " on chan " + (string)new_update_channel); - active_listen_ids += new_listen_id; - active_timestamps += llGetUnixTime(); - set_our_label(); - } else { -// if (DEBUGGING) log_it("same client came back before finishing previous upgrade, rolling with it."); - // delete old listener so we don't leave it dangling. - integer old_listen_id = llList2Integer(active_listen_ids, existing_indy); -//log_it("remove old listen " + (string)old_listen_id); - llListenRemove(old_listen_id); - // update the channel and listener id for the new registration. - active_update_channels = chop_list(active_update_channels, 0, existing_indy - 1) - + [ new_update_channel ] - + chop_list(active_update_channels, existing_indy + 1, - llGetListLength(active_update_channels) - 1); - integer new_listen_id = llListen(new_update_channel, "", id, ""); -//log_it("add new listen " + (string)new_listen_id); - active_listen_ids = chop_list(active_listen_ids, 0, existing_indy - 1) - + [ new_listen_id ] - + chop_list(active_listen_ids, existing_indy + 1, - llGetListLength(active_listen_ids) - 1); - active_timestamps = chop_list(active_timestamps, 0, existing_indy - 1) - + [ new_listen_id ] - + chop_list(active_timestamps, existing_indy + 1, - llGetListLength(active_timestamps) - 1); - } - - // our report name is always called available scripts, but it can actually have - // script dependency definitions, script names and object names. - string msg = REPORT_AVAILABLE_SCRIPTS; - string curr; // temp. - - // add in the huff updater, since that's the most crucial that they know we have. - integer posn; - string UPDATE_CLIENT_SCRIPT = "huff-update client"; - for (posn = 0; posn < llGetListLength(scripts_available); posn++) { - curr = llList2String(scripts_available, posn); - if (llDeleteSubString(curr, llStringLength(UPDATE_CLIENT_SCRIPT), -1) - == UPDATE_CLIENT_SCRIPT) { -//log_it("found " + curr); - msg += curr + UPDATER_PARM_SEPARATOR; - posn = 99999; // jump out. - } - if (DEBUGGING && (posn == llGetListLength(scripts_available) - 1) ) { - log_it("epic fail, found no updater client script."); - } - } - - // speak about the dependencies that we know. - for (posn = 0; posn < llGetListLength(known_script_dependencies); posn++) { - msg += SCRIPT_DEPENDENCY_MARK - + llList2String(known_script_dependencies, posn) + UPDATER_PARM_SEPARATOR; - if (llStringLength(msg) > MESSAGE_SIZE_LIMIT - 50) { - llSay(new_update_channel, msg + CONTINUANCE_MARKER); -//log_it(msg + CONTINUANCE_MARKER); - llSleep(SCRIPT_LIST_PAUSE_INTERVAL); - msg = REPORT_AVAILABLE_SCRIPTS; - } - } - // tell this new client what scripts we have. - for (posn = 0; posn < llGetListLength(scripts_available); posn++) { - curr = llList2String(scripts_available, posn); - if (llDeleteSubString(curr, llStringLength(UPDATE_CLIENT_SCRIPT), -1) - != UPDATE_CLIENT_SCRIPT) { - // add in the next item, along with the parameter separator. - msg += curr + UPDATER_PARM_SEPARATOR; -//log_it("adding " + curr); - if (llStringLength(msg) > MESSAGE_SIZE_LIMIT - 50) { - llSay(new_update_channel, msg + CONTINUANCE_MARKER); -//log_it(msg + CONTINUANCE_MARKER); - if (channel == OLD_REQUEST_INVENTORY_CHANNEL) { - // stop sending the list to them since they may not know how - // to interpret a multiple part update list. - return; - } - llSleep(SCRIPT_LIST_PAUSE_INTERVAL); - msg = REPORT_AVAILABLE_SCRIPTS; - } - } - } - // mention any objects that are available. - for (posn = 0; posn < llGetListLength(objects_available); posn++) { - // add in the next item, along with the parameter separator. - msg += llList2String(objects_available, posn) - + UPDATER_PARM_SEPARATOR; - if (llStringLength(msg) > MESSAGE_SIZE_LIMIT - 50) { - llSay(new_update_channel, msg + CONTINUANCE_MARKER); -//log_it(msg + CONTINUANCE_MARKER); - llSleep(SCRIPT_LIST_PAUSE_INTERVAL); - msg = REPORT_AVAILABLE_SCRIPTS; - } - } - // say final bit, even if it's mostly blank. we need to let them know - // that we're done and not adding that continuation flag string. - llSay(new_update_channel, msg); -} - -// handles verbal commands from objects that want updates. -process_verbal_requests(integer channel, string name, key id, string message) -{ - if ( (channel == OLD_REQUEST_INVENTORY_CHANNEL) || (channel == inventory_request_channel) ) { - spew_inventory_list(channel, message, id); - return; - } else if (channel == USER_COMMAND_CHANNEL) { -if (DEBUGGING) log_it("heard orders: " + message); - // simple verbal commands. - if (message == RESTART_UPDATER_COMMAND) { - log_it("Restarting now."); - llResetScript(); - } else if (message == SHOW_SCRIPTS_COMMAND) { - show_scripts(); - } else if (message == SHUTDOWN_COMMAND) { - // we will de-rez now (i.e., die) if we are not one of the special names that is undying. - if (!matches_substring(llGetObjectName(), "keeper")) { -// log_it("server " + (string)inventory_request_channel + " now disintegrating."); - squonk(1); - llDie(); - } - } - return; - } - - integer indy; - // see if the channel is for one of our valid updates that's in progress. - for (indy = 0; indy < llGetListLength(active_update_channels); indy++) { - integer cur_chan = llList2Integer(active_update_channels, indy); - if (cur_chan == channel) { - // yes, this is really for that guy. - propel_upgrade_process(channel, id, message); - return; - } - } -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - // tell this to the owner. -// llOwnerSay(llGetDate() + ": " + llGetScriptName() + "[" + (string)debug_num + "] " + to_say); -llWhisper(0, llGetDate() + ": " + llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on an unusual channel for chat if it's not intended for general public. -// llSay(108, llGetDate() + ": " + llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on open chat that anyone can hear. we take off the bling for this one. -// llSay(0, to_say); -} - -// returns TRUE if the "pattern" is found in the "full_string". -integer matches_substring(string full_string, string pattern) -{ return (find_substring(full_string, pattern) >= 0); } - -// returns the index of the first occurrence of "pattern" inside -// the "full_string". if it is not found, then a negative number is returned. -integer find_substring(string full_string, string pattern) -{ return llSubStringIndex(llToLower(full_string), llToLower(pattern)); } - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return find_substring(compare_with, prefix) == 0; } - -// joins a list of parameters using the parameter sentinel for the library. -string wrap_parameters(list to_flatten) -{ return llDumpList2String(to_flatten, UPDATER_PARM_SEPARATOR); } - -// locates the string "text" in the list to "search_in". -integer find_in_list(list search_in, string text) -{ - integer len = llGetListLength(search_in); - integer i; - for (i = 0; i < len; i++) { - if (llList2String(search_in, i) == text) - return i; - } - return -1; -} - -// returns the portion of the list between start and end, but only if they are -// valid compared with the list length. an attempt to use negative start or -// end values also returns a blank list. -list chop_list(list to_chop, integer start, integer end) -{ - integer last_len = llGetListLength(to_chop) - 1; - if ( (start < 0) || (end < 0) || (start > last_len) || (end > last_len) ) return []; - return llList2List(to_chop, start, end); -} - -// a random channel for the first interaction with the client. -integer random_channel() { return -(integer)(llFrand(800000) + 20000); } - -// note that this new, lower memory version, depends on the inventory functions returning -// items in alphabetical order. -scrub_items_by_type(string this_guy, integer inventory_type) -{ - list removal_list; - integer outer; - for (outer = 0; outer < llGetInventoryNumber(inventory_type); outer++) { - string curr = llGetInventoryName(inventory_type, outer); - list split = compute_basename_and_version(curr); - // make sure there was a comparable version number in this name. - if ( (curr != this_guy) && llGetListLength(split)) { - string curr_base = llList2String(split, 0); - float curr_ver = (float)llList2String(split, 1); -//log_it("outer: " + curr_base + " / " + (string)curr_ver); - integer inner; - for (inner = outer + 1; inner < llGetInventoryNumber(inventory_type); inner++) { - string next_guy = llGetInventoryName(inventory_type, inner); - list comp_split = compute_basename_and_version(next_guy); - if (llGetListLength(comp_split)) { - string comp_base = llList2String(comp_split, 0); - float comp_ver = (float)llList2String(comp_split, 1); - // okay, now we can actually compare. - if (curr_base != comp_base) { - // break out of inner loop. we are past where the names can matter. - inner = 2 * llGetInventoryNumber(inventory_type); - } else { -//log_it("inner: " + comp_base + " / " + (string)comp_ver); - if (curr_ver <= comp_ver) { - // the script at inner index is comparable or better than - // the script at the outer index. - removal_list += curr; - } else { - // this inner script must be inferior to the outer one, - // somehow, which defies our expectation of alphabetical ordering. - removal_list += next_guy; - } - } - } - } - } - } - - // now actually do the deletions. - for (outer = 0; outer < llGetListLength(removal_list); outer++) { - string to_whack = llList2String(removal_list, outer); - log_it("removing older asset: " + to_whack); - llRemoveInventory(to_whack); - } - - if (IS_OPENSIM && (llGetListLength(removal_list) > 0) ) { -// log_it("now restarting to avoid opensim late updating change event."); - llResetScript(); - } -} - -// ensures that only the latest version of any script or object is kept in our inventory. -destroy_older_versions() -{ - // firstly, iterate across scripts to clean out older versions. - scrub_items_by_type(llGetScriptName(), INVENTORY_SCRIPT); - // secondly, try to clean out the objects. - scrub_items_by_type(llGetScriptName(), INVENTORY_OBJECT); - // thirdly, try to clean out the notecards. - scrub_items_by_type(llGetScriptName(), INVENTORY_NOTECARD); -} - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.4. -// distributed under BSD-like license. -// partly based on the self-upgrading scripts from markov brodsky and jippen faddoul. -// the function auto_retire() should be added *inside* a version numbered script that -// you wish to give the capability of self-upgrading. -// this script supports a notation for versions embedded in script names where a 'v' -// is followed by a number in the form "major.minor", e.g. "grunkle script by ted v8.2". -// when the containing script is dropped into an object with a different version, the -// most recent version eats any existing ones. -// keep in mind that this code must be *copied* into your script you wish to add -// auto-retirement capability to. -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -// end hufflets. -////////////// - -default -{ - state_entry() - { - auto_retire(); - initialize_root(); // get set up to start answering requests. - llWhisper(0, llGetScriptName() + " started... touch for more info."); - squonk(0); - } - - state_exit() { llSetTimerEvent(0); } - - on_rez(integer parm) { - state rerun; - } - - timer() { handle_timer(); } - - touch_start(integer count) { - show_status(llDetectedKey(0)); - } - - listen(integer channel, string name, key id, string message) { - // make sure that the object is something we should even talk to. - if (llGetOwnerKey(id) != llGetOwner()) { - return; - } - // looks okay, let's see if this is useful communication. - process_verbal_requests(channel, name, id, message); - } - - changed(integer change) { - if (change & CHANGED_INVENTORY) { - log_it("inventory changed, scheduled a restart."); - // sleep a little bit; otherwise we get SL noise about scripts not being - // there when it told us they were there. this can lead to some scripts - // doing bizarre things if they are running when added. - dealing_with_change = TRUE; - llSetTimerEvent(0.0); // kludge to get around second life bug. - llSetTimerEvent(CHANGED_INVENTORY_SNOOZER); - } - } -} - -state rerun { state_entry() { state default; } } - diff --git a/huffware/huffotronic_tools_n_testers/comfortable_sitting_v7.5.txt b/huffware/huffotronic_tools_n_testers/comfortable_sitting_v7.5.txt deleted file mode 100755 index 202c58f7..00000000 --- a/huffware/huffotronic_tools_n_testers/comfortable_sitting_v7.5.txt +++ /dev/null @@ -1,882 +0,0 @@ - -// huffware script: comfortable sitting, by fred huffhines. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -////////////// - -// global constants... - -string NOTEWORTHY_SIGNATURE = "#sitting"; - // the notecard must begin with this as its first line for it to be - // recognized as our configuration card. - -////////////// - -// global variables that are loaded from a notecard. - -vector AVATAR_ROTATION = <0, 0, -90>; // star chair. -//vector AVATAR_ROTATION = <0, 0, 0>; - // the euler vector for rotation of the avatar after sitting, in degrees. - // the rotation vector should be tailored to the object. - -vector AVATAR_POSITION = <-0.1, -0.28, -0.1>; // star chair. -//vector AVATAR_POSITION = <0.34, 0, 0>; - // the position of the sitting offset from the object center. also needs to be - // tailored to the particular object. - -integer GOTO_WHICH_FLOOR = 1; - // when serving as an elevator, this is a way to cause the teleport offset - // to go to a particular floor. the real z position is calculated from - // this times the floor size in meters. note that floors are numbered - // starting at 1 (one). - -float FLOOR_SIZE_IN_METERS = 0.0; - // when the script is used in an elevator, this specifies the height of the - // floors. our current scheme will only work if that is constant between - // the floors. - -float BASE_FLOOR_HEIGHT = 0.0; - // the position of the first floor in meters. this will not affect the - // position calculations unless floor size is non-zero. - -integer UNSEAT_AFTERWARDS = FALSE; - // if this is true, then the avatar is unseated just after sitting down. - -float PAUSE_BEFORE_EVICTION = 0.28; - // the number of seconds that the avatars get to sit before we pop them - // out of the chair/teleporter/whatever. - -vector CAMERA_EYE_OFFSET = <3, 2, 1.5>; // star chair. - // the offset for the camera after the avatar sits down. -//relative to the avatar? - -vector CAMERA_TARGET = <-3, 0, 1>; // star chair. - // the location where the camera is looking at once the avatar sits down. -//relative to the avatar? - -////////////// - -// global variables used in processing notecards... - -integer pending_response_id; // set to uniquely identify the notecard read in progress. -list global_config_list; // a collection of configuration parameters from our notecard. -integer global_config_index; // allows wrap-around feature, which we don't use here. - -////////////// - -// interfaces for library scripts we rely on... - -// requires noteworthy library. -// in this odd case, where we are trying to shrink script count, the noteworthy library -// is embedded inside here. -////////////// -// do not redefine these constants. -integer NOTEWORTHY_HUFFWARE_ID = 10010; - // the unique id within the huffware system for the noteworthy script to - // accept commands on. this is used in llMessageLinked as the num parameter. -string HUFFWARE_PARM_SEPARATOR = "{~~~}"; - // this pattern is an uncommon thing to see in text, so we use it to separate - // our commands in link messages. -string HUFFWARE_ITEM_SEPARATOR = "{|||}"; - // used to separate lists of items from each other when stored inside a parameter. - // this allows lists to be passed as single string parameters if needed. -integer REPLY_DISTANCE = 100008; // offset added to service's huffware id in reply IDs. -string BAD_NOTECARD_INDICATOR = "bad_notecard"; - // indicates that the notecard reading process has failed to find an appropriate one. -string NOTECARD_READ_CONTINUATION = "continue!"; - // returned as first parameter if there is still more data to handle. -// commands available via the noteworthy library: -string READ_NOTECARD_COMMAND = "#read_note#"; - // command used to tell the script to read notecards. needs a signature to find - // in the card as the first parameter, and a randomly generated response code for - // the second parameter. the response code is used to uniquely identify a set of - // pending notecard readings (hopefully). the signature can be blank. - // the results will be fired back as the string value returned, which will have - // as first element the notecard's name (or BAD_NOTECARD_INDICATOR if none was - // found) and as subsequent elements an embedded list that was read from the - // notecard. this necessarily limits the size of the notecards that we can read - // and return. -string READ_SPECIFIC_NOTECARD_COMMAND = "#read_thisun#"; - // like the read notecard command, but specifies the notecard name to use. only that - // specific notecard file will be consulted. first and second parm are still signature - // and response code, third parm is the notecard name. -// -////////////// -// joins a list of parameters using the parameter sentinel for the library. -string wrap_parameters(list to_flatten) -{ return llDumpList2String(to_flatten, HUFFWARE_PARM_SEPARATOR); } -////////////// - -// establishes the sitting parameters including camera offsets. -setup_seating_arrangements() -{ - llUnSit(llAvatarOnSitTarget()); // no one gets to ignore a script change. - vector new_rot = AVATAR_ROTATION; - new_rot *= DEG_TO_RAD; // convert to radians. - rotation quat = llEuler2Rot(new_rot); // convert to quaternion. - // get our position set up and take into account the elevator position. - vector position = AVATAR_POSITION; -//rename that variable to be "which floor to go to" - if (FLOOR_SIZE_IN_METERS != 0) { - vector temp = llGetPos(); - integer my_floor = (integer) ((temp.z - BASE_FLOOR_HEIGHT ) / FLOOR_SIZE_IN_METERS) + 1; -//log_it("my floor is " + (string)my_floor); - float add_in = (float)(GOTO_WHICH_FLOOR - my_floor) * FLOOR_SIZE_IN_METERS; -//log_it("decided to add in z: " + (string)add_in); - position += <0, 0, add_in>; - } - // also we make this absolute by taking out the object's own rotation. - // it's hard enough in life for z components to not mean z axis. - position /= llGetRot(); - llSitTarget(position, quat / llGetRot()); -//hmmm: do we need same rot treatment on camera things? -//hmmm: trying it. - // now set the camera position to avoid having random viewpoint. - llSetCameraEyeOffset(CAMERA_EYE_OFFSET / llGetRot()); - llSetCameraAtOffset(CAMERA_TARGET / llGetRot()); -} - -// this function fires off a request to the noteworthy library via a link message. -// noteworthy will look for a notecard with our particular signature in it and -// if it finds one, it will read the configuration therein. an empty string is -// returned if noteworthy couldn't find anything. -request_configuration() -{ - // try to find a notecard with our configuration. - pending_response_id = -1 * (integer)randomize_within_range(23, 80000, FALSE); - string parms_sent = wrap_parameters([NOTEWORTHY_SIGNATURE, pending_response_id]); -//call direct into noteworthy. -noteworthy_handle_link_message(LINK_THIS, NOTEWORTHY_HUFFWARE_ID, READ_NOTECARD_COMMAND, parms_sent); - -// llMessageLinked(LINK_THIS, NOTEWORTHY_HUFFWARE_ID, READ_NOTECARD_COMMAND, -// parms_sent); -} - -// processes link messages received from the noteworthy library. -handle_link_message(integer which, integer num, string msg, key id) -{ - if ( (num != NOTEWORTHY_HUFFWARE_ID + REPLY_DISTANCE) - || (msg != READ_NOTECARD_COMMAND) ) - return; // not for us. -//log_it("handl: msg=" + msg + " id=" + id); - // process the result of reading the notecard. - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); - string notecard_name = llList2String(parms, 0); -//log_it("raw is " + llList2String(parms, 1)); - integer response_for = llList2Integer(parms, 1); -//log_it("resp cod=" + pending_response_id + " but this for=" + response_for); -//if (response_for != pending_response_id) log_it("bad response code???"); - if (response_for != pending_response_id) return; // oops, this isn't for us. - if (notecard_name == BAD_NOTECARD_INDICATOR) { - // we hated the notecards we found, or there were none. - log_it("We apologize; there seem to be no notecards with a first line of '" - + NOTEWORTHY_SIGNATURE - + "'. We can't read any configuration until that situation improves."); - } else { -//log_it("got to handle link"); - // snag all but the first two elements for our config now. - global_config_list += llList2List(parms, 2, -1); - // make sure we shouldn't keep going. - if (notecard_name != NOTECARD_READ_CONTINUATION) { - // a valid notecard has been found. - global_config_index = 0; // we are starting over in the config list. -// log_it("read notecard \"" + notecard_name + "\":"); - // and process the file as a set of definitions. - process_ini_config(); - // now that we have a new set of parameters, use them. - setup_seating_arrangements(); - } - } -} - -/////////////// - -// consumes the notecard in a very application specific way to retrieve our configuration items. -// the example script only looks for two variables: name and description. if those are found in -// the sample card, then they are proudly shown. -parse_variable_definition(string to_parse) -{ - string content; // filled after finding a variable name. - if ( (content = get_variable_value(to_parse, "avatar_rotation")) != "") { - AVATAR_ROTATION = (vector)content; -// log_it("** got avatar_rotation of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "avatar_position")) != "") { - AVATAR_POSITION = (vector)content; -// log_it("** got avatar_position of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "goto_which_floor")) != "") { - GOTO_WHICH_FLOOR = (integer)content; -// log_it("** got GOTO_WHICH_FLOOR of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "floor_size_in_meters")) != "") { - FLOOR_SIZE_IN_METERS = (float)content; -// log_it("** got FLOOR_SIZE_IN_METERS of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "base_floor_height")) != "") { - BASE_FLOOR_HEIGHT = (float)content; -// log_it("** got BASE_FLOOR_HEIGHT of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "unseat_afterwards")) != "") { - UNSEAT_AFTERWARDS = (integer)content; -// log_it("** got unseat_afterwards of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "pause_before_eviction")) != "") { - PAUSE_BEFORE_EVICTION = (float)content; -// log_it("** got pause_before_eviction of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "camera_eye_offset")) != "") { - CAMERA_EYE_OFFSET = (vector)content; -// log_it("** got camera_eye_offset of '" + content + "'"); - } else if ( (content = get_variable_value(to_parse, "camera_target")) != "") { - CAMERA_TARGET = (vector)content; -// log_it("** got camera_target of '" + content + "'"); -// } else { -// log_it("unknown variable seen: " + to_parse); - } -} - -initialize() -{ - // reset our relevant variables. - global_config_list = []; - global_config_index = 0; - - // announce that we're open for business. -/// log_it("started, free mem=" + (string)llGetFreeMemory()); - - // request that the noteworthy library start looking for our notecard. - request_configuration(); - - integer indy = 32; - while (indy >= 0) { - indy = find_in_inventory_partial("noteworthy", INVENTORY_SCRIPT); - if (indy >= 0) { - llRemoveInventory(llGetInventoryName(INVENTORY_SCRIPT, indy)); - } - } - -} - -////////////// -// from hufflets... -// - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - // tell this to the owner. - llOwnerSay(llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on an unusual channel for chat if it's not intended for general public. -// llSay(108, llGetScriptName() + "[" + (string)debug_num + "] " + to_say); - // say this on open chat that anyone can hear. we take off the bling for this one. -// llSay(0, to_say); -} - -// locates the string "text" in the list to "search_in". -integer find_in_list(list search_in, string text) -{ - integer len = llGetListLength(search_in); - integer i; - for (i = 0; i < len; i++) { - if (llList2String(search_in, i) == text) - return i; - } - return -1; -} - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return (llSubStringIndex(compare_with, prefix) == 0); } - -// returns a number at most "maximum" and at least "minimum". -// if "allow_negative" is TRUE, then the return may be positive or negative. -float randomize_within_range(float minimum, float maximum, integer allow_negative) -{ - if (minimum > maximum) { - // flip the two if they are reversed. - float temp = minimum; minimum = maximum; maximum = temp; - } - float to_return = minimum + llFrand(maximum - minimum); - if (allow_negative) { - if (llFrand(1.0) < 0.5) to_return *= -1.0; - } - return to_return; -} - -// strips the spaces off of the beginning and end of a string. -string strip_spaces(string to_strip) -{ - // clean out initial spaces. - while (llGetSubString(to_strip, 0, 0) == " ") - to_strip = llDeleteSubString(to_strip, 0, 0); - // clean out ending spaces. - while (llGetSubString(to_strip, -1, -1) == " ") - to_strip = llDeleteSubString(to_strip, -1, -1); - return to_strip; -} - -// parses a variable definition to find the name of the variable and its value. -// this returns two strings [X, Y], if "to_split" is in the form X=Y. -list separate_variable_definition(string to_split) -{ - integer equals_indy = llSubStringIndex(to_split, "="); - // we don't support missing an equals sign, and we don't support it as the first character. - if (equals_indy <= 0) return []; // no match. - string x = llGetSubString(to_split, 0, equals_indy - 1); - string y = llGetSubString(to_split, equals_indy + 1, -1); - to_split = ""; // save space. - return [ strip_spaces(x), strip_spaces(y) ]; -} - -// returns a non-empty string if "to_check" defines a value for "variable_name". -// this must be in the form "X=Y", where X is the variable_name and Y is the value. -string get_variable_value(string to_check, string variable_name) -{ - list x_y = separate_variable_definition(to_check); - if (llGetListLength(x_y) != 2) return ""; // failure to parse a variable def at all. - if (!is_prefix(llList2String(x_y, 0), variable_name)) return ""; // no match. - return llList2String(x_y, 1); // a match! -} - -// examines all entries that we got from the notecard to see if any contain definitions. -// this is basically an INI file reader, but it uses a list instead of a file. -// ini files provide a format with multiple sections of config information, like so: -// [section_1] -// name1=value1 -// name2=value2 ...etc... -// [section_2] -// name1=value1 ...etc... -process_ini_config() -{ -// log_it("scanning notecard for variable definitions..."); - integer indy; - integer count = llGetListLength(global_config_list); - string section_name; // set later if we see one. - - // iterate across the items in our configuration to look for ones that are not done yet. - for (indy = global_config_index; indy < count; indy++) { - string line = llList2String(global_config_list, indy); - // search for a section beginning. - if (llGetSubString(line, 0, 0) == "[") { - // we found the start of a section name. now read the contents. - indy++; // skip section line. - section_name = llGetSubString(line, 1, -2); - log_it("reading section: " + section_name); - } - integer sec_indy; - for (sec_indy = indy; sec_indy < count; sec_indy++) { - // read the lines in the section. - line = llList2String(global_config_list, sec_indy); - if (llGetSubString(line, 0, 0) != "[") { - // try to interpret this line as a variable setting. this is just - // one example of a way to handle the config file; one might instead - // want to do something below once a whole section is read. - parse_variable_definition(line); - indy = sec_indy; // track that we've passed this line. - } else { - // we're at the beginning of a new section now, so start processing its - // configuration in the outer loop. - indy = sec_indy - 1; // set indy to proper beginning of section. - global_config_index = indy; // remember where we had read to. - sec_indy = count + 3; // skip remainder of inner loop. - } - } - } - - global_config_index = 0; // reset outer position if want to re-read. -} - -// locates the item with "name_to_find" in the inventory items with the "type". -// a value from 0 to N-1 is returned if it's found, where N is the number of -// items in the inventory. -integer find_in_inventory_partial(string name_to_find, integer inv_type) -{ - integer num_inv = llGetInventoryNumber(inv_type); - if (num_inv == 0) return -1; // nothing there! - integer inv; - for (inv = 0; inv < num_inv; inv++) { - if (is_prefix(llGetInventoryName(inv_type, inv), name_to_find)) - return inv; - } - return -2; // failed to find it. -} - -////////////// -// huffware script: auto-retire, by fred huffhines, version 1.9. -// distributed under BSD-like license. -// partly based on the self-upgrading scripts from markov brodsky and jippen faddoul. -// the function auto_retire() should be added *inside* a version numbered script that -// you wish to give the capability of self-upgrading. -// this script supports a notation for versions embedded in script names where a 'v' -// is followed by a number in the form "major.minor", e.g. "grunkle script by ted v8.2". -// when the containing script is dropped into an object with a different version, the -// most recent version eats any existing ones. -// keep in mind that this code must be *copied* into your script you wish to add -// auto-retirement capability to. -// -// example usage of the auto-retirement script: -// -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - if ((float)inv_version_string < (float)version_string) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - if (llSubStringIndex(to_chop_up, " ") < 0) return []; // no space found, not a valid name to work on. - - string basename = to_chop_up; // script name with no version attached. - - integer posn; - // minimum script name is 2 characters plus version. - for (posn = llStringLength(to_chop_up) - 1; - (posn >= 2) && (llGetSubString(to_chop_up, posn, posn) != " "); - posn--) { - // find the space. do nothing else. - } - if (posn < 2) return []; // no space found. - string full_suffix = llGetSubString(to_chop_up, posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -// end hufflets -////////////// - -////////////// -// from noteworthy: - -// huffware script: noteworthy library, by fred huffhines. -// -// a handy approach to reading a notecard. this version supports requiring -// a 'signature' in the notecard's first line, so that multiple notecards can -// exist in an object without being misinterpreted. the script is accessed via -// its link message API, so it can be used in an object without all this code -// needing to be embedded in another script. it also supports queuing up requests -// to read notecards, so multiple scripts can use it to read their specific -// notecards without any special handling (besides waiting a bit longer). -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// constants that can be adapted to your needs... - -integer DEBUGGING = FALSE; - // if this is true, then a lot of extra noise is generated when notecards are read. - -float TIME_OUT_ON_ONE_NOTECARD = 120.0; - // we allow one line of a notecard this long to be read before we decide it's hosed. - // some sims are very very slow, and a time-out of one minute has been found lacking; - // we saw at least one case where the first notecard line to be read took longer than - // 60 seconds. that's why we keep cranking this time-out up... - -// constants that should not be changed... - -// outcomes from handling a line in a notecard. -integer STILL_READING = -8; // the notecard seems good, but isn't finished. -integer BAD_NOTECARD = -9; // this notecard doesn't have our signature. -integer DONE_READING = -10; // the notecard is finished being read. - -integer LIST_ELEMENT_GUESS = 200; // guess at how many bytes average list element uses. - -integer MAXIMUM_LINES_USED = 4; - // we will read this many lines at a time from the appropriate notecard. -// global variables... - -string requested_signature = ""; - // if this is non-empty, then it must be found in the first line of the script. - -integer only_read_one_notecard = FALSE; // true if just one specific notecard should be used. - -string global_notecard_name; // the name of the card we're reading now. -key global_query_id = NULL_KEY; // the identifier of our data query. -integer current_response_code = 0; // the code that our client uses for its reading. -list global_query_contents; // the lines we have read from the notecard. - -integer line_number = 0; // which line are we at in notecard? - -integer found_signature_line = FALSE; // did we find our first line in a notecard yet? - -integer trying_notecard_at = -1; // where we are currently looking for a good notecard. - -list pending_signatures; // signatures from queued requests for reading. -list pending_response_codes; // response codes for the queued requests. -list pending_notecard_names; // card names if it's a specific request. - -////////////// - -startup_initialize() -{ - llSetTimerEvent(0.0); - pending_signatures = []; - pending_response_codes = []; - pending_notecard_names = []; - current_response_code = 0; -} - -reset_for_reading(string signature, integer response_code_in) -{ - requested_signature = signature; - current_response_code = response_code_in; - llSetTimerEvent(TIME_OUT_ON_ONE_NOTECARD); // don't allow a read to happen forever. - global_query_contents = []; - global_notecard_name = ""; - line_number = 0; - found_signature_line = FALSE; - trying_notecard_at = -1; - global_query_id = NULL_KEY; -} - -// use the existing global notecard setting to start reading. -select_specific_notecard() -{ - global_query_id = NULL_KEY; // reset the query id so we don't get bogus answers. - line_number = 0; // reset line number again. - global_query_id = llGetNotecardLine(global_notecard_name, 0); -} - -// picks the notecard at the "index" (from 0 to num_notecards - 1) and -// starts reading it. -select_notecard(integer index) -{ - global_query_id = NULL_KEY; // reset the query id so we don't get bogus answers. - string card_specified = llGetInventoryName(INVENTORY_NOTECARD, index); - if (card_specified == "") return; // not good. bad index. - global_notecard_name = card_specified; - line_number = 0; // reset line number again. - // we have a new file name, so load up the destinations, hopefully. - global_query_id = llGetNotecardLine(global_notecard_name, 0); -} - -// increments our index in the count of notecards that the object has, and start -// reading the next notecard (at the index). -integer try_next_notecard() -{ - if (only_read_one_notecard) { - return FALSE; // we were only going to try one. - } - // reset some values that might have applied before. - global_notecard_name = ""; - // skip to the next card. - trying_notecard_at++; - // make sure we're not over the count of cards. - if (trying_notecard_at >= llGetInventoryNumber(INVENTORY_NOTECARD)) { - // this is a problem. we didn't find anything suitable. - return FALSE; - } - // so, now we'll try the next notecard to look for our signature. - select_notecard(trying_notecard_at); - return TRUE; -} - -// process a line of text that we received from the current notecard. -integer handle_notecard_line(key query_id, string data) -{ - // if we're not at the end of the notecard we're reading... - if (data != EOF) { - // there's more to read in the notecard still. - if (data != "") { - // make sure we even have a signature to look for. - if (!found_signature_line && (requested_signature == "")) { - // no signature means that we always find it. - found_signature_line = TRUE; - } - // did we already get our signature? if not, see if this is it. - if (!found_signature_line && (data != requested_signature) ) { - // this is a bad notecard. skip it. - if (!try_next_notecard()) { - // we have no more to work with. - return BAD_NOTECARD; - } - return STILL_READING; // we'll keep going. - } else if (!found_signature_line && (data == requested_signature) ) { - // this is a good signature line, so record that and then skip it. - found_signature_line = TRUE; - } else { - if (DEBUGGING - && ( ( (requested_signature == "") && (line_number == 0) ) - || ( (requested_signature != "") && (line_number == 1) ) ) ) { - log_it("started reading " + global_notecard_name + "..."); - } - // don't record any lines that are comments. - if ( (llGetSubString(data, 0, 0) != "#") - && (llGetSubString(data, 0, 0) != ";") ) { - // add the non-blank line to our list. - global_query_contents += data; - // make sure we still have enough space to keep going. - if (llGetListLength(global_query_contents) >= MAXIMUM_LINES_USED) { - // ooh, make sure we pause before blowing our heap&stack. - send_reply(LINK_THIS, [ NOTECARD_READ_CONTINUATION, - current_response_code ], READ_NOTECARD_COMMAND, TRUE); - } - } - } - } - line_number++; // increase the line count. - // reset the timer rather than timing out, if we actually got some data. - llSetTimerEvent(TIME_OUT_ON_ONE_NOTECARD); - // request the next line from the notecard. - global_query_id = llGetNotecardLine(global_notecard_name, line_number); - if (global_query_id == NULL_KEY) { -//log_it("failed to restart notecard reading."); - return DONE_READING; -//is that the best outcome? - } - return STILL_READING; - } else { - // that's the end of the notecard. we need some minimal verification that it - // wasn't full of garbage. - if (!found_signature_line) { - if (DEBUGGING) log_it("never found signature in " + global_notecard_name); - if (!try_next_notecard()) { - return BAD_NOTECARD; // we failed to find a good line? - } else { - // the next notecard's coming through now. - return STILL_READING; - } - } else { -// if (DEBUGGING) log_it("found signature."); - // saw the signature line, so this is a good one. - return DONE_READING; - } - } -} - -// only sends reply; does not reset notecard process. -send_reply(integer destination, list parms, string command, - integer include_query) -{ -//log_it("froyo: curre code=" + current_response_code); -//integer items = llGetListLength(parms); -//if (include_query) items += llGetListLength(global_query_contents); -//log_it("pre-sending " + (string)items + " items, mem=" + (string)llGetFreeMemory()); - - if (!include_query) { - handle_link_message(destination, NOTEWORTHY_HUFFWARE_ID + REPLY_DISTANCE, - command, llDumpList2String(parms, HUFFWARE_PARM_SEPARATOR)); - } else { - handle_link_message(destination, NOTEWORTHY_HUFFWARE_ID + REPLY_DISTANCE, - command, - llDumpList2String(parms + global_query_contents, HUFFWARE_PARM_SEPARATOR)); - } - global_query_contents = []; -//log_it("post-sending, mem=" + (string)llGetFreeMemory()); -} - -// a simple version of a reply for a command that has been executed. the parameters -// might contain an outcome or result of the operation that was requested. -send_reply_and_reset(integer destination, list parms, string command, - integer include_query) -{ - llSetTimerEvent(0.0); // stop the timer, since we're about to reply. - send_reply(destination, parms, command, include_query); -//log_it("about to reset response code"); - current_response_code = 0; // reset back to default so we can start another read. - global_query_id = NULL_KEY; // reset so we accept no more data. -} - -// if there are other pending notecard reads, this goes to the next one listed. -dequeue_next_request() -{ - if (llGetListLength(pending_signatures)) { - // get the info from the next pending item. - string sig = llList2String(pending_signatures, 0); - integer response_code_temp = llList2Integer(pending_response_codes, 0); - string notecard = llList2String(pending_notecard_names, 0); - // whack the head of the queue since we grabbed the info. - pending_signatures = llDeleteSubList(pending_signatures, 0, 0); - pending_response_codes = llDeleteSubList(pending_response_codes, 0, 0); - pending_notecard_names = llDeleteSubList(pending_notecard_names, 0, 0); - if (llStringLength(notecard)) { - global_notecard_name = notecard; - select_specific_notecard(); - } else { - reset_for_reading(sig, response_code_temp); - } - } -} - -// deals with one data server answer from the notecard. -process_notecard_line(key query_id, string data) -{ - // try to consume a line from the notecard. - integer outcome = handle_notecard_line(query_id, data); - if (outcome == DONE_READING) { - // that was a valid notecard and we read all of it. - if (DEBUGGING) log_it("finished reading " + global_notecard_name + "."); - // send back the results. - send_reply_and_reset(LINK_THIS, [ global_notecard_name, current_response_code ], - READ_NOTECARD_COMMAND, TRUE); - } else if (outcome == BAD_NOTECARD) { - // bail; this problem must be addressed by other means. - if (DEBUGGING) log_it("failed to find an appropriate notecard"); - send_reply_and_reset(LINK_THIS, [ BAD_NOTECARD_INDICATOR, current_response_code ], - READ_NOTECARD_COMMAND, FALSE); - } else if (outcome == STILL_READING) { - // we have a good card and are still processing it. - return; - } else { - if (DEBUGGING) log_it("unknown outcome from handle_notecard_line"); - // again, bail out. we have no idea what happened with this. - send_reply_and_reset(LINK_THIS, [ BAD_NOTECARD_INDICATOR, current_response_code ], - READ_NOTECARD_COMMAND, FALSE); - } - // if we have reached here, we should crank up the next queued notecard reading. - dequeue_next_request(); -} - -// processes requests from our users. -noteworthy_handle_link_message(integer which, integer num, string msg, key id) -{ - if (num != NOTEWORTHY_HUFFWARE_ID) return; // not for us. - - if (msg == READ_NOTECARD_COMMAND) { - only_read_one_notecard = FALSE; // general inquiry for any card. - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); -//log_it("read notecard--parms are: " + (string)parms); - string signature = llList2String(parms, 0); - integer response_code_temp = llList2Integer(parms, 1); -//log_it("got signature " + signature + " and respcode " + (string)response_code_temp); -//holding: if (!current_response_code) { - // go ahead and process this request; we aren't busy. - reset_for_reading(signature, response_code_temp); - if (!try_next_notecard()) { - if (DEBUGGING) log_it("failed to find any appropriate notecards at all."); - send_reply_and_reset(LINK_THIS, [ BAD_NOTECARD_INDICATOR, response_code_temp ], - READ_NOTECARD_COMMAND, FALSE); - return; - } -//holding: } else { -//holding: // we're already busy. -//holding:// send_reply_and_reset(LINK_THIS, [ BUSY_READING_INDICATOR, response_code_temp ], -//holding:// READ_NOTECARD_COMMAND, FALSE); -//holding: // stack this request; another is in progress. -//holding: pending_signatures += signature; -//holding: pending_response_codes += response_code_temp; -//holding: pending_notecard_names += ""; -//holding: } - } else if (msg == READ_SPECIFIC_NOTECARD_COMMAND) { - only_read_one_notecard = TRUE; // they want one particular card. - list parms = llParseString2List(id, [HUFFWARE_PARM_SEPARATOR], []); -//log_it("read specific--parms are: " + (string)parms); - string signature = llList2String(parms, 0); - integer response_code_temp = llList2Integer(parms, 1); - string notecard_name = llList2String(parms, 2); -//log_it("got signature " + signature + " and respcode " + (string)response_code_temp); -//holding: if (!current_response_code) { - // go ahead and process this request; we aren't busy. - reset_for_reading(signature, response_code_temp); - global_notecard_name = notecard_name; // set our global. - select_specific_notecard(); -//holding: } else { -//holding: // we're already busy. -//holding:// send_reply_and_reset(LINK_THIS, [ BUSY_READING_INDICATOR, response_code_temp ], -//holding:// READ_NOTECARD_COMMAND, FALSE); -//holding: // stack this request; another is in progress. -//holding: pending_signatures += signature; -//holding: pending_response_codes += response_code_temp; -//holding: pending_notecard_names += notecard_name; -//holding: } - } -} - - -default -{ - state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } - on_rez(integer parm) { state rerun; } -} -state rerun { state_entry() { state default; } } - -state real_default -{ - state_entry() { - auto_retire(); // make sure newest addition is only version of script. -/////not needed now llSleep(1.0); // snooze just a bit to let noteworthy start up? - startup_initialize(); - initialize(); // start asking about the notecards. - setup_seating_arrangements(); // use our current defaults for sitting posn. - } - - on_rez(integer parm) { llResetScript(); } - - changed(integer change) { - if (change & CHANGED_INVENTORY) { -// llSleep(3.14159265358); // delay to avoid interfering with upgrade. - llResetScript(); - } - if (!(change & CHANGED_LINK)) return; // don't care. - if (!UNSEAT_AFTERWARDS) return; // nothing else below is needed. - if (llAvatarOnSitTarget() == NULL_KEY) return; // no one there, so ditto. - // now give them a bit of time to rest before dumping them. - llSetTimerEvent(PAUSE_BEFORE_EVICTION); - } - - timer() { - if (current_response_code != 0) { - llSetTimerEvent(0.0); // stop any timer now. - // let the caller know this has failed out. - if (DEBUGGING) log_it("time out processing '" + requested_signature + "'"); - send_reply_and_reset(LINK_THIS, [ BAD_NOTECARD_INDICATOR, current_response_code ], - READ_NOTECARD_COMMAND, FALSE); - current_response_code = 0; // we gave up on that one. - dequeue_next_request(); // get next reading started if we have anything to read. - } else { - // perform short range teleport, effectively... - llUnSit(llAvatarOnSitTarget()); // ha, got that guy back up. - llSetTimerEvent(0.0); // reset timer. - } - } - - // process the response from the noteworthy library. - link_message(integer which, integer num, string msg, key id) - { handle_link_message(which, num, msg, id); } - - dataserver(key query_id, string data) { - // make sure this data is for us. - if (global_query_id != query_id) return; - // yep, seems to be. - process_notecard_line(query_id, data); - } -} - diff --git a/huffware/huffotronic_tools_n_testers/huff-update_client_v20.1.txt b/huffware/huffotronic_tools_n_testers/huff-update_client_v20.1.txt deleted file mode 100755 index 4a458bb5..00000000 --- a/huffware/huffotronic_tools_n_testers/huff-update_client_v20.1.txt +++ /dev/null @@ -1,826 +0,0 @@ - -// huffware script: huff-update client, by fred huffhines. -// -// this script is the client side of the update process. it should reside in an object that -// has scripts which should be automatically updated. it will listen for announcements by -// an update server and communicate with the server to ensure that all of its scripts are -// the most up to date available with the server. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - -// global constants... - -integer DEBUGGING = FALSE; // if TRUE, the script will output status information. - -integer SERVER_IGNORE_TIME = 1200; // number of seconds between performing an upgrade with the same server. - -integer MAXIMUM_UPDATE_TIME_ALLOWED = 140; // we allow one upgrade process to take this long overall. - -integer UPDATE_ANNOUNCEMENT_CHANNEL = -420108; // used by server to brag about itself. -integer OLD_REQUEST_INVENTORY_CHANNEL = -421008; // used by clients to request an update list. - -string UPDATE_ANNOUNCEMENT_PREFIX = "#huff-update#"; // first part of any announcement. -string REQUEST_INVENTORY_PREFIX = "#huff-reqinv#"; // first part of request for inventory list. -string REPORT_AVAILABLE_SCRIPTS = "#scripts#"; // server's keyword to let client know script inventory. -string REQUEST_SCRIPT_UPDATE = "#updatego#"; // keyword used by client to request some updates. -string SHUT_THEM_DOWN = "#huffdown#"; // server tells client to stop any non-updater scripts. -string READY_TO_UPDATE = "#listoneeds#"; // the client tells the server the scripts it wants. -string SCRIPTS_ARE_CURRENT = "#gottemthx#"; // client says this when all new scripts are in place. -string START_THEM_UP = "#huffup#"; // server tells client to start up other scripts again. -string DONE_UPDATING = "#finito#"; // the client is done updating. -string BUSY_BUSY = "#busymuch#"; // a signal that the server is too busy to update us. - -float UPDATE_TIMER_INTERVAL = 2.0; // interval between checks on our update status. - -integer UPDATER_SCRIPT_PIN = -1231008; // the hook for our scripts to be modified. - -///float BUSY_SERVER_PAUSE_TIME = 38.0; // num seconds to delay when server says it's too busy. - -string UPDATER_PARM_SEPARATOR = "~~~"; - // three tildes is an uncommon thing to have otherwise, so we use it to separate - // our commands in linked messages. - -string SCRIPT_DEPENDENCY_MARK = "DEP"; // signals that a dependency is coming. -string ITEM_LIST_SEPARATOR = "``"; // separates dependencies. - -integer MAXIMUM_SERVERS_TRACKED = 32; - // we will listen to this many servers before we decide to remove one. - -string CONTINUANCE_MARKER = "..."; - // a string sent when the update list is too long and needs to be continued in another chat. - -string SERVER_SCRIPT = "a huffotronic update server"; - // the prefix of our server script that hands out updates. - -// global variables... - -integer inventory_request_channel; // used for newer version servers to cut down cross chatter. -list updaters_heard; // the update servers we've heard from recently. -list last_interactions; // times of the last update process engaged with the updater. -integer update_channel; // current channel for interaction with specific server. -key current_server; // the updater that is active right now, if any. -integer update_start_time; // when the last update process began. -list updates_needed; // stores the set of scripts that are in need of an update. -list known_script_dependencies; // stores the list of dependency info. - -careful_crankup() -{ - knock_around_other_scripts(TRUE); - // clean out the older items and scripts. we do this after getting everyone running - // since we might be whacking ourselves. - destroy_older_versions(); -} - -// reset our variables. -initialize() -{ - updaters_heard = []; - last_interactions = []; - inventory_request_channel = 0; - update_channel = 0; - current_server = NULL_KEY; - llSetTimerEvent(0.0); - llSetRemoteScriptAccessPin(UPDATER_SCRIPT_PIN); - // a new enhancements; tells the server that this guy has finished an update cycle. this - // only comes into play when the updater script itself has just been updated, but it's - // nice for the server to avoid claiming erroneous timeouts occurred. - llSay(OLD_REQUEST_INVENTORY_CHANNEL, DONE_UPDATING); - llSleep(0.4); // snooze and repeat to overcome occasionally lossy chats. - llSay(OLD_REQUEST_INVENTORY_CHANNEL, DONE_UPDATING); -} - -whack_updater_record(key id) -{ - integer prev_indy = find_in_list(updaters_heard, id); - if (prev_indy < 0) return; // not there. - updaters_heard = chop_list(updaters_heard, 0, prev_indy - 1) - + chop_list(updaters_heard, prev_indy + 1, llGetListLength(updaters_heard) - 1); - last_interactions = chop_list(last_interactions, 0, prev_indy - 1) - + chop_list(last_interactions, prev_indy + 1, llGetListLength(last_interactions) - 1); -} - -// note that this new, lower memory version, depends on the inventory functions returning -// items in alphabetical order. -scrub_items_by_type(string this_guy, integer inventory_type) -{ - list removal_list; - integer outer; - for (outer = 0; outer < llGetInventoryNumber(inventory_type); outer++) { - string curr = llGetInventoryName(inventory_type, outer); - list split = compute_basename_and_version(curr); - // make sure there was a comparable version number in this name. - if ( (curr != this_guy) && llGetListLength(split)) { - string curr_base = llList2String(split, 0); - float curr_ver = (float)llList2String(split, 1); -//log_it("outer: " + curr_base + " / " + (string)curr_ver); - integer inner; - for (inner = outer + 1; inner < llGetInventoryNumber(inventory_type); inner++) { - string next_guy = llGetInventoryName(inventory_type, inner); - list comp_split = compute_basename_and_version(next_guy); - if (llGetListLength(comp_split)) { - string comp_base = llList2String(comp_split, 0); - float comp_ver = (float)llList2String(comp_split, 1); - // okay, now we can actually compare. - if (curr_base != comp_base) { - // break out of inner loop. we are past where the names can matter. - inner = 2 * llGetInventoryNumber(inventory_type); - } else { -//log_it("inner: " + comp_base + " / " + (string)comp_ver); - if (curr_ver <= comp_ver) { - // the script at inner index is comparable or better than - // the script at the outer index. - removal_list += curr; - } else { - // this inner script must be inferior to the outer one, - // somehow, which defies our expectation of alphabetical ordering. - removal_list += next_guy; - } - } - } - } - } - } - - // now actually do the deletions. - for (outer = 0; outer < llGetListLength(removal_list); outer++) { - string to_whack = llList2String(removal_list, outer); - if (DEBUGGING) - log_it("removing older asset: " + to_whack); - llRemoveInventory(to_whack); - } -} - -// ensures that only the latest version of any script or object is kept in our inventory. -destroy_older_versions() -{ - // firstly, iterate across scripts to clean out older versions. - scrub_items_by_type(llGetScriptName(), INVENTORY_SCRIPT); - // secondly, try to clean out the objects. - scrub_items_by_type(llGetScriptName(), INVENTORY_OBJECT); - // thirdly, try to clean out the notecards. - scrub_items_by_type(llGetScriptName(), INVENTORY_NOTECARD); -} - -// sets the object to be listening for update info. -// if "just_owner" is true, then we will not listen on the general announcement channel. -listen_for_orders(integer just_owner) -{ - if (!just_owner) { - // try to hear an update being announced. - llListen(UPDATE_ANNOUNCEMENT_CHANNEL, "", NULL_KEY, ""); - } - - // super secret owner controls. - llListen(0, "", llGetOwner(), ""); -} - -// returns true if this object is a huffotronic updater of some sort. -integer inside_of_updater() -{ - return find_substring(llGetObjectName(), "huffotronic") >= 0; -} - -// returns true if a script is a version of our update server. -integer matches_server_script(string to_check) -{ - return is_prefix(to_check, SERVER_SCRIPT); -} - -// stops all the scripts besides this one. -knock_around_other_scripts(integer running_state) -{ - integer insider = inside_of_updater(); - if (running_state == TRUE) { - // make sure we crank up the scripts that are new first. we want to reset them - // as well, which we don't want to do for any existing scripts. - integer crank_indy; - for (crank_indy = 0; crank_indy < llGetListLength(updates_needed); crank_indy++) { - string crankee = llList2String(updates_needed, crank_indy); - if (find_in_inventory(crankee, INVENTORY_SCRIPT, TRUE) >= 0) { - if (!insider || matches_server_script(crankee)) { - // allow it to run again. - llSetScriptState(crankee, TRUE); - // reset it, to make sure it starts at the top. - llResetOtherScript(crankee); - } - } - } - } - - integer indy; - string self_script = llGetScriptName(); - // we set all other scripts to the running state requested. - for (indy = 0; indy < llGetInventoryNumber(INVENTORY_SCRIPT); indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - if ( (curr_script != self_script) - && (!insider || matches_server_script(curr_script)) ) { - // this one seems ripe for being set to the state requested. - llSetScriptState(curr_script, running_state); - } - } -} - -// a random channel for the interaction with the server. -integer random_channel() { return -(integer)(llFrand(800000) + 20000); } - -// make sure that any dependencies for the script with "basename" are added to the list -// of requests we make during an update. -list add_dependencies(string basename) -{ - list to_return; - integer indy; - for (indy = 0; indy < llGetListLength(known_script_dependencies); indy++) { - list deps = llParseString2List(llList2String(known_script_dependencies, indy), - [ITEM_LIST_SEPARATOR], []); -//log_it("base=" + llList2String(dep, 0) + " lastver=" + llList2String(dep, 1) + " newdep=" + llList2String(dep, 2)); - if (basename == llList2String(deps, 0)) { - // first off, is this item with new dependencies actually present? - integer where = find_in_inventory(basename, INVENTORY_SCRIPT, FALSE); - if (where >= 0) { - // we do use the script with deps, but is the dependent item really missing? - where = find_in_inventory(llList2String(deps, 1), INVENTORY_SCRIPT, FALSE); - if (where < 0) { - // we found a dependency match for this script, so we'll ask for the missing item. - if (DEBUGGING) - log_it("missing dep: " + llList2String(deps, 1)); - to_return += [ llList2String(deps, 1) ]; - } - } - } - } - return to_return; -} - -// complains if memory seems to be getting tight. -test_memory() -{ - if (llGetFreeMemory() < 4096) - log_it("mem_free = " + (string)llGetFreeMemory()); -} - -// starts an update given a list of scripts that the server has available, encoded as -// a string in the "encoded_list". -integer initiate_update(string encoded_list) -{ - list scripts_avail = llParseString2List(encoded_list, [UPDATER_PARM_SEPARATOR], []); - integer continue_listening_for_scripts = FALSE; - // if true, we aren't done hearing about available scripts yet. - encoded_list = ""; - // figure out which scripts we need by comparing the list available from the server - // against our current inventory. we only want scripts with newer version numbers. - integer sindy; - for (sindy = 0; sindy < llGetListLength(scripts_avail); sindy++) { - string curr = llList2String(scripts_avail, sindy); - if (curr == CONTINUANCE_MARKER) { - // this is a special continuation signal. we need to hear the rest of the list. - continue_listening_for_scripts = TRUE; - } else if (is_prefix(curr, SCRIPT_DEPENDENCY_MARK)) { - // we've found a dependency item. - known_script_dependencies += [ llGetSubString(curr, llStringLength(SCRIPT_DEPENDENCY_MARK), -1) ]; -//log_it("script dep: " + llGetSubString(curr, llStringLength(SCRIPT_DEPENDENCY_MARK), -1)); - } else { - list split = compute_basename_and_version(curr); - if (llGetListLength(split) == 2) { - string basename = llList2String(split, 0); - string version = llList2String(split, 1); - split = []; - integer oy_indy; -//replace common code with func. - for (oy_indy = 0; oy_indy < llGetInventoryNumber(INVENTORY_OBJECT); oy_indy++) { - list srv_split = compute_basename_and_version - (llGetInventoryName(INVENTORY_OBJECT, oy_indy)); - if ( (llGetListLength(srv_split) == 2) - && (basename == llList2String(srv_split, 0)) - && ((float)version > (float)llList2String(srv_split, 1)) ) { -// if (DEBUGGING) { - log_it("i need '" + curr + "' from server " + (string)inventory_request_channel); -// } - test_memory(); - updates_needed += [ curr ]; - } - } - for (oy_indy = 0; oy_indy < llGetInventoryNumber(INVENTORY_NOTECARD); oy_indy++) { - list srv_split = compute_basename_and_version - (llGetInventoryName(INVENTORY_NOTECARD, oy_indy)); - if ( (llGetListLength(srv_split) == 2) - && (basename == llList2String(srv_split, 0)) - && ((float)version > (float)llList2String(srv_split, 1)) ) { - if (DEBUGGING) { - log_it("i need '" + curr + "' from server " + (string)inventory_request_channel); - } - test_memory(); - updates_needed += [ curr ]; - } - } - for (oy_indy = 0; oy_indy < llGetInventoryNumber(INVENTORY_SCRIPT); oy_indy++) { - list srv_split = compute_basename_and_version - (llGetInventoryName(INVENTORY_SCRIPT, oy_indy)); - if ( (llGetListLength(srv_split) == 2) - && (basename == llList2String(srv_split, 0)) - && ((float)version > (float)llList2String(srv_split, 1)) ) { - if (DEBUGGING) { - log_it("i need '" + curr + "' from server " + (string)inventory_request_channel); - } - test_memory(); - updates_needed += [ curr ]; - } - } - updates_needed += add_dependencies(basename); - } - } - } - // we skip the next step if we're still waiting to hear about more. - if (continue_listening_for_scripts) { -//log_it("still listening for more updates..."); - return FALSE; - } - if (llGetListLength(updates_needed)) { -//log_it("update chan=" + (string)update_channel); - llSay(update_channel, REQUEST_SCRIPT_UPDATE); - if (DEBUGGING) { - log_it("told server " + (string)inventory_request_channel + " that i need updating."); - } - } else { - if (DEBUGGING) { - log_it("told server " + (string)inventory_request_channel + " that i am done updating."); - } - llSay(update_channel, DONE_UPDATING); - } - return TRUE; -} - -// this alerts the server to our most desired scripts. -tell_server_our_wish_list() -{ - llSay(update_channel, READY_TO_UPDATE + wrap_parameters(updates_needed)); -} - -// checks whether all of the updates needed are present yet. -integer check_on_update_presence() -{ - integer indy; - for (indy = 0; indy < llGetListLength(updates_needed); indy++) { - integer found = find_in_inventory(llList2String(updates_needed, indy), INVENTORY_ALL, TRUE); - // any single missing guy means they aren't up to date yet. - if (found < 0) { - if (DEBUGGING) log_it(llList2String(updates_needed, indy) + " not seen as updated yet."); - return FALSE; - } - } - // nothing was detected as missing anymore. - return TRUE; -} - -// respond to spoken commands from the server. -integer process_update_news(integer channel, string name, key id, string message) -{ - if (!channel) { - // this is a command. - if (message == "ureset") { - llResetScript(); // start over. - } - if (message == "ushow") { - integer sindy; - integer script_count = llGetInventoryNumber(INVENTORY_SCRIPT); - list script_list = [ "scripts--" ]; // first item is just a header. - for (sindy = 0; sindy < script_count; sindy++) { - script_list += [ llGetInventoryName(INVENTORY_SCRIPT, sindy) ]; - } - dump_list_to_log(script_list); - } - return FALSE; // nothing to do here. - } - if (!update_channel && (channel == UPDATE_ANNOUNCEMENT_CHANNEL)) { -/* never seen. if (id == llGetKey()) { -if (DEBUGGING) log_it("ignoring update from self."); - return FALSE; // ack, that's our very object. - } -*/ - if (llStringLength(message) > llStringLength(UPDATE_ANNOUNCEMENT_PREFIX)) { - // this is a new style update message. we can set a different request channel. - string just_chan = llDeleteSubString(message, 0, llStringLength(UPDATE_ANNOUNCEMENT_PREFIX) - 1); - inventory_request_channel = (integer)just_chan; - } - integer prev_indy = find_in_list(updaters_heard, id); - // find the talker in our list. - if (prev_indy >= 0) { - // that guy was already heard from. check when last interacted. - integer last_heard = llList2Integer(last_interactions, prev_indy); - if (llAbs(llGetUnixTime() - last_heard) < SERVER_IGNORE_TIME) { - return FALSE; // not time to update with this guy again yet. - } -// if (DEBUGGING) { log_it("started listening again to server " + (string)id); } - // make sure we think of this as a new updater now. - whack_updater_record(id); - } - - if (DEBUGGING) { log_it("heard server " + (string)inventory_request_channel + "'s announcement."); } - // record our new server. - current_server = id; - // make a random pause so not all updaters try to crank up at same time. - llSleep(randomize_within_range(2.8, 18.2, FALSE)); - - if (llGetListLength(updaters_heard) > MAXIMUM_SERVERS_TRACKED) { - // oops, this is not good. we have too many servers now. -//hmmm: room for improvement here by tossing out the server that is oldest. - updaters_heard = llDeleteSubList(updaters_heard, 0, 0); - last_interactions = llDeleteSubList(last_interactions, 0, 0); - } - - // add the talker to our list. - updaters_heard += id; - last_interactions += llGetUnixTime(); - - // begin the update interaction with this guy. - update_channel = random_channel(); - return TRUE; - } - if (update_channel && (channel == update_channel) ) { - if (is_prefix(message, REPORT_AVAILABLE_SCRIPTS)) { - // tasty, this is a list of scripts that can be had. - message = llDeleteSubString(message, 0, llStringLength(REPORT_AVAILABLE_SCRIPTS) - 1); - if (message == BUSY_BUSY) { - // server has signified that it's too busy (or its owner is a moron) because it is - // claiming it has no scripts at all. - if (DEBUGGING) { - log_it("server " + (string)inventory_request_channel + " is too busy to update us now."); - } - // make it seem like we need to do this one again sooner than normal. - whack_updater_record(id); - // busy server means move no further forward. - return FALSE; - } - return initiate_update(message); - } else if (is_prefix(message, SHUT_THEM_DOWN)) { - if (DEBUGGING) { log_it("stopping other scripts."); } - knock_around_other_scripts(FALSE); - // now that we know for sure the server's ready to update us, - // we tell it what we need. - tell_server_our_wish_list(); - return FALSE; - } else if (is_prefix(message, START_THEM_UP)) { - // let the server know that we've finished, for all intents and purposes. - llSay(update_channel, DONE_UPDATING); - // we pause a random bit first; we want to ensure we aren't swamping - // SL with our inventory loading. - llSleep(randomize_within_range(2.5, 8.2, FALSE)); - if (DEBUGGING) { log_it("starting other scripts."); } - careful_crankup(); - return TRUE; // change state now. -// } else { -//log_it("unknown command on update channel: " + message); - } - } - return FALSE; -} - -////////////// -// from hufflets... - -integer debug_num = 0; - -// a debugging output method. can be disabled entirely in one place. -log_it(string to_say) -{ - debug_num++; - llWhisper(0, llGetScriptName() + " [" + (string)debug_num + "] (" + (string)llGetFreeMemory() + ") " + to_say); -} - -// returns a number at most "maximum" and at least "minimum". -// if "allow_negative" is TRUE, then the return may be positive or negative. -float randomize_within_range(float minimum, float maximum, integer allow_negative) -{ - if (minimum > maximum) { - // flip the two if they are reversed. - float temp = minimum; minimum = maximum; maximum = temp; - } - float to_return = minimum + llFrand(maximum - minimum); - if (allow_negative) { - if (llFrand(1.0) < 0.5) to_return *= -1.0; - } - return to_return; -} - -// returns TRUE if the "pattern" is found in the "full_string". -integer matches_substring(string full_string, string pattern) -{ return (find_substring(full_string, pattern) >= 0); } - -// returns the index of the first occurrence of "pattern" inside -// the "full_string". if it is not found, then a negative number is returned. -integer find_substring(string full_string, string pattern) -{ return llSubStringIndex(llToLower(full_string), llToLower(pattern)); } - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return find_substring(compare_with, prefix) == 0; } - -// locates the string "text" in the list to "search_in". -integer find_in_list(list search_in, string text) -{ - integer len = llGetListLength(search_in); - integer i; - for (i = 0; i < len; i++) { - if (llList2String(search_in, i) == text) - return i; - } - return -1; -} - -// returns the portion of the list between start and end, but only if they are -// valid compared with the list length. an attempt to use negative start or -// end values also returns a blank list. -list chop_list(list to_chop, integer start, integer end) -{ - integer last_len = llGetListLength(to_chop) - 1; - if ( (start < 0) || (end < 0) || (start > last_len) || (end > last_len) ) return []; - return llList2List(to_chop, start, end); -} - -// joins a list of parameters using the parameter sentinel for the library. -string wrap_parameters(list to_flatten) -{ return llDumpList2String(to_flatten, UPDATER_PARM_SEPARATOR); } - -// locates the item with "name_to_find" in the inventory items with the "type". -// a value from 0 to N-1 is returned if it's found, where N is the number of -// items in the inventory. -integer find_in_inventory(string name_to_find, integer inv_type, integer exact_match) -{ - integer num_inv = llGetInventoryNumber(inv_type); - if (num_inv == 0) return -1; // nothing there! - integer inv; - for (inv = 0; inv < num_inv; inv++) { - if (exact_match && (llGetInventoryName(inv_type, inv) == name_to_find) ) - return inv; - else if (!exact_match && is_prefix(llGetInventoryName(inv_type, inv), name_to_find)) - return inv; - } - return -2; // failed to find it. -} - -////////////// - -integer MAX_CHAT_LINE = 900; - // the most characters we'll try to say in one chat. - -dump_list_to_log(list to_show) -{ - string text = dump_list(to_show); // get some help from the other version. - integer len = llStringLength(text); - integer i; - for (i = 0; i < len; i += MAX_CHAT_LINE) { - integer last_bit = i + MAX_CHAT_LINE - 1; - if (last_bit >= len) last_bit = len - 1; - string next_line = llGetSubString(text, i, last_bit); - llWhisper(0, next_line); - } -} - -// returns a printable form of the list. -string dump_list(list to_show) -{ - integer len = llGetListLength(to_show); - integer i; - string text; - for (i = 0; i < len; i++) { - string next_line = llList2String(to_show, i); - if (find_substring(next_line, " ") >= 0) { - // this guy has a space in it, so quote it. - next_line = "\"" + next_line + "\""; - } - text = text + next_line; - if (i < len - 1) text = text + " "; - } - return text; -} - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.8. -// distributed under BSD-like license. -// !! keep in mind that this code must be *copied* into another -// !! script that you wish to add auto-retirement capability to. -// when a script has auto_retire in it, it can be dropped into an -// object and the most recent version of the script will destroy -// all older versions. -// -// the version numbers are embedded into the script names themselves. -// the notation for versions uses a letter 'v', followed by two numbers -// in the form "major.minor". -// major and minor versions are implicitly considered as a floating point -// number that increases with each newer version of the script. thus, -// "hazmap v0.1" might be the first script in the "hazmap" script continuum, -// and "hazmap v3.2" is a more recent version. -// -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -// this script is partly based on the self-upgrading scripts from markov brodsky -// and jippen faddoul. -////////////// -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -// end hufflets. -////////////// - -// no huffotronic trap state for startup, because this script will actually -// run (and is expected) inside a huffotronic updater object. - -default -{ - state_entry() - { - auto_retire(); // only allow the most recent revision. - initialize(); - state awaiting_commands; - } -} - -state awaiting_commands -{ - state_entry() - { - if (DEBUGGING) log_it(""); - careful_crankup(); // we always start by getting everyone running. - current_server = NULL_KEY; // forget previous server. - listen_for_orders(FALSE); - inventory_request_channel = 0; // no inventory request channel either. - update_channel = 0; // no channel currently. - updates_needed = []; // we know of no needs right now. - known_script_dependencies = []; // no deps either. - } - - state_exit() { llSetTimerEvent(0.0); } - - listen(integer channel, string name, key id, string message) - { - if ((id != llGetOwner()) && (llGetOwnerKey(id) != llGetOwner())) { - return; // must be same owner to ensure proper perms. - } - if (process_update_news(channel, name, id, message)) - state establish_private_channel; - } -} - -state establish_private_channel -{ - state_entry() - { - if (DEBUGGING) log_it(""); - llListen(update_channel, "", current_server, ""); - listen_for_orders(TRUE); - if (inventory_request_channel) - llSay(inventory_request_channel, REQUEST_INVENTORY_PREFIX + (string)update_channel); - else - llSay(OLD_REQUEST_INVENTORY_CHANNEL, REQUEST_INVENTORY_PREFIX + (string)update_channel); - llSetTimerEvent(MAXIMUM_UPDATE_TIME_ALLOWED); - } - - state_exit() { llSetTimerEvent(0); } - - listen(integer channel, string name, key id, string message) - { - if ((id != llGetOwner()) && (llGetOwnerKey(id) != llGetOwner())) { - return; // must be same owner to ensure proper perms. - } - if (process_update_news(channel, name, id, message)) { - // ready for a state change, but what kind? - if (llGetListLength(updates_needed)) { -//log_it("have a list of updates now."); - state performing_update; - } else { -//log_it("no updates needed in list, going back"); - state awaiting_commands; - } - } - } - - timer() { - if (DEBUGGING) { - log_it("timed out establishing channel with server " + (string)inventory_request_channel); - } - whack_updater_record(current_server); - state awaiting_commands; - } - - on_rez(integer parm) { state default; } -} - -state performing_update -{ - state_entry() - { - // must re-listen after a state change. - llListen(update_channel, "", current_server, ""); - listen_for_orders(TRUE); - if (DEBUGGING) log_it(""); - llSetTimerEvent(UPDATE_TIMER_INTERVAL); - update_start_time = llGetUnixTime(); - } - - state_exit() { llSetTimerEvent(0.0); } - - listen(integer channel, string name, key id, string message) - { - if ((id != llGetOwner()) && (llGetOwnerKey(id) != llGetOwner())) { - return; // must be same owner to ensure proper perms. - } - if (process_update_news(channel, name, id, message)) { - // normal finish of update process. - state awaiting_commands; - } - } - - timer() { - if (llGetListLength(updates_needed) == 0) { -//log_it("nothing to update, leaving perform state."); - state awaiting_commands; // we've got nothing to do. - } else { - // see if all our requested scripts are there yet; if not, we're not done updating. - integer ready = check_on_update_presence(); - if (ready) { - if (DEBUGGING) log_it("reporting scripts are current."); - llSay(update_channel, SCRIPTS_ARE_CURRENT); - } - } - if (llAbs(update_start_time - llGetUnixTime()) >= MAXIMUM_UPDATE_TIME_ALLOWED) { - if (DEBUGGING) { log_it("timeout during update process with server " + (string)inventory_request_channel); } - whack_updater_record(current_server); - state awaiting_commands; - } - } - - on_rez(integer parm) { state default; } -} - diff --git a/huffware/huffotronic_tools_n_testers/zap_updater_from_elevators_v1.3.txt b/huffware/huffotronic_tools_n_testers/zap_updater_from_elevators_v1.3.txt deleted file mode 100755 index 6dee724d..00000000 --- a/huffware/huffotronic_tools_n_testers/zap_updater_from_elevators_v1.3.txt +++ /dev/null @@ -1,187 +0,0 @@ - -// huffware script: zap updater from elevators, by fred huffhines -// -// this script is an evil little assassin that is supposed to remove the updater -// script from the objects it's added to. it should not remove that script from -// any huffotronic devices though. -// this is an attempt to quell some SL stability problems due to some seeming -// combination of numbers of objects and numbers of scripts. -// we hope to be able to add the updater back in automatically later because the -// script pin should still be set. let's see if osgrid has that behavior the same -// as second life did. -// -// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html -// do not use it in objects without fully realizing you are implicitly accepting that license. -// - - -// from hufflets... - -////////////// -// huffware script: auto-retire, by fred huffhines, version 2.8. -// distributed under BSD-like license. -// !! keep in mind that this code must be *copied* into another -// !! script that you wish to add auto-retirement capability to. -// when a script has auto_retire in it, it can be dropped into an -// object and the most recent version of the script will destroy -// all older versions. -// -// the version numbers are embedded into the script names themselves. -// the notation for versions uses a letter 'v', followed by two numbers -// in the form "major.minor". -// major and minor versions are implicitly considered as a floating point -// number that increases with each newer version of the script. thus, -// "hazmap v0.1" might be the first script in the "hazmap" script continuum, -// and "hazmap v3.2" is a more recent version. -// -// example usage of the auto-retirement script: -// default { -// state_entry() { -// auto_retire(); // make sure newest addition is only version of script. -// } -// } -// this script is partly based on the self-upgrading scripts from markov brodsky -// and jippen faddoul. -////////////// -auto_retire() { - string self = llGetScriptName(); // the name of this script. - list split = compute_basename_and_version(self); - if (llGetListLength(split) != 2) return; // nothing to do for this script. - string basename = llList2String(split, 0); // script name with no version attached. - string version_string = llList2String(split, 1); // the version found. - integer posn; - // find any scripts that match the basename. they are variants of this script. - for (posn = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; posn >= 0; posn--) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, posn); - if ( (curr_script != self) && (llSubStringIndex(curr_script, basename) == 0) ) { - // found a basic match at least. - list inv_split = compute_basename_and_version(curr_script); - if (llGetListLength(inv_split) == 2) { - // see if this script is more ancient. - string inv_version_string = llList2String(inv_split, 1); // the version found. - // must make sure that the retiring script is completely the identical basename; - // just matching in the front doesn't make it a relative. - if ( (llList2String(inv_split, 0) == basename) - && ((float)inv_version_string < (float)version_string) ) { - // remove script with same name from inventory that has inferior version. - llRemoveInventory(curr_script); - } - } - } - } -} -// -// separates the base script name and version number. used by auto_retire. -list compute_basename_and_version(string to_chop_up) -{ - // minimum script name is 2 characters plus a version. - integer space_v_posn; - // find the last useful space and 'v' combo. - for (space_v_posn = llStringLength(to_chop_up) - 3; - (space_v_posn >= 2) && (llGetSubString(to_chop_up, space_v_posn, space_v_posn + 1) != " v"); - space_v_posn--) { - // look for space and v but do nothing else. - } - if (space_v_posn < 2) return []; // no space found. - // now we zoom through the stuff after our beloved v character and find any evil - // space characters, which are most likely from SL having found a duplicate item - // name and not so helpfully renamed it for us. - integer indy; - for (indy = llStringLength(to_chop_up) - 1; indy > space_v_posn; indy--) { - if (llGetSubString(to_chop_up, indy, indy) == " ") { - // found one; zap it. since we're going backwards we don't need to - // adjust the loop at all. - to_chop_up = llDeleteSubString(to_chop_up, indy, indy); - } - } - string full_suffix = llGetSubString(to_chop_up, space_v_posn, -1); - // ditch the space character for our numerical check. - string chop_suffix = llGetSubString(full_suffix, 1, llStringLength(full_suffix) - 1); - // strip out a 'v' if there is one. - if (llGetSubString(chop_suffix, 0, 0) == "v") - chop_suffix = llGetSubString(chop_suffix, 1, llStringLength(chop_suffix) - 1); - // if valid floating point number and greater than zero, that works for our version. - string basename = to_chop_up; // script name with no version attached. - if ((float)chop_suffix > 0.0) { - // this is a big success right here. - basename = llGetSubString(to_chop_up, 0, -llStringLength(full_suffix) - 1); - return [ basename, chop_suffix ]; - } - // seems like we found nothing useful. - return []; -} -// -////////////// - -// returns the index of the first occurrence of "pattern" inside -// the "full_string". if it is not found, then a negative number is returned. -integer find_substring(string full_string, string pattern) -{ return llSubStringIndex(llToLower(full_string), llToLower(pattern)); } - -// returns TRUE if the "prefix" string is the first part of "compare_with". -integer is_prefix(string compare_with, string prefix) -{ return find_substring(compare_with, prefix) == 0; } - -// returns true if this object is a huffotronic updater of some sort. -integer inside_of_updater() -{ - return find_substring(llGetObjectName(), "huffotronic") >= 0; -} - -// stops all the scripts besides this one. -knock_around_other_scripts(integer running_state) -{ - integer indy; - integer insider = inside_of_updater(); - string self_script = llGetScriptName(); - // we set all other scripts to the running state requested. - for (indy = 0; indy < llGetInventoryNumber(INVENTORY_SCRIPT); indy++) { - string curr_script = llGetInventoryName(INVENTORY_SCRIPT, indy); - if ( (curr_script != self_script) - && (!insider || matches_server_script(curr_script)) ) { - // this one seems ripe for being set to the state requested. - llSetScriptState(curr_script, running_state); - } - } -} - -string SERVER_SCRIPT = "huffotronic update server"; - // the prefix of our server script that hands out updates. - -// returns true if a script is a version of our update server. -integer matches_server_script(string to_check) -{ - return is_prefix(to_check, SERVER_SCRIPT); -} - -// end hufflets. -////////////// - -default -{ - state_entry() - { - auto_retire(); - if (inside_of_updater()) return; // do nothing else. - - llWhisper(0, "hello, i'm jeeves. pleased to meet you."); - llSleep(32); - - string gotta_zap = "huff-update client v"; - integer i; - for (i = llGetInventoryNumber(INVENTORY_SCRIPT) - 1; i >= 0; i--) { - string cur = llGetInventoryName(INVENTORY_SCRIPT, i); - if (is_prefix(cur, gotta_zap)) { - llWhisper(0, "i, jeeves, will now clean out this script: " + cur); - llRemoveInventory(cur); - } - } - llSleep(14); - knock_around_other_scripts(TRUE); - llSleep(4); - llWhisper(0, "i'm sorry to say sir that i now must bid you adieu, as i am removing myself from the world."); - llSleep(1); - llRemoveInventory(llGetScriptName()); - } -} - diff --git a/huffware/readme.txt b/huffware/readme.txt index 7e8eda9f..130938de 100644 --- a/huffware/readme.txt +++ b/huffware/readme.txt @@ -1,15 +1,21 @@ -This folder is still under development, but it is intended to hold all of the -LSL (linden scripting language) open source assets from our adventures in -osgrid, opensim and second life. +This folder is in active development, but it is intended to hold all of the +LSL (linden scripting language) free and open source assets from our +adventures in osgrid, opensim and second life. -In the metaverse, the source is distributed inside huffotronic updaters, so -that's our organizational scheme for the moment. +In the metaverse, the source is distributed inside huffotronic updater +objects, which are active repositories of the source code that can update +other objects to the newest version. We provide those huffotronic updaters +in the "latest_iars" folder (in opensim IAR format). -Note that the updater must have 'huffotronic' in its object name for the +All of the huffware / huffotronic scripts can be found in text file format +in the "huffotronic_scripts" folder. This should be close to the latest +versions of all the scripts that are currently free source. + +Note that the updater object must have 'huffotronic' in its name for the huffotronic update server and client scripts to work properly. Also note that these products are currently licensed according to this file: - licenses/license--free_in_osgrid_and_personal_opensims_only_v1.9.txt +"licenses/license--free_in_osgrid_and_personal_opensims_only_v1.9.txt" -- 2.34.1