Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scripts][dependency] Auto-turn on ShowRoomID and MonsterBold one time #7045

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions dependency.lic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,6 +43,18 @@ unless Settings['dependency_version'] == $DEPENDENCY_VERSION
Settings.save
end

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/) }
fput("flag #{flag} on")
end
end
UserVars.dependency_setflags = Time.now
end

class Object
# IMPORT FUTURE LAWLZ
def itself
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
Loading