From 4460e156834896c9cc76b4efe7ff1e5f3e8664f5 Mon Sep 17 00:00:00 2001 From: Mahtra <93822896+MahtraDR@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:48:55 +1300 Subject: [PATCH 1/2] [scripts][dependency] Auto-turn on ShowRoomID and MonsterBold one time --- dependency.lic | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dependency.lic b/dependency.lic index b96c4cdf8..1586c34bd 100644 --- a/dependency.lic +++ b/dependency.lic @@ -10,7 +10,7 @@ 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 @@ -43,6 +43,18 @@ unless Settings['dependency_version'] == $DEPENDENCY_VERSION Settings.save end +unless CharSettings['dependency_setflags'] + echo("Checking MonsterBold and ShowRoomID flags.") + flags = Lich::Util.issue_command("flag", /^Usage/, /^For other setting options, see AVOID, SET, and TOGGLE/, quiet: true, timeout: 1, usexml: false) + mandatory_flags = ["ShowRoomID", "MonsterBold"] + mandatory_flags.each do |flag| + unless flags.any?{ |f| f.match?(/#{flag}\s+ON/) } + fput("flag #{flag} on") + end + end + CharSettings['dependency_setflags'] = Time.now +end + class Object # IMPORT FUTURE LAWLZ def itself @@ -246,7 +258,7 @@ class ScriptManager # Setting Settings['lich_fork_sha'] to nil if using lich5. This setting isn't used anymore. Settings['base_versions'] ||= {} - CharSettings['next_ruby_version_check_datetime'] = Time.now + Settings['next_ruby_version_check_datetime'] = Time.now @add_autos = [] @remove_autos = [] @@ -1709,7 +1721,7 @@ end def validate_supported_ruby_version # Get stored time for next check (or now if not stored yet) - next_check_datetime = CharSettings['next_ruby_version_check_datetime'] || Time.now + next_check_datetime = Settings['next_ruby_version_check_datetime'] || Time.now # Don't spam user every iteration of run_queue return if next_check_datetime > Time.now @@ -1726,7 +1738,7 @@ def validate_supported_ruby_version end # Set next check time to 3 hours from now - CharSettings['next_ruby_version_check_datetime'] = Time.now + (60 * 60 * 3) + Settings['next_ruby_version_check_datetime'] = Time.now + (60 * 60 * 3) end def remove_from_autostart(scripts) From 7373e6b8e224cf87dde2b1f805affdb5a864fb09 Mon Sep 17 00:00:00 2001 From: Mahtra <93822896+MahtraDR@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:35:04 +1300 Subject: [PATCH 2/2] refactor --- dependency.lic | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependency.lic b/dependency.lic index 1586c34bd..266b50477 100644 --- a/dependency.lic +++ b/dependency.lic @@ -43,16 +43,16 @@ unless Settings['dependency_version'] == $DEPENDENCY_VERSION Settings.save end -unless CharSettings['dependency_setflags'] +unless UserVars.dependency_setflags echo("Checking MonsterBold and ShowRoomID flags.") flags = Lich::Util.issue_command("flag", /^Usage/, /^For other setting options, see AVOID, SET, and TOGGLE/, quiet: true, timeout: 1, usexml: false) mandatory_flags = ["ShowRoomID", "MonsterBold"] mandatory_flags.each do |flag| - unless flags.any?{ |f| f.match?(/#{flag}\s+ON/) } + unless flags.any? { |f| f.match?(/#{flag}\s+ON/) } fput("flag #{flag} on") end end - CharSettings['dependency_setflags'] = Time.now + UserVars.dependency_setflags = Time.now end class Object