diff --git a/go2.lic b/go2.lic
deleted file mode 100644
index e1668b9687..0000000000
--- a/go2.lic
+++ /dev/null
@@ -1,2100 +0,0 @@
-=begin
-
- attempts to find the shortest route between any two rooms in the game
- requires a map database (;repository download-mapdb)
-
- ;go2 help
-
- author: Tillmen (tillmen@lichproject.org)
- original author: Shaelun
- contributors: Deysh, Doug, Gildaren, Sarvatt, Tysong, Xanlin
- game: any
- tags: core, movement
- version: 2.1.8
- required: Lich >= 5.4.1
-
- changelog:
- 2.1.8 (2024-11-03):
- Ungate hide_room_descriptions and hide_room_titles for DR
- 2.1.7 (2024-09-19):
- Additional stand messaging
- 2.1.6 (2024-09-11)
- Bugfix for use_portal variable when using GUI Needed to be on/off instead of true/false
- 2.1.5 (2024-07-18):
- Additional stand messaging
- 2.1.4 (2024-07-17):
- Additional stand messaging
- 2.1.3 (2024-07-13):
- Additional stand messaging
- 2.1.2 (2024-07-01):
- Fix for urchin usage when mounted
- Add output info if muckled? to know why go2 is paused
- 2.1.1 (2024-06-23):
- Bugfix to custom targets to respect non-arrays
- 2.1.0 (2024-05-02):
- Merge DR go2 code into EO
- Add support for custom target arrays
- UI changes to be game specific
- 2.0.12 (2024-04-22):
- Add initial basic support for usage while mounted
- Change Char.prof to Stats.prof
- 2.0.11 (2024-01-05):
- Fix for version constant and showing properly via setup/help/list output
- Rubocop cleanup
- 2.0.10 (2023-09-21):
- Bugfix for matching change in wealth output.
- 2.0.9 (2023-07-05): Xanlin:
- Fix for permanent urchin guide access. Rubocop cleanup.
- 2.0.8 (2023-03-03): Tysong:
- bugfix for integer comparison to string for Society
- 2.0.7 (2023-03-03): Xanlin:
- navigate out of a playershop even if it's not mapped (GS only)
- 2.0.6 (2023-02-09): Rinualdo
- Added targets list for portmaster, grocer, cobbling and treasuremaster
- 2.0.5 (2022-11-29): Tysong
- Fix for variable name syntax
- 2.0.4 (2022-11-28): Gildaren:
- Add support to "goback" to the room go2 last started in
- 2.0.3 (2022-11-22): Mahtra:
- adjusted DR/GS separattion of features
- Support for yaml-based map timeto and stringproc overrides
- 2.0.2 (2022-10-20): Xanlin:
- adjusted wait before exiting
- 2.0.1 (2022-10-08)
- bug fix for non-Gtk users
- backward compatibility for Lich4
- 2.0 (2022-10-08): Deysh:
- added setup gui
- added color options to help output
-=end
-=begin
- 1.37 (2022-10-07): Xanlin:
- added option to hide room descriptions for travel
- added option to hide room titles for travel
- added option to echo input
- added fallback for check_silvers that uses wealth quiet instead
- wrap in module
- travel time now calculated to a higher precision.
- targets town name now based on location.
- targets won't include towns tagged closed.
- 1.36.0 (2022-06-16):
- fix for urchins runners not recognized as command option
- add sos caravan options.
- 1.35 (2022-05-12):
- exit if get-silvers fails to get enough silver from bank.
- 1.34 (2022-03-31):
- For DR: add support for yaml-based map stringproc overrides
- 1.33 (2022-03-31):
- set UserVars.mapdb_urchins_expire to 0 when expired to fix comparison with nil
- 1.32 (2022-03-31):
- Added setting --use-portmasters for UserVars.mapdb_use_portmasters
- Added setting --use-urchins for UserVars.mapdb_use_urchins
- Added location and uid to output list for multiple matched destinations
- 1.31 (2022-03-10):
- Merged in DR changes from v1.22f by Sarvatt
- 1.30 (2022-03-03):
- Added Util.silver_count to replace check_silvers
- Added support for uid input by prefixing 'u' on a uid number
- 1.29 (2022-02-27):
- Added tags for collectibles
- 1.28 (2022-01-23):
- Added tags for postoffice and mail
- 1.27 (2021-10-29):
- Fix lag check after COMBATANT verb was updated
- 1.26 (2020-10-08):
- Fix silver check broken by Commageddon
- 1.25 (2019-05-11):
- Fix DragonRealms auto drag feature (Sarvatt)
- 1.24 (2019-03-03):
- Updated formatting for ";go2 list" in GSPlat and GSF
- 1.23 (2019-03-03):
- add setting for using GSPlat old portal system
- 1.22 (2019-02-10):
- add settings for using Chronomage day passes
- 1.21 (2017-10-07):
- don't try to stand before swimming movements
- 1.20 (2017-09-17):
- add confluence-hot and confluence-cold targets
- 1.19 (2016-09-24):
- fix DragonRealms auto drag feature some more
- 1.18 (2016-09-24):
- fix DragonRealms auto drag feature somewhat
- 1.17 (2016-09-12):
- change portal settings to be saved using UserVars
- 1.16 (2016-08-19):
- add fwi-trinket setting
- 1.15 (2016-04-01):
- added experimental setting to auto drag in DragonRealms
- 1.14 (2015-07-09):
- change ice mode setting to be saved using UserVars
- 1.13 (2015-07-09):
- don't search for the confluence if you're already there
- 1.12 (2015-07-08):
- don't do a GS lag check in DR
- 1.11 (2015-04-13):
- add --instability option
- fix going to a specific room inside the confluence from outside
- 1.10 (2015-04-13):
- add confluence and instability targets
- 1.9 (2015-02-08):
- stop using Map.tags
- 1.8 (2015-01-16):
- fix ";go2 save" bug
- 1.7 (2014-12-11):
- added stop-for-dead to the help message
- 1.6 (2014-12-10):
- added stop-for-dead option
- add settings to list command
- 1.5 (2014-12-04):
- remove a debug message
- 1.4 (2014-12-04):
- added delay setting
- fixed bug with finding silver cost of a path
- 1.3 (2014-11-09):
- changed typeahead setting to be different for each character
- 1.2 (2014-10-16):
- don't use typeaheads for first move: makes it easier to find problems
- 1.1 (2014-10-07):
- only automatically reduce typeahead setting if there's a typeahead message in the buffer
-
-=end
-
-# fixme: don't do puzzles option
-
-module Go2
- @@data ||= nil
- @@mounted = false
-
- def self.mounted
- @@mounted
- end
-
- def self.mounted=(value)
- @@mounted = value
- end
-
- def self.get_script_version
- data = Script.list.find { |x| x.name == 'go2' }.inspect
- return data[/version: (\d+\.\d+\.\d+)/i, 1]
- end
-
- def self.data
- @@data
- end
-
- def self.color(color, msg)
- if defined?(Lich::Messaging)
- Lich::Messaging.msg_format(color, msg)
- else
- msg
- end
- end
-
- def self.wealth_quiet();
- wealth_pattern = /^You have (no|[,\d]+|but one) silver with you/;
- wealth = dothistimeout 'wealth quiet', 3, wealth_pattern;
- coins = 0;
- if wealth.gsub('but one', '1') =~ wealth_pattern;
- coins = $1.gsub(',', '').to_i;
- end;
- return coins;
- end;
-
- def self.go2_check_silver;
- if LICH_VERSION.split('.')[0].to_i < 5 or !defined?(Lich::Util.silver_count)
- return self.wealth_quiet
- else
- return Lich::Util.silver_count
- end
- end
-
- def self.load_go2_settings()
- if UserVars.mapdb_buy_day_pass == true
- buy_pass = "on"
- elsif UserVars.mapdb_buy_day_pass == false
- buy_pass = "off"
- else
- buy_pass = UserVars.mapdb_buy_day_pass
- end
-
- use_portals = UserVars.mapdb_use_portals == 'yes' ? true : false
-
- settings_hash = {
- :mapdb_car_to_sos => UserVars.mapdb_car_to_sos,
- :mapdb_car_from_sos => UserVars.mapdb_car_from_sos,
- :mapdb_use_portals => use_portals,
- :mapdb_use_old_portals => UserVars.mapdb_use_old_portals,
- :mapdb_use_urchins => UserVars.mapdb_use_urchins,
- :mapdb_use_portmasters => UserVars.mapdb_use_portmasters,
- :mapdb_use_day_pass => UserVars.mapdb_use_day_pass,
- :mapdb_buy_day_pass => buy_pass,
- :mapdb_day_pass_sack => UserVars.day_pass_sack,
- :mapdb_ice_mode => UserVars.mapdb_ice_mode,
- :mapdb_fwi_trinket => UserVars.mapdb_fwi_trinket,
- :rogue_password => UserVars.rogue_password,
- :delay => CharSettings['delay'],
- :typeahead => CharSettings['typeahead'],
- :stop_for_dead => CharSettings['stop for dead'],
- :get_silvers => CharSettings['get silvers'],
- :get_return_silvers => CharSettings['get return trip silvers'],
- :use_vaalor_shortcut => CharSettings['vaalor shortcut'],
- :use_seeking => CharSettings['use seeking'],
- :echo_input => CharSettings['echo_input'],
- :hide_room_desc => CharSettings['hide_room_descriptions'],
- :hide_room_titles => CharSettings['hide_room_titles'],
- }
- settings_hash
- end
-
- def self.load(settings)
- @@data = settings
- end
-
- def self.save_go2_settings(settings)
- UserVars.mapdb_car_to_sos = settings[:mapdb_car_to_sos]
- UserVars.mapdb_car_from_sos = settings[:mapdb_car_from_sos]
- UserVars.mapdb_use_old_portals = settings[:mapdb_use_old_portals]
- UserVars.mapdb_use_urchins = settings[:mapdb_use_urchins]
- UserVars.mapdb_use_portmasters = settings[:mapdb_use_portmasters]
- UserVars.mapdb_use_day_pass = settings[:mapdb_use_day_pass]
- UserVars.day_pass_sack = settings[:mapdb_day_pass_sack]
- UserVars.mapdb_ice_mode = settings[:mapdb_ice_mode]
-
- UserVars.mapdb_use_portals = settings[:mapdb_use_portals] ? 'yes' : 'no'
-
- if settings[:mapdb_buy_day_pass].empty? || settings[:mapdb_buy_day_pass] =~ /off|no|false/
- UserVars.mapdb_buy_day_pass = nil
- elsif settings[:mapdb_buy_day_pass] =~ /on|true|yes/
- UserVars.mapdb_buy_day_pass = true
- else
- settings[:mapdb_buy_day_pass].split(';').each { |location|
- if location !~ /^\s*(?:wl,imt|imt,wl|wl,sol|sol,wl|imt,sol|ill,val|val,ill|ill,cys|cys,ill|val,cys|cys,val)\s*$/i
- echo "warning: Location #{location} is invalid. Using it anyway."
- end
- }
-
- UserVars.mapdb_buy_day_pass = settings[:mapdb_buy_day_pass]
- end
-
- if settings[:mapdb_fwi_trinket].empty? || UserVars.mapdb_fwi_trinket =~ /^off$/i
- UserVars.mapdb_fwi_trinket = nil
- else
- UserVars.mapdb_fwi_trinket = settings[:mapdb_fwi_trinket]
- end
-
- UserVars.rogue_password = settings[:rogue_password]
- CharSettings['delay'] = settings[:delay]
- CharSettings['typeahead'] = settings[:typeahead]
- CharSettings['stop for dead'] = settings[:stop_for_dead]
- CharSettings['get silvers'] = settings[:get_silvers]
- CharSettings['get return trip silvers'] = settings[:get_return_silvers]
- CharSettings['vaalor shortcut'] = settings[:use_vaalor_shortcut]
- CharSettings['use seeking'] = settings[:use_seeking]
- CharSettings['echo_input'] = settings[:echo_input]
- CharSettings['hide_room_descriptions'] = settings[:hide_room_desc]
- CharSettings['hide_room_titles'] = settings[:hide_room_titles]
- end
-
- if defined?(Gtk)
- # Setup is an extension of Gtk::Builder for Gtk setup
- class Setup < Gtk::Builder
- attr_accessor :settings
-
- @@categories = {
- general: {
- mapdb_car_to_sos: { default: false },
- mapdb_car_from_sos: { default: false },
- mapdb_ice_mode: { default: false },
- mapdb_use_urchins: { default: false },
- mapdb_use_portmasters: { default: false },
- mapdb_use_day_pass: { default: false },
- mapdb_buy_day_pass: { default: '' },
- mapdb_day_pass_sack: { default: '' },
- mapdb_fwi_trinket: { default: '' },
- mapdb_use_portals: { default: false },
- mapdb_use_old_portals: { default: false },
- typeahead: { default: 0 },
- delay: { default: 0 },
- use_vaalor_shortcut: { default: false },
- get_silvers: { default: false },
- get_return_silvers: { default: false },
- hide_room_desc: { default: false },
- hide_room_titles: { default: false },
- echo_input: { default: true },
- use_seeking: { default: false },
- stop_for_dead: { default: false },
- rogue_password: { default: '' },
- }
- }
-
- def self.get_category(key)
- @@categories.each { |category, data| return category unless data[key].nil? }
- nil
- end
-
- def self.get_setting(key)
- cat = Setup.get_category(key)
- return nil if cat.nil?
- @@categories[cat].each { |setting, data| return data if setting == key }
- nil
- end
-
- def initialize(settings)
- super()
- @settings = settings
- # set default values if they don't exist
- @@categories.each do |_, data|
- data.each { |key, value| @settings[key] = value[:default] if @settings[key].nil? }
- end
- # remove settings that doesn't exist
- @settings.delete_if { |key, _| next Setup.get_category(key).nil? }
- # use a GTK Builder to setup all the basics of the window then expand on that base
- return unless defined?(Gtk) && Gtk::Version::MAJOR == 3
- Gtk.queue do
- # add_from_file("#{$data_dir}go2.ui")
- add_from_string(Setup.go2_ui)
- load_settings
- self['main'].keep_above = true
- self['main'].set_title "Go2 Setup v#{Go2.get_script_version}"
- # connect signals after settings are loaded to a bunch of handlers don't trigger
- connect_signals { |handler| method(handler) }
- end
- end
-
- def self.go2_ui
- ''
- end
-
- # This is connected to automatically during load_settings and syncs data back to CharSettings.
- def on_update(obj)
- Gtk.queue do
- key = obj.builder_name.to_sym
- setting = Setup.get_setting(key)
- return if setting.nil?
-
- if obj.class == Gtk::CheckButton
- @settings[key] = obj.active?
- elsif obj.class == Gtk::Entry
- @settings[key] = obj.text.strip
- elsif obj.class == Gtk::SpinButton
- # update from text entry
- obj.update
- # force int, we don't use floats anywhere
- @settings[key] = obj.adjustment.value.to_i
- elsif obj.class == Gtk::ComboBoxText
- @settings[key] = obj.active_text
- end
- end
- end
-
- def on_close_clicked
- Go2.load(@settings)
- self['main'].destroy
- end
-
- def on_destroy
- Gtk.queue {
- Go2.load(@settings)
- @running = false
- }
- end
-
- # iterate all objects and for any that match a setting name directly we set the default
- def load_settings
- Gtk.queue do
- # load up the generic settings which are just matching by name of the widget
- objects.each do |obj|
- next unless obj.methods.include?(:builder_name)
-
- key = obj.builder_name.to_sym
- next if (setting = Setup.get_setting(key)).nil?
-
- # set the default value
- obj.set_sensitive(false) if (obj.builder_name.to_s.eql?("mapdb_use_portals")) && XMLData.game !~ /^GSPlat|^GSF/
- obj.set_sensitive(false) if (obj.builder_name.to_s.eql?("mapdb_use_old_portals")) && XMLData.game !~ /^GSPlat/
- obj.set_sensitive(false) if (obj.builder_name.to_s.eql?("rogue_password")) && Stats.prof != "Rogue"
- obj.set_sensitive(false) if (obj.builder_name.to_s.eql?("use_seeking")) && Society.member !~ /Order of Voln/ && Society.rank.eql?(26)
-
- if obj.class == Gtk::CheckButton
- obj.active = @settings[key]
- obj.signal_connect('toggled') { on_update(obj) }
- elsif obj.class == Gtk::Entry
- obj.text = @settings[key].strip
- obj.signal_connect('changed') { on_update(obj) }
- elsif obj.class == Gtk::SpinButton
- obj.value = @settings[key]
- obj.adjustment.value = @settings[key]
- obj.signal_connect('changed') { on_update(obj) }
- elsif obj.class == Gtk::ComboBoxText
- # Fixme: change to builder_name
- if @settings[key] == "Auto"
- item = 0
- elsif @settings[key] == "On"
- item = 1
- elsif @settings[key] == "Off"
- item = 2
- elsif @settings[key] == "1"
- item = 0
- elsif @settings[key] == "2"
- item = 1
- end
-
- obj.set_active(item) if item
- obj.signal_connect('changed') { on_update(obj) }
- elsif obj.class == Gtk::TreeView
- if (store = self["#{key}_store"]).nil?
- respond "** failed to find store for treeview #{key}"
- next
- elsif setting[:load].nil?
- respond "** no :load defined #{key}"
- next
- end
-
- setting[:load].call(store, @settings[key])
-
- # setup the signals
- if (add = self["#{key}_add"]).nil?
- respond "** failed to find add for treeview #{key}"
- next
- elsif (delete = self["#{key}_delete"]).nil?
- respond "** failed to find delete for treeview #{key}"
- next
- elsif (entry = self["#{key}_entry"]).nil?
- respond "** failed to find entry for treeview #{key}"
- next
- end
-
- add.signal_connect('clicked') do
- if setting[:set].nil?
- respond "** no :set defined for #{key}"
- next
- elsif entry.text.empty?
- next
- end
- setting[:set].call(store, entry.text, @settings[key])
- setting[:load].call(store, @settings[key])
- end
-
- delete.signal_connect('clicked') do
- if setting[:delete].nil?
- respond "** no :delete defined for #{key}"
- next
- elsif (selected = obj.selection.selected).nil?
- next
- end
- setting[:delete].call(store, selected, @settings[key])
- setting[:load].call(store, @settings[key])
- end
- end
- end
-
- # checkboxes for array storage with id's :
- # this is primarily used by the loot types
- objects.each do |obj|
- next unless obj.methods.include?(:builder_name)
- next unless obj.builder_name =~ /^([^:]+):(.*)$/i
- next unless obj.class == Gtk::CheckButton
-
- key = Regexp.last_match(1).to_sym
- value = Regexp.last_match(2).to_s
- # echo "key: #{key} value: #{value}"
- next if Setup.get_setting(key).nil?
- # echo @settings[key].include?(value)
- obj.active = @settings[key].include?(value)
-
- # add in hook
- obj.signal_connect('toggled') do
- @settings[key].delete(value)
- if obj.active?
- @settings[key].push(value)
- @settings[key].uniq!.sort!
- end
- end
- end
- end
- end
-
- def start
- @running = true
- Gtk.queue {
- main_width = XMLData.game =~ /^GS/ ? 840 : 450
- main_height = XMLData.game =~ /^GS/ ? 550 : 350
- self['main'].set_default_size(main_width, main_height)
-
- self['main'].show_all
-
- if XMLData.game =~ /^DR/
- # Hide non-DR elements if needed
- hide_elements = [
- 'portals_passes_frame',
- 'get_silvers',
- 'get_return_silvers',
- 'mapdb_car_to_sos',
- 'mapdb_car_from_sos',
- 'mapdb_use_urchins',
- 'mapdb_use_portmasters',
- 'use_seeking',
- 'stop_for_dead',
- 'use_vaalor_shortcut',
- 'ice_mode_label',
- 'mapdb_ice_mode',
- 'rogue_password_label',
- 'rogue_password'
- ]
-
- hide_elements.each { |element| self[element].hide() }
-
- # Reposition remaining items
- # Have to remove elements before repositioning
- self['misc_grid'].remove(self['hide_room_desc'])
- self['misc_grid'].remove(self['hide_room_titles'])
- self['misc_grid'].remove(self['echo_input'])
-
- # Now reattach and reposition
- self['misc_grid'].attach(self['hide_room_desc'], 0, 0, 1, 1)
- self['hide_room_desc'].set_margin_top(5)
- self['hide_room_desc'].set_margin_right(30)
-
- self['misc_grid'].attach(self['hide_room_titles'], 0, 1, 1, 1)
-
- self['misc_grid'].attach(self['echo_input'], 0, 2, 1, 1)
- end
- }
-
- wait_while { @running }
- end
-
- def list(cat_to_list: 'all')
- indent_size = 2
- print_array =
- proc do |key, value, indent|
- _respond("#{' ' * indent_size * indent.to_i}#{key}:")
- value.sort!.each { |entry| _respond("#{' ' * indent_size * (indent.to_i + 1)}#{value.index(entry) + 1}. #{entry}") }
- end
-
- print_value = proc { |key, value, indent| _respond("#{' ' * indent_size * indent.to_i}#{key}: #{value}") }
-
- categories = cat_to_list == 'all' ? %w[general internal] : [cat_to_list]
- if $frontend == 'stormfront'
- output = "