Skip to content
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

[bigshot] v5.7.3 added cmd tether for 706 wait #1753

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 50 additions & 14 deletions scripts/bigshot.lic
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
contributors: SpiffyJr, Tillmen, Kalros, Hazado, Tysong, Athias, Falicor, Deysh, Nisugi
game: Gemstone
tags: hunting, bigshot, combat
version: 5.7.2
version: 5.7.3
required: Lich >= 5.5.0, infomon >= 1.18.11

Setup Instructions: https://gswiki.play.net/Script_Bigshot
Expand All @@ -17,6 +17,10 @@

Version Control:
Major_change.feature_addition.bugfix
v5.7.3 (2025-01-20)
- added command tether to have spell 706 wait until completion
- update to efury command
- fix for constant redefinition Ruby warnings
v5.7.2 (2025-01-15)
- added implosion(720) cooldown
- added check for voidweaver buff from 720
Expand Down Expand Up @@ -323,9 +327,9 @@ require 'logger'
FileUtils.mkdir_p(File.join($data_dir, XMLData.game, Char.name, "bigshot_profiles"))

# Global Variables
BIGSHOT_VERSION = get_script_version
RALLY_TIME = 1
REST_INTERVAL = 60
$bigshot_version = get_script_version
$bigshot_rally_time = 1
$bigshot_rest_interval = 60
$bigshot_1614_list = []
$bigshot_703_list = []
$bigshot_adrenal_surge = Time.now + 301
Expand Down Expand Up @@ -1030,7 +1034,7 @@ class Bigshot
load_settings
set_tooltips
self['main'].keep_above = true
self['main'].set_title "Big Shot: v#{BIGSHOT_VERSION}"
self['main'].set_title "Big Shot: v#{$bigshot_version}"

# connect signals after settings are loaded to a bunch of handlers don't trigger
connect_signals { |handler| method(handler) }
Expand Down Expand Up @@ -1893,7 +1897,7 @@ class Bigshot
:REMAINING_SKINS, :SKIN, :BUNDLE_SKIN, :GEM, :GEM_NUMBER, :TRACKING_CREATURE, :BOUNTY_EVAL, :CHECK_FAVOR,
:DEBUG_COMBAT, :DEBUG_COMMANDS, :DEBUG_STATUS, :DEBUG_SYSTEM, :DEBUG_FILE, :debug_logger, :LAST_CALLED, :REST_PREP

PRONE = /sleeping|webbed|stunned|kneeling|sitting|^lying|prone|frozen|held in place|entangled/
PRONE ||= /sleeping|webbed|stunned|kneeling|sitting|^lying|prone|frozen|held in place|entangled/
# Changed to gameobj-data.xml detection 4.12.2 update
# No longer needed
# BOON_LIST_ADJECTIVES = /^(?:adroit |afflicted |apt |barbed |belligerent |blurry |canny |combative |dazzling |deft |diseased |drab |dreary |ethereal |flashy |flexile |flickering |flinty |frenzied |ghastly |ghostly |gleaming |glittering |glorious |glowing |grotesque |hardy |illustrious |indistinct |keen |lanky |luminous |lustrous |muculent |nebulous |oozing |pestilent |radiant |raging |ready |resolute |robust |rune-covered |shadowy |shielded |shifting |shimmering |shining |sickly green |sinuous |slimy |sparkling |spindly |spiny |stalwart |steadfast |stout |tattooed |tenebrous |tough |twinkling |unflinching |unyielding |wavering |wispy )/
Expand Down Expand Up @@ -2041,7 +2045,7 @@ class Bigshot
rows << [{ value: "Options can be combined:", colspan: 2, alignment: :left }]
rows << [{ value: " #{$lich_char}#{Script.current.name} debug combat commands status <true/false>", colspan: 2, alignment: :left }]

table = Terminal::Table.new :title => "#{Script.current.name.capitalize} Debug Help v#{BIGSHOT_VERSION}", :rows => rows
table = Terminal::Table.new :title => "#{Script.current.name.capitalize} Debug Help v#{$bigshot_version}", :rows => rows
table.align_column(1, :right)
respond
respond table
Expand All @@ -2050,7 +2054,7 @@ class Bigshot
respond ""
respond "#############################################################################"
respond ""
respond " #{Script.current.name.capitalize} Debug Help v#{BIGSHOT_VERSION}"
respond " #{Script.current.name.capitalize} Debug Help v#{$bigshot_version}"
respond ""
respond " Debug options have changed to be more helpful."
respond "------------------------------------------------------------"
Expand Down Expand Up @@ -2216,7 +2220,7 @@ class Bigshot
stop_script(hs_name) if running?(hs_name)
}
fput("movement autosneak off") if $bigshot_sneaky_hunt
echo "debug active for bigshot version #{BIGSHOT_VERSION}" if $bigshot_debug
echo "debug active for bigshot version #{$bigshot_version}" if $bigshot_debug
}
end

Expand Down Expand Up @@ -2936,6 +2940,8 @@ class Bigshot
cmd_wield($1, $2)
elsif (command =~ /^store\s+(left|right|both)?/i)
cmd_store($1)
elsif (command =~ /^tether/i)
cmd_tether(npc)
else
return if $ambusher_here
return if $obvious_hiding_player
Expand Down Expand Up @@ -4201,18 +4207,21 @@ class Bigshot
return unless GameObj.targets.any? { |s| s.id == npc.id }
return unless Spell[917].known? and Spell[917].affordable?

complete_line = /The (?:floor|ground) beneath .* suddenly calms\./

waitrt?
waitcastrt?
time_out = Time.now + 12
Spell[917].force_incant("#{extra}")
result = Spell[917].force_incant("#{extra}")
return if result =~ complete_line

loop {
line = get?
break if Time.now > time_out
break if should_flee?
break if npc.status =~ /dead|gone/
break unless GameObj.targets.any? { |s| s.id == npc.id }
break if line =~ /The (?:floor|ground) beneath .* suddenly calms\./
break if line =~ complete_line
break if line =~ /The evanescent shield shrouding .* flares to life and absorbs the essence of the spell, dissipating it harmlessly\./
stand unless standing?
sleep(0.01)
Expand Down Expand Up @@ -4619,6 +4628,33 @@ class Bigshot
}
end

def cmd_tether(npc)
debug_msg(@DEBUG_COMMANDS, "cmd_tether | called by #{caller[0]}")

return if npc.status =~ /dead|gone/
return unless GameObj.targets.any? { |s| s.id == npc.id }
return unless Spell[706].known? and Spell[706].affordable?

complete_line = /dissolve into black mist/

waitrt?
waitcastrt?
time_out = Time.now + 12
result = Spell[706].force_incant(nil, /dissolve into black mist\./)
return if result =~ complete_line

loop {
line = get?
break if Time.now > time_out
break if should_flee?
break if npc.status =~ /dead|gone/
break unless GameObj.targets.any? { |s| s.id == npc.id }
break if line =~ complete_line
stand unless standing?
sleep(0.01)
}
end

def group_status_ailments()
debug_msg(@DEBUG_STATUS, "group_status_ailments | called by #{caller[0]}")

Expand Down Expand Up @@ -5355,7 +5391,7 @@ class Bigshot
message("yellow", "#{name} isn't hunting because: #{reason}")
}
_respond
sleep(REST_INTERVAL)
sleep($bigshot_rest_interval)
end

# make sure we get everyone recognized as part of the group
Expand Down Expand Up @@ -6966,7 +7002,7 @@ elsif (Script.current.vars[1] =~ /profile/i)
Bigshot.profile(Script.current.vars)

elsif (Script.current.vars[1] =~ /display/i)
echo "Version: #{BIGSHOT_VERSION}"
echo "Version: #{$bigshot_version}"
UserVars.op.each_pair { |k, v|
echo "#{k}: #{v}" unless v.nil? || v.class.to_s == 'Array' || v.to_s =~ /^\s*$/
}
Expand Down Expand Up @@ -7023,7 +7059,7 @@ elsif (Script.current.vars[1] =~ /head|lead/i)
my_group.set_leader(bs)

# announce/go
(1..RALLY_TIME).each { |_i| fput "whisper ooc group Bigshot rallying at #{uri}"; sleep(1); }
(1..$bigshot_rally_time).each { |_i| fput "whisper ooc group Bigshot rallying at #{uri}"; sleep(1); }
echo "Waiting for members to join Bigshot rally..."

wait_until { (my_group.size() > 1) }
Expand Down
Loading