-
Notifications
You must be signed in to change notification settings - Fork 56
feat(go2.lic): v2.3.0 add unhide option #1977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mrhoribu
wants to merge
7
commits into
master
Choose a base branch
from
feat/go2-v2.3.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ccf49b7
feat(go2.lic): v2.3.0 add unhide option
mrhoribu 1cb2ace
Update scripts/go2.lic
mrhoribu ee31ec8
fix: change class checks to is_a? checks
mrhoribu 7ab74be
Merge branch 'master' into feat/go2-v2.3.0
mrhoribu 68d0446
Merge branch 'master' into feat/go2-v2.3.0
mrhoribu e031334
Merge branch 'master' into feat/go2-v2.3.0
mrhoribu 90f4072
fix: rubocop layout alignment
mrhoribu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,13 @@ | |
| contributors: Deysh, Doug, Gildaren, Sarvatt, Tysong, Xanlin, Dissonance | ||
| game: any | ||
| tags: core, movement | ||
| version: 2.2.13 | ||
| version: 2.3.0 | ||
| required: Lich >= 5.4.1 | ||
|
|
||
| changelog: | ||
| 2.3.0 (2025-11-26) | ||
| Add "unhide" option, when true unhides when hidden. when false(default) and hidden, sets typeahead to 0 | ||
| Change class checks to is_a? checks | ||
| 2.2.13 (2025-11-22) | ||
| Added support for ;go2 locker taking to public locker or CHE locker as applicable, if Lich version is 5.12.2 or later | ||
| Added support for ;go2 guild or ;go2 guild shop to automatically look for the calling character's profession and go to the appropriate guild or guild shop. | ||
|
|
@@ -390,6 +393,7 @@ module Go2 | |
| :rogue_password => UserVars.rogue_password, | ||
| :delay => CharSettings['delay'], | ||
| :typeahead => CharSettings['typeahead'], | ||
| :unhide => CharSettings['unhide'], | ||
| :stop_for_dead => CharSettings['stop for dead'], | ||
| :get_silvers => CharSettings['get silvers'], | ||
| :get_return_silvers => CharSettings['get return trip silvers'], | ||
|
|
@@ -443,6 +447,7 @@ module Go2 | |
| UserVars.rogue_password = settings[:rogue_password] | ||
| CharSettings['delay'] = settings[:delay] | ||
| CharSettings['typeahead'] = settings[:typeahead] | ||
| CharSettings['unhide'] = settings[:unhide] | ||
| CharSettings['stop for dead'] = settings[:stop_for_dead] | ||
| CharSettings['get silvers'] = settings[:get_silvers] | ||
| CharSettings['get return trip silvers'] = settings[:get_return_silvers] | ||
|
|
@@ -783,7 +788,7 @@ module Go2 | |
| _respond("#{monsterbold_start}= #{opt.capitalize} =#{monsterbold_end}\n") | ||
| @@categories[opt.to_sym].each do |id, _| | ||
| value = @settings[id] | ||
| value.class == Array ? print_array.call(id, value, 1) : print_value.call(id, value, 1) | ||
| value.is_a?(Array) ? print_array.call(id, value, 1) : print_value.call(id, value, 1) | ||
| end | ||
| end | ||
| if $frontend == 'stormfront' | ||
|
|
@@ -805,7 +810,7 @@ module Go2 | |
| if value == 'reset' | ||
| @settings.delete(key) | ||
| echo " Reset #{key}" | ||
| elsif @settings[key].class == Array | ||
| elsif @settings[key].is_a?(Array) | ||
| if value =~ /\d/ && @settings[key][value.to_i] | ||
| @settings[key].delete_at(value.to_i) | ||
| else | ||
|
|
@@ -821,9 +826,9 @@ module Go2 | |
|
|
||
| echo " #{key.inspect} is now #{@settings[key].join(', ').inspect}" | ||
| else | ||
| if @settings[key].class == FalseClass || @settings[key].class == TrueClass | ||
| if @settings[key].is_a?(FalseClass) || @settings[key].is_a?(TrueClass) | ||
| value = value =~ /^true|1|yes|on/ ? true : false | ||
| elsif @settings[key].class == Integer | ||
| elsif @settings[key].is_a?(Integer) | ||
| value = value.to_i | ||
| end | ||
|
|
||
|
|
@@ -849,6 +854,7 @@ module Go2 | |
| end | ||
| CharSettings['typeahead'] = 0 if CharSettings['typeahead'].nil? | ||
| CharSettings['delay'] = 0 if CharSettings['delay'].nil? | ||
| CharSettings['unhide'] = false if CharSettings['unhide'].nil? | ||
| CharSettings['hide_room_descriptions'] = false if CharSettings['hide_room_descriptions'].nil? | ||
| CharSettings['hide_room_titles'] = false if CharSettings['hide_room_titles'].nil? | ||
| CharSettings['echo_input'] = true if CharSettings['echo_input'].nil? | ||
|
|
@@ -870,6 +876,7 @@ module Go2 | |
| output << "" | ||
| output << " options:" | ||
| output << " --typeahead=<#> Sets the number of typeahead lines to use." | ||
| output << " --unhide=<on|off> Unhides if hidden to prevent movement issues" | ||
| output << " --delay=<#> Sets the delay in seconds between movements" | ||
| output << " (disables typeahead)." | ||
| output << " --echo_input=<on|off> When 'on', echos the script input from when the script was called" | ||
|
|
@@ -935,7 +942,7 @@ module Go2 | |
| } | ||
|
|
||
| change_map_vaalor_shortcut = proc { |use_shortcut| | ||
| unless Map.list.any? { |room| room.timeto.any? { |_adj_id, time| time.class == Proc and time._dump =~ /$go2_use_vaalor_shortcut/ } } | ||
| unless Map.list.any? { |room| room.timeto.any? { |_adj_id, time| time.is_a?(StringProc) and time._dump =~ /$go2_use_vaalor_shortcut/ } } | ||
| if use_shortcut | ||
| Room[16745].timeto['16746'] = 15 | ||
| Room[16746].timeto['16745'] = 15 | ||
|
|
@@ -1031,7 +1038,7 @@ module Go2 | |
| output << " - Known Nexus Rooms" | ||
| output << "---------------------------------------------------------------" | ||
| Map.list.find_all { |iroom| iroom.tags.include?('nexus') } | ||
| .each { |iroom| output << "#{iroom.title.first.sub(/^\[/, '').sub(/\]$/, '').ljust(45)} - #{iroom.id.to_s.rjust(5)}" } | ||
| .each { |iroom| output << "#{iroom.title.first.sub(/^\[/, '').sub(/\]$/, '').ljust(45)} - #{iroom.id.to_s.rjust(5)}" } | ||
| end | ||
| respond output | ||
| exit | ||
|
|
@@ -1044,6 +1051,7 @@ module Go2 | |
| output << " (not used because delay > 0)" | ||
| end | ||
| output << "" | ||
| output << " unhide: #{CharSettings['unhide']}" | ||
| output << " delay: #{CharSettings['delay']}" | ||
| output << " echo input: #{CharSettings['echo_input'] ? 'on' : 'off'}" | ||
| output << "hide room descriptions: #{CharSettings['hide_room_descriptions'] ? 'on' : 'off'}" | ||
|
|
@@ -1172,6 +1180,7 @@ module Go2 | |
|
|
||
| target_search_array = Array.new | ||
| setting_typeahead = nil | ||
| setting_unhide = nil | ||
| setting_delay = nil | ||
| setting_disable_confirm = false | ||
| setting_use_vaalor_shortcut = nil | ||
|
|
@@ -1202,6 +1211,8 @@ module Go2 | |
| for var in Script.current.vars[1..-1] | ||
| if var =~ /^(?:\-\-)?typeahead=([0-9]+)$/i | ||
| setting_typeahead = $1.to_i | ||
| elsif (var =~ /^(?:\-\-)?unhide=(on|true|yes|off|false|no)$/i) | ||
| setting_unhide = setting_value[$1.downcase] | ||
| elsif var =~ /^(?:\-\-)?delay=([0-9\.]+)$/i | ||
| setting_delay = $1.to_f | ||
| elsif var =~ /^\-\-instability=([0-9]+)$/i | ||
|
|
@@ -1281,6 +1292,10 @@ module Go2 | |
| CharSettings['delay'] = setting_delay | ||
| echo "delay setting changed to #{setting_delay} seconds" | ||
| end | ||
| unless setting_unhide.nil? | ||
| CharSettings['unhide'] = setting_unhide | ||
| echo "go2 #{(setting_unhide ? 'will' : 'will not')} unhide if hidden to prevent movement issues" | ||
| end | ||
| unless setting_typeahead.nil? | ||
| CharSettings['typeahead'] = setting_typeahead | ||
| echo "typeahead setting changed to #{setting_typeahead}" | ||
|
|
@@ -1760,9 +1775,9 @@ module Go2 | |
| end | ||
| if Room.current.wayto.keys.include?(next_id.to_s) | ||
| way = Room.current.wayto[next_id.to_s] | ||
| if way.class == Proc | ||
| if way.is_a?(StringProc) | ||
| way.call | ||
| elsif way.class == String | ||
| elsif way.is_a?(String) | ||
| move way | ||
| else | ||
| echo "error: map database movement is neither a Proc or a String" | ||
|
|
@@ -2124,6 +2139,11 @@ module Go2 | |
|
|
||
| # Store start room for future use | ||
| UserVars.go2_start_room = start_room.id | ||
| if setting_unhide.is_a?(TrueClass) && checkhidden | ||
| fput("unhide") | ||
| elsif setting_unhide.is_a?(FalseClass) && checkhidden | ||
| setting_typeahead = 0 | ||
| end | ||
|
Comment on lines
+2142
to
+2146
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Saved At Line 2142, behavior depends on 💡 Proposed fix@@
if setting_delay.nil?
setting_delay = CharSettings['delay']
end
+
+ if setting_unhide.nil?
+ setting_unhide = CharSettings['unhide']
+ end
@@
- if setting_unhide.is_a?(TrueClass) && checkhidden
- fput("unhide")
- elsif setting_unhide.is_a?(FalseClass) && checkhidden
- setting_typeahead = 0
- end
+ if checkhidden
+ if setting_unhide
+ fput('unhide')
+ else
+ setting_typeahead = 0
+ end
+ end🤖 Prompt for AI Agents |
||
|
|
||
| loop { | ||
| moves_sent = $room_count | ||
|
|
@@ -2335,7 +2355,7 @@ module Go2 | |
| end | ||
| waitrt? | ||
|
|
||
| if room.wayto[next_id].class == Proc | ||
| if room.wayto[next_id].is_a?(StringProc) | ||
| if setting_drag | ||
| echo "error: drag feature can't deal with StringProc movements yet" | ||
| exit | ||
|
|
@@ -2352,7 +2372,7 @@ module Go2 | |
| break if GameObj.pcs.any? { |pc| pc.status =~ /dead/ } | ||
| idx -= 1 | ||
| break unless (way = Room.current.wayto[path[idx].to_s]) | ||
| if way.class == Proc | ||
| if way.is_a?(StringProc) | ||
| way.call | ||
| else | ||
| move way | ||
|
|
@@ -2402,7 +2422,7 @@ module Go2 | |
| break if GameObj.pcs.any? { |pc| pc.status =~ /dead/ } | ||
| idx -= 1 | ||
| break unless (way = Room.current.wayto[path[idx].to_s]) | ||
| if way.class == Proc | ||
| if way.is_a?(StringProc) | ||
| way.call | ||
| else | ||
| move way | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setupflow can clearunhideby savingnil.load_go2_settingsnow includes:unhide, butSetupprunes keys that are not declared in@@categories. Sinceunhideis not declared there,settings[:unhide]can be missing and Line 450 writesnilback toCharSettings['unhide'].💡 Proposed fix
@@ @@categories = { general: { @@ typeahead: { default: 0 }, + unhide: { default: false }, delay: { default: 0 }, @@ - CharSettings['unhide'] = settings[:unhide] + CharSettings['unhide'] = settings.fetch(:unhide, CharSettings['unhide'])Also applies to: 450-450
🤖 Prompt for AI Agents