diff --git a/setupaliases.lic b/setupaliases.lic index 100d589863..e5f0e9d16b 100644 --- a/setupaliases.lic +++ b/setupaliases.lic @@ -2,7 +2,7 @@ Documentation: https://elanthipedia.play.net/Lich_script_repository#setupaliases =end -[ +aliases_to_add = [ # These will list the Ruby and Lich versions ['rubyver', "#{$clean_lich_char}e echo RUBY_VERSION"], ['lichver', "#{$clean_lich_char}e echo LICH_VERSION"], @@ -51,7 +51,6 @@ ['dm', "#{$clean_lich_char}repos download-mapdb"], ['rm', "#{$clean_lich_char}e Map.reload"], - ['map', "#{$clean_lich_char}xnarost"], # List all hunting zones from base-hunting alphabetically by name ['hz', "#{$clean_lich_char}e get_data('hunting').hunting_zones.sort.each{ |x| echo x }"], # List all escort zones from base-hunting alphabetically by name. @@ -60,6 +59,15 @@ ['fz', "#{$clean_lich_char}e get_data('hunting').hunting_zones.find_all { |k, v| k =~ /\\?/i}.each { |zone| respond \"\#\{zone[0]\}: \#\{zone[1].join(', ')\}\" }"], # Calculate your unofficial trader bonus according to elanthipedia ['traderbonus', "#{$clean_lich_char}e x = DRStats.charisma*(DRSkill.getrank('Trading') + DRSkill.getrank('Appraisal')).to_f; echo case x when 0..2100 then (x/210).floor when 2101..8400 then ((x/350)+1).floor when 8401..Float::INFINITY then (((x+444)/2211)+21).floor end"] -].each do |trigger, target| - UpstreamHook.run("#{$clean_lich_char}alias add --global #{trigger} = #{target}") +] + +if Script.exists?('map') + aliases_to_add.push(['map', "#{$clean_lich_char}map"]) +elsif Script.exists?('xnarost') + aliases_to_add.push(['map', "#{$clean_lich_char}xnarost"]) +end + +aliases_to_add.each do |trigger, target| + # UpstreamHook.run("#{$clean_lich_char}alias add --global #{trigger} = #{target}") + Script.run('alias', "add --global #{trigger} = #{target}") end