diff --git a/afk.lic b/afk.lic index c44f82685d..f8587c73e4 100644 --- a/afk.lic +++ b/afk.lic @@ -15,7 +15,7 @@ def exit_game(message) fput('exit') end -def idle?(line) +def afk?(line) return true if line =~ /you have been idle too long/i if $_IDLETIMESTAMP_ && $_SCRIPTIDLETIMESTAMP_ @@ -47,7 +47,7 @@ loop do line = script.gets? pause 0.05 unless line - fput(%w[tdp time age].sample) if idle?(line) + fput(%w[tdp time age].sample) if afk?(line) justice_message_count += 1 if line =~ /^"Burn .+! Burn .+!" .* giving you a wide berth/ justice_message_count += 1 if line =~ /authorities will try to bring you in for endangering the public/ @@ -56,6 +56,7 @@ loop do DRSpells.active_spells.each { |x, _y| fput("release #{get_data("spells")["spell_data"][x]["abbrev"]} spell") if get_data("spells")["spell_data"][x]["triggers_justice"] } spell_check_count = justice_message_count end + if justice_message_count > justice_threshold exit_game("It looks like you've run into trouble with the law too many times") end @@ -74,7 +75,7 @@ loop do stop_script('go2') if Script.running?('go2') end -if line =~ /^You notice .* at your feet, and do not wish to leave it behind/ || line =~ /You find yourself unable to sneak with items at your feet/ + if line =~ /^You notice .* at your feet, and do not wish to leave it behind/ || line =~ /You find yourself unable to sneak with items at your feet/ DRCI.stow_hand('left') unless !DRC.right_hand || !DRC.left_hand while DRC.bput('stow feet', /You pick up/, /Stow what/) =~ /You pick up/ end diff --git a/bootstrap.lic b/bootstrap.lic index 8d8be595ec..cd20804f3e 100644 --- a/bootstrap.lic +++ b/bootstrap.lic @@ -3,9 +3,9 @@ Documentation: https://elanthipedia.play.net/Lich_script_development#bootstrap =end -$BOOTSTRAP_VERSION = '1.0.3' -DRINFOMON_IN_CORE_LICH ||= false -DRINFOMON_CORE_LICH_DEFINES ||= [] +$BOOTSTRAP_VERSION = '1.0.4' +DRINFOMON_IN_CORE_LICH ||= DRInfomon::DRINFOMON_IN_CORE_LICH ||= false +DRINFOMON_CORE_LICH_DEFINES ||= DRInfomon::DRINFOMON_CORE_LICH_DEFINES ||= [] class_defs = { 'drinfomon' => :DRINFOMON, @@ -55,7 +55,7 @@ $MODERN_LICH = lich_version >= if Regexp.last_match(1) Gem::Version.new('4.6.49') end -if args.wipe_constants && !DRINFOMON_IN_CORE_LICH +if args.wipe_constants && !DRInfomon::DRINFOMON_IN_CORE_LICH class_defs.each_value { |symb| remove_constant(symb) if constant_defined?(symb) } exit end @@ -63,8 +63,8 @@ end scripts_to_run = args.flex || [] echo scripts_to_run.to_s if UserVars.bootstrap_debug -if (scripts_to_run & DRINFOMON_CORE_LICH_DEFINES).any? - scripts_to_run -= DRINFOMON_CORE_LICH_DEFINES +if (scripts_to_run & DRInfomon::DRINFOMON_CORE_LICH_DEFINES).any? + scripts_to_run -= DRInfomon::DRINFOMON_CORE_LICH_DEFINES echo("Removing core lich defines from scripts_to_run") if UserVars.bootstrap_debug end diff --git a/dependency.lic b/dependency.lic index b96c4cdf81..cea73334ac 100644 --- a/dependency.lic +++ b/dependency.lic @@ -10,10 +10,10 @@ require 'ostruct' require 'digest/sha1' require 'monitor' -$DEPENDENCY_VERSION = '2.0.5' +$DEPENDENCY_VERSION = '2.0.6' $MIN_RUBY_VERSION = '3.2.2' -DRINFOMON_IN_CORE_LICH ||= false -DRINFOMON_CORE_LICH_DEFINES ||= Array.new +DRInfomon::DRINFOMON_IN_CORE_LICH ||= false +DRInfomon::DRINFOMON_CORE_LICH_DEFINES ||= Array.new no_pause_all no_kill_all @@ -1582,9 +1582,9 @@ def custom_require lambda do |script_names| script_names = [script_names] unless script_names.is_a?(Array) respond("CR:starting:#{script_names}") if UserVars.bootstrap_debug - if DRINFOMON_IN_CORE_LICH + if DRInfomon::DRINFOMON_IN_CORE_LICH echo("DRInfomon in core lich detected. Skipping loading drinfomon and commons") if UserVars.bootstrap_debug - script_names -= DRINFOMON_CORE_LICH_DEFINES + script_names -= DRInfomon::DRINFOMON_CORE_LICH_DEFINES end bootstrapper = force_start_script('bootstrap', script_names) pause 0.05 @@ -1749,7 +1749,7 @@ end def update_d echo('Restarting Dependency in 2 seconds...') - force_start_script('bootstrap', ['wipe_constants']) unless DRINFOMON_IN_CORE_LICH + force_start_script('bootstrap', ['wipe_constants']) unless DRInfomon::DRINFOMON_IN_CORE_LICH before_dying do sleep 2 force_start_script('dependency') @@ -1799,12 +1799,12 @@ end full_install if install -force_start_script('bootstrap', ['wipe_constants']) unless DRINFOMON_IN_CORE_LICH +force_start_script('bootstrap', ['wipe_constants']) unless DRInfomon::DRINFOMON_IN_CORE_LICH # Proactively starting DRinfomon as script zero to prevent # race conditions involving this script which so many other # scripts depend on, and which is slow to start on its own -unless DRINFOMON_IN_CORE_LICH +unless DRInfomon::DRINFOMON_IN_CORE_LICH echo("Starting DRinfomon, this will take a few seconds.") custom_require.call('drinfomon') diff --git a/spellmonitor.lic b/spellmonitor.lic index 7c8eb6f733..0aa10192ee 100644 --- a/spellmonitor.lic +++ b/spellmonitor.lic @@ -2,10 +2,10 @@ Documentation: https://elanthipedia.play.net/Lich_script_development#spellmonitor =end -$SPELLMONITOR_VERSION = '2.0.1' -DRINFOMON_IN_CORE_LICH ||= false +$SPELLMONITOR_VERSION = '2.0.2' +DRInfomon::DRINFOMON_IN_CORE_LICH ||= false -if DRINFOMON_IN_CORE_LICH +if DRInfomon::DRINFOMON_IN_CORE_LICH DRC.message("DRInfomon in core lich includes spellmonitor. Exiting.") exit end