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

Syncing repos #6985

Merged
merged 26 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7f071c6
[scripts][dependency] Cleanup backup repo config
MahtraDR Nov 12, 2024
f62b071
Merge pull request #6978 from MahtraDR/dependency_fallback_url
MahtraDR Nov 12, 2024
171bab5
[scripts][dependency] Tweaks and futureproofing
MahtraDR Nov 13, 2024
62e0636
tweak
MahtraDR Nov 13, 2024
fff412c
tweak
MahtraDR Nov 13, 2024
c5b720c
tweak
MahtraDR Nov 13, 2024
a1b5e9a
tweak
MahtraDR Nov 13, 2024
61e4d76
tweak
MahtraDR Nov 13, 2024
3150793
Merge pull request #6979 from MahtraDR/dependency_tweaks
MahtraDR Nov 13, 2024
bb34244
Revert "[scripts][dependency] Tweaks and futureproofing"
MahtraDR Nov 13, 2024
89a2573
Merge pull request #6980 from rpherbig/revert-6979-dependency_tweaks
MahtraDR Nov 13, 2024
8986812
[scripts][dependency} Fixes bad status_url
MahtraDR Nov 13, 2024
5876fe3
forcing
MahtraDR Nov 13, 2024
330ab80
url_escape
MahtraDR Nov 13, 2024
a00a344
tweak
MahtraDR Nov 13, 2024
5e6d1f4
Merge pull request #6981 from MahtraDR/dependency_fix
MahtraDR Nov 13, 2024
0ab9023
[scripts][stack-scrolls] Reconcile local copy
MahtraDR Nov 13, 2024
0564516
Merge pull request #6982 from MahtraDR/stack_scrolls
MahtraDR Nov 13, 2024
58dfe64
[scripts][dependency][bootstrap] More prep for components in core lich
MahtraDR Nov 13, 2024
3505b76
cleanup
MahtraDR Nov 13, 2024
d347a9b
cleanup
MahtraDR Nov 13, 2024
8ebda13
cleanup
MahtraDR Nov 13, 2024
06bb98c
Merge pull request #6983 from MahtraDR/prep_for_core_lich
MahtraDR Nov 13, 2024
156cb7c
[New Script][bard-whistle] Passive loop to train Bardic Lore
MahtraDR Nov 13, 2024
408e042
Adding circle check
MahtraDR Nov 13, 2024
4813aaf
Merge pull request #6984 from MahtraDR/bard_whistle
MahtraDR Nov 13, 2024
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
27 changes: 27 additions & 0 deletions bard-whistle.lic
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
custom_require.call(%w(common drinfomon))

no_kill_all

class Whistle
def initialize
@combat_scripts = ['hunting-buddy', 'combat-trainer']
exit unless DRStats.guild == 'Bard' && DRSkill.getrank('Bardic Lore') < 1750 && DRStats.circle >= 18
passive_loop
end

def do_whistle
return if @combat_scripts.any? { |name| Script.running?(name) }
return unless DRSkill.getxp('Bardic Lore') < 32

fput('WHISTLE PIERCING')
end

def passive_loop
loop do
do_whistle
pause 30
end
end
end

Whistle.new
11 changes: 6 additions & 5 deletions bootstrap.lic
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
Documentation: https://elanthipedia.play.net/Lich_script_development#bootstrap
=end

$BOOTSTRAP_VERSION = '1.0.2'
$BOOTSTRAP_VERSION = '1.0.3'
DRINFOMON_IN_CORE_LICH ||= false
DRINFOMON_CORE_LICH_DEFINES ||= []

class_defs = {
'drinfomon' => :DRINFOMON,
Expand Down Expand Up @@ -54,17 +55,17 @@ $MODERN_LICH = lich_version >= if Regexp.last_match(1)
Gem::Version.new('4.6.49')
end

if args.wipe_constants
if args.wipe_constants && !DRINFOMON_IN_CORE_LICH
class_defs.each_value { |symb| remove_constant(symb) if constant_defined?(symb) }
exit
end

scripts_to_run = args.flex || []
echo scripts_to_run.to_s if UserVars.bootstrap_debug

if scripts_to_run.include?("drinfomon") && DRINFOMON_IN_CORE_LICH
scripts_to_run -= ['drinfomon']
echo("Removing drinfomon from scripts_to_run") if UserVars.bootstrap_debug
if (scripts_to_run & DRINFOMON_CORE_LICH_DEFINES).any?
scripts_to_run -= DRINFOMON_CORE_LICH_DEFINES
echo("Removing core lich defines from scripts_to_run") if UserVars.bootstrap_debug
end

until scripts_to_run.empty?
Expand Down
29 changes: 14 additions & 15 deletions dependency.lic
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ require 'ostruct'
require 'digest/sha1'
require 'monitor'

$DEPENDENCY_VERSION = '1.7.6'
$DEPENDENCY_VERSION = '1.7.10'
$MIN_RUBY_VERSION = '3.2.2'
DRINFOMON_IN_CORE_LICH ||= false
DRINFOMON_CORE_LICH_DEFINES ||= []

no_pause_all
no_kill_all
Expand Down Expand Up @@ -206,7 +207,7 @@ class ScriptManager
@paste_bin_url = 'https://pastebin.com/api/api_post.php'
@firebase_url = 'https://dr-scripts.firebaseio.com/'
@status_repo = Settings['status_repo'] || 'rpherbig/dr-scripts'
@status_branch = Settings['status_branch'] || 'master'
@status_branch = Settings['status_branch'] || 'main'
update_status_url
# Gating setting lich_url on lich version

Expand Down Expand Up @@ -244,14 +245,14 @@ class ScriptManager
def update_status_url
defaulturl = 'https://api.github.com/repos/' + @status_repo + '/git/trees/' + @status_branch
mainurl = 'https://api.github.com/repos/rpherbig/dr-scripts/git/trees/main'
fallbackurl = 'https://api.github.com/repos/rpherbig/dr-scripts/git/trees/master'
eo_drscripts = 'https://api.github.com/repos/elanthia-online/dr-scripts/git/trees/main'

unless url_exist?(defaulturl)
_respond Lich::Messaging.monsterbold("Default URL #{defaulturl} not responding. Using an alternate repo+branch combindation.")
_respond Lich::Messaging.monsterbold("Default URL #{defaulturl} not responding. Using an alternate repo+branch combination.")
_respond Lich::Messaging.monsterbold("Unsetting custom repo settings, if any.")
Settings['status_repo'] = nil if Settings['status_repo']
Settings['status_branch'] = nil if Settings['status_branch']
Settings.save
end

if url_exist?(defaulturl)
Expand All @@ -260,9 +261,6 @@ class ScriptManager
elsif url_exist?(mainurl)
_respond Lich::Messaging.monsterbold("Using alternate Status URL. #{mainurl}")
@status_url = mainurl
elsif url_exist?(fallbackurl)
_respond Lich::Messaging.monsterbold("Using fallback Status URL. #{fallbackurl}")
@status_url = fallbackurl
elsif url_exist?(eo_drscripts)
_respond Lich::Messaging.monsterbold("Using Elanthia Online Status URL. #{eo_drscripts}")
@status_url = eo_drscripts
Expand All @@ -272,7 +270,7 @@ class ScriptManager
end

def url_exist?(url_string)
url = URI.parse(url_string)
url = URI.parse(URI::Parser.new.escape(url_string))
req = Net::HTTP.new(url.host, url.port)
req.use_ssl = (url.scheme == 'https')
path = url.path
Expand All @@ -295,7 +293,7 @@ class ScriptManager

def unset_custom_status
@status_repo = 'rpherbig/dr-scripts'
@status_branch = 'master'
@status_branch = 'main'
update_status_url
end

Expand Down Expand Up @@ -1606,8 +1604,8 @@ def custom_require
script_names = [script_names] unless script_names.is_a?(Array)
respond("CR:starting:#{script_names}") if UserVars.bootstrap_debug
if DRINFOMON_IN_CORE_LICH
echo("DRInfomon in core lich detected. Skipping loading drinfomon.lic") if UserVars.bootstrap_debug
script_names -= ['drinfomon']
echo("DRInfomon in core lich detected. Skipping loading drinfomon and commons") if UserVars.bootstrap_debug
script_names -= DRINFOMON_CORE_LICH_DEFINES
end
bootstrapper = force_start_script('bootstrap', script_names)
pause 0.05
Expand Down Expand Up @@ -1713,7 +1711,7 @@ def stop_autostart(script_names)
end
end

def set_custom_status_repo(repo, branch = 'master')
def set_custom_status_repo(repo, branch = 'main')
$manager.set_custom_status_repo(repo, branch)
end

Expand All @@ -1734,6 +1732,7 @@ def setup_profiles
end

def setup_data
echo("Force checking scripts/data files.")
$manager.setup_data
end

Expand Down Expand Up @@ -1783,7 +1782,7 @@ end

def update_d
echo('Restarting Dependency in 2 seconds...')
force_start_script('bootstrap', ['wipe_constants'])
force_start_script('bootstrap', ['wipe_constants']) unless DRINFOMON_IN_CORE_LICH
before_dying do
sleep 2
force_start_script('dependency')
Expand Down Expand Up @@ -1833,7 +1832,7 @@ end

full_install if install

force_start_script('bootstrap', ['wipe_constants'])
force_start_script('bootstrap', ['wipe_constants']) unless DRINFOMON_IN_CORE_LICH

# Proactively starting DRinfomon as script zero to prevent
# race conditions involving this script which so many other
Expand All @@ -1849,7 +1848,7 @@ end
if DRINFOMON_IN_CORE_LICH
Lich::Util.issue_command("exp all 0", /^Circle: \d+/, /^Rested EXP Stored|Unlock Rested Experience|type: AWAKEN/, quiet: true)
Lich::Util.issue_command("info", /^Name/, /^<output class=""/, quiet: true)
Lich::Util.issue_command("ability", /^You (know the Berserks|recall the spells you have learned from your training)/, /^You (recall that you have 9 training sessions|can use SPELL STANCE [HELP])/, quiet: true)
Lich::Util.issue_command("ability", /^You (know the Berserks|recall the spells you have learned from your training)/, /^You (recall that you have \d+ training sessions|can use SPELL STANCE \[HELP\]|have \d+ available slot)/, quiet: true)
end

$manager.check_base_files
Expand Down
6 changes: 3 additions & 3 deletions stack-scrolls.lic
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ class ScrollStack

DRC.bput("turn #{DRC.get_noun(target['name'])} to #{query}", /^You turn/)

case DRC.bput("pull my #{target['name']}", 'This was the last copy', 'Carefully')
when /This was the last/i
case DRC.bput("pull my #{target['name']}", /This was the last copy/, /Carefully/)
when /This was the last/
target['contents'][slot] = []
when /Carefully/i
when /Carefully/
data = target['contents'][slot]
data[1] = data[1] - 1
end
Expand Down
Loading