Skip to content

Commit

Permalink
Merge pull request #6860 from desertkaz/desertkaz-patch-1
Browse files Browse the repository at this point in the history
[script][afk]attempt to resolve justice messaging by releasing any triggers_justice spells active
  • Loading branch information
MahtraDR authored Jul 21, 2024
2 parents 3249c9f + 26e12ef commit 0746384
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions afk.lic
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ register_slackbot(settings.slack_username)
pause 1 while DRStats.health < [health_threshold + 20, 100].min || DRStats.spirit < [health_threshold + 20, 100].min

justice_message_count = 0
spell_check_count = 0

loop do
line = script.gets?
Expand All @@ -51,6 +52,10 @@ loop do
justice_message_count += 1 if line =~ /^"Burn .+! Burn .+!" .* giving you a wide berth/
justice_message_count += 1 if line =~ /authorities will try to bring you in for endangering the public/

if justice_message_count != spell_check_count
DRSpells.active_spells.each { |x, _y| fput("release #{get_data("spells")["spell_data"][x]["abbrev"]} spell") if get_data("spells")["spell_data"][x]["triggers_justice"] }
spell_check_count = justice_message_count
end
if justice_message_count > justice_threshold
exit_game("It looks like you've run into trouble with the law too many times")
end
Expand Down

0 comments on commit 0746384

Please sign in to comment.