Skip to content

Commit

Permalink
Merge pull request #6986 from MahtraDR/dependency_tweaks
Browse files Browse the repository at this point in the history
[scripts][dependency] Small tweaks to saving settings when changing autostarts
  • Loading branch information
MahtraDR authored Nov 14, 2024
2 parents 4513c38 + 88168cd commit a812fa0
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 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 = '1.7.10'
$DEPENDENCY_VERSION = '1.7.11'
$MIN_RUBY_VERSION = '3.2.2'
DRINFOMON_IN_CORE_LICH ||= false
DRINFOMON_CORE_LICH_DEFINES ||= []
Expand Down Expand Up @@ -215,8 +215,19 @@ class ScriptManager
UserVars.autostart_scripts.uniq!
UserVars.autostart_scripts = UserVars.autostart_scripts - ['dependency']
Settings['autostart'] ||= []
Settings['autostart'].uniq!
Settings['autostart'] = Settings['autostart'] - ['dependency']

unless Settings['autostart'] == Settings['autostart'].uniq
echo("Duplicate autostarts found.")
echo("Removing #{Settings['autostart'] - Settings['autostart'].uniq}")
Settings['autostart'].uniq!
Settings.save
end

if Settings['autostart'].include?('dependency')
echo("Dependency found in autostarts. It doesn't belond here. Removing it.")
Settings['autostart'] -= ['dependency']
Settings.save
end

# Setting Settings['lich_fork_sha'] to nil if using lich5. This setting isn't used anymore.

Expand Down Expand Up @@ -347,11 +358,13 @@ class ScriptManager
unless @add_autos.empty?
update = true
@add_autos.each { |script| Settings['autostart'] << script }
Settings.save
@add_autos = []
end
unless @remove_autos.empty?
update = true
@remove_autos.each { |script| Settings['autostart'].delete(script) }
Settings.save
@remove_autos = []
end

Expand Down Expand Up @@ -1631,6 +1644,10 @@ def verify_script(script_names)
state
end

def make_map_edits
$manager.make_map_edits
end

def get_script(script_name)
echo("Force downloading #{script_name}")
$manager.get_script(format_name(script_name), true)
Expand Down Expand Up @@ -1846,9 +1863,9 @@ unless DRINFOMON_IN_CORE_LICH
end

if DRINFOMON_IN_CORE_LICH
Lich::Util.issue_command("exp all 0", /^Circle: \d+/, /^Rested EXP Stored|Unlock Rested Experience|type: AWAKEN/, quiet: true)
Lich::Util.issue_command("info", /^Name/, /^<output class=""/, quiet: true)
Lich::Util.issue_command("ability", /^You (know the Berserks|recall the spells you have learned from your training)/, /^You (recall that you have \d+ training sessions|can use SPELL STANCE \[HELP\]|have \d+ available slot)/, quiet: true)
Lich::Util.issue_command("exp all 0", /^Circle: \d+/, /^Rested EXP Stored|type: AWAKEN|Unlock Rested Experience/, quiet: true, timeout: 1)
Lich::Util.issue_command("info", /^Name/, /^<output class=""/, quiet: true, timeout: 1)
Lich::Util.issue_command("ability", /^You (know the Berserks|recall the spells you have learned from your training)|^From your apprenticeship you remember practicing/, /^You (recall that you have \d+ training sessions|can use SPELL STANCE \[HELP\]|have \d+ available slot)/, quiet: true, timeout: 1)
end

$manager.check_base_files
Expand Down

0 comments on commit a812fa0

Please sign in to comment.