Skip to content

Commit

Permalink
Merge pull request #7065 from urbaj-dr/patch-30
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Jan 18, 2025
2 parents 4334597 + 15355f9 commit f031f74
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions avtalia.lic
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,27 @@ no_pause_all

class Avtalia
def initialize
arg_definitions = [
[
{ name: 'window', regex: /window/i, optional: true, description: 'Toggle a window for Avtalia updates. (Alternatively, set avtalia_window: true in your YAML.)' },
]
]

@args = parse_args(arg_definitions)
@settings = get_settings
@avtalia_array = @settings.avtalia_array
@window = @args.window || @settings.avtalia_window
exit if @avtalia_array.empty?
if @window
if $frontend == 'genie' # fix genie bullshit
_respond("<streamWindow id='avtaliaWindow' title='avtaliaWindow' location='center' save='true' />")
echo('Be sure to open the avtaliaWindow window if not already open.')
else
_respond("<streamWindow id='avtaliaWindow' title='Avtalia' location='center' save='true' />")
end
_respond("<exposeStream id='avtaliaWindow'/>")
@window_cache = nil
end
add_avtalia_flags
execute
end
Expand Down Expand Up @@ -56,6 +74,14 @@ class Avtalia
Flags.reset("avtalia-full-#{camb['name']}")
Flags.reset("avtalia-focus-#{camb['name']}")
end

if @window
new_message = UserVars.avtalia.map { |item, stats| "#{item}: #{stats['mana']}/#{stats['cap']}" }.join("\r\n")
return if @window_cache == new_message
@window_cache = new_message
_respond("<clearStream id=\"avtaliaWindow\"/>\r\n")
_respond("<pushStream id=\"avtaliaWindow\"/>#{new_message}\r\n<popStream/>\r\n")
end
end
end

Expand Down
2 changes: 2 additions & 0 deletions profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ cambrinth_invoke_exact_amount: false
aura_frequency:
# Trader-use avtalia.lic to build a list of avtalia cambrinth. See https://github.com/elanthia-online/dr-scripts/wiki/Trader-Tutorials
avtalia_array:
# Show avtalia mana amounts per item in a front end window (similar to moonwatch)
avtalia_window: false

# Looting settings
# add or subtract these items to the list of treasure to loot
Expand Down

0 comments on commit f031f74

Please sign in to comment.