diff --git a/avtalia.lic b/avtalia.lic index 39983df011..52de7350f3 100644 --- a/avtalia.lic +++ b/avtalia.lic @@ -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("") + echo('Be sure to open the avtaliaWindow window if not already open.') + else + _respond("") + end + _respond("") + @window_cache = nil + end add_avtalia_flags execute end @@ -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("\r\n") + _respond("#{new_message}\r\n\r\n") + end end end diff --git a/profiles/base.yaml b/profiles/base.yaml index 5ac3c94d69..1e1f6bb07f 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -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