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

[scripts][taskmaster] fputs -> bputs. Add crafting room #6968

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
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
70 changes: 58 additions & 12 deletions profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ healing_plant_adjectives:
- vela'tohr
- swaying

healing_plant_nouns:
healing_plant_nouns:
- briar
- bush
- plant
Expand Down Expand Up @@ -942,13 +942,13 @@ enchanting_tools:
# setup custom toolsets to get from clerk-tools. example of format listed below
custom_clerk_tools:
# mining: # name of the toolset to use custom=mining in this case
# :area: blacksmithing # which local society to pick these up from
# :area: blacksmithing # which local society to pick these up from
# :tool_list: # list of the tools in this toolset
# - slender pickaxe
# - tapered shovel
# repair: # ***IF*** the society lets you pick up all tools you could create a single repair list to pickup before/dropoff after running repair
# :area: blacksmithing
# :tool_list:
# :tool_list:
# - bellow
# - diagonal-peen hammer
# - slender pickaxe
Expand Down Expand Up @@ -2237,7 +2237,7 @@ inventory_manager_ignores:
- 'in the known realms'
- 'A notation at'
- '...You have nothing currently stored'

inventory_manager_vault_surfaces:
- 'a brass hook'
- 'a steel wire rack'
Expand Down Expand Up @@ -2567,12 +2567,12 @@ moonwatch_correct: false
# generally releasing cyclics
cyclic_no_release:

# Set a cyclic spell to segue to instead of releasing a cyclic when combat-trainer ends.
# Bard only setting. Must know how to segue.
# Strongly recommended to use a justice safe spell. Works best when the chosen spell is also in cyclic_no_release:
# Set a cyclic spell to segue to instead of releasing a cyclic when combat-trainer ends.
# Bard only setting. Must know how to segue.
# Strongly recommended to use a justice safe spell. Works best when the chosen spell is also in cyclic_no_release:
# Use the cyclic spell abbrevation. E.g. botf. The segue command's parser doesn't like full spell names.
segue_spell_on_stop:
segue_prep_on_stop:
segue_spell_on_stop:
segue_prep_on_stop:

# The number of seconds the `skill-recorder` script waits
# between checking your guild, skills, and spells to know
Expand Down Expand Up @@ -2617,6 +2617,52 @@ base_wayto_overrides:
end_room: 13603
str_proc: start_script('bescort', ['coffin']); wait_while{running?('bescort')};

# Setting for taskmaster - Lists item to be kept by the script.
task_keep_list:
- agonite
- animite
- audrualm
- blackened-bone
- bloodwood
- cloth
- coralite
- corrugated-hide
- crystal bone
- damite
- demonscale
- diamond-hide
- diamondique
- diamondwood
- felstone
- fey-bone
- greenheart
- haledroth
- haralun
- icesteel
- indurium
- kadepa
- kertig
- kiralan
- loimic
- mammoth-hide
- mistwood
- morgawr-scale
- niello
- orichalcum
- puffy-white
- punka-hide
- quelium
- rockwood
- senci
- shadowleaf
- silversteel
- silverwood
- sprite-bone
- telothian
- tomiek
- tyrium
- vardite

# Settings for task-forage (completing foraging tasks for Mags and similar NPCs, primarily for Trading experience)
task_forage_settings:
# Where foraged items should be temporarily stored
Expand Down Expand Up @@ -2657,7 +2703,7 @@ tome_settings:
debug: false

# script-watch.lic settings:
# display scripts hidden by hide_me (if false, only scripts listed by `;list` will be shown)
# display scripts hidden by hide_me (if false, only scripts listed by `;list` will be shown)
# if true all scripts in `;listall` will be shown, except for those listed in in `script_watch_ignored_scripts``
script_watch_display_hidden: false
# show script arguments after the script name
Expand All @@ -2676,12 +2722,12 @@ script_watch_ignored_scripts:
- textsubs
# lower number means faster updates, but could have performance impact
script_watch_cycle_time: 5
# All the next settings control output format in the window:
# All the next settings control output format in the window:
# They also need to be properly escaped XML/strings
# the default settings would result in output that looks similar to this:
# [afk] | [jail-buddy] | [t2] | [burgle] - <start>, <lockpick>, <drop> | [go2] - <1234>
# What the name of the script should be surounded by, and what should be between scripts
script_watch_script_prefix: "["
script_watch_script_prefix: "["
script_watch_script_postfix: "]"
script_watch_script_separator: " | "
# if arguments are turned on, what should separate the script name and the argument list
Expand Down
34 changes: 24 additions & 10 deletions taskmaster.lic
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
task_self_repair: true/false # use own brush and oil for repairs
task_get_tools_on_completion: true/false # If you want taskmaster to pickup any remaining tools in the repair shop. Useful if you're using clerk-tools after each task
task_use_boost: true/false # use boost to eliminate task cooldowns, useful if you have a few and you're doing a lot of tasks
task_keep_list: list of items to keep. See default in base.yaml
task_crafting_room: <room number> # Room to craft in. Ensure it meets specifications for tooling required...
crafting_items_in_container: ['oil', 'glue'] # list of items you might have duplicates of in other bags, but which you only want drawn from crafting bag
crafting_container: bagname
## Important: set default stow to the same bag as your crafting bag ##
Expand All @@ -15,9 +17,10 @@ custom_require.call(%w[common common-items common-money common-travel common-cra
class TaskMaster
def initialize
@settings = get_settings
@keeplist = ['blackened-bone', 'fey-bone', 'sprite-bone', 'crystal bone', 'cloth', 'puffy-white', 'punka-hide', 'diamond-hide', 'shadowleaf', 'morgawr-scale', 'mammoth-hide', 'corrugated-hide', 'demonscale', 'tyrium', 'agonite', 'animite', 'damite', 'haralun', 'icesteel', 'indurium', 'quelium', 'vardite', 'coralite', 'telothian', 'silversteel', 'niello', 'loimic', 'tomiek', 'kiralan', 'kertig', 'kadepa', 'haledroth', 'orichalcum', 'audrualm', 'diamondique', 'senci', 'felstone', 'diamondwood', 'greenheart', 'bloodwood', 'mistwood', 'silverwood', 'rockwood']
@keeplist = @settings.task_keep_list
@rooms = [16_145, 16_146, 16_148, 16_150, 16_153, 16_154, 16_147, 16_276, 16_277, 16_278, 16_290, 16_291, 16_292, 16_293, 16_295, 16_296, 16_294, 16_159, 16_161, 16_166, 16_169]
tools = { 'poltu' => ['forging hammer', 'bellows', 'tongs', 'stirring rod', 'shovel'], 'bradyn' => ['bone saw', 'chisels', 'wood shaper', 'rasp', 'carving knife', 'drawknife', 'forging hammer', 'bellows', 'tongs', 'stirring rod', 'shovel'], 'zasele' => ['knitting needles', 'sewing needles', 'awl', 'slickstone', 'yardstick', 'scissors'], 'shaping' => ['wood shaper', 'rasp', 'carving knife', 'drawknife'] }
@keeplist_regex = Regexp.union(@keeplist)
@bag = @settings.crafting_container
@worn_trashcan = @settings.worn_trashcan
@worn_trashcan_verb = @settings.worn_trashcan_verb
Expand All @@ -30,6 +33,9 @@ class TaskMaster
@self_repair = @settings.task_self_repair
@pickup_tools = @settings.task_get_tools_on_completion
@boost = @settings.task_use_boost
@crafting_room = @settings.task_crafting_room
@username = get_settings.slack_username

DRCM.ensure_copper_on_hand(110000, @settings, "Crossing")
@stockdata = get_data('crafting')['stock']
@stackmap = { 'leather' => ['rat', 16667], 'cloth' => ['burlap', 16667], 'stack' => ['deer', 8864], 'ingot' => ['bronze', 8775], 'stone' => ['alabaster', 8864], 'yarn' => ['wool', 16667], 'lumber' => ['balsa', 8864] }
Expand Down Expand Up @@ -110,7 +116,6 @@ class TaskMaster
tool_pickup if @pickup_tools && DRCI.exists?("rangu ticket")
exit
end
DRCM.ensure_copper_on_hand(5000, @settings, "Crossing")

loop do
@dispose, @remainder = [false, false]
Expand Down Expand Up @@ -177,7 +182,7 @@ class TaskMaster
DRCC.get_crafting_item("#{@stackmap[stock].first} #{stock}", @bag, @bag_items, nil) if DRCI.exists?("#{@stackmap[stock].first} #{stock}")
number.times do
DRCT.order_item(@stackmap[stock].last, (stock == 'yarn' || stock == 'thread') ? @stockdata[stock]['stock-number'] : @stockdata[@stackmap[stock].first]['stock-number'])
fput("combine #{stock}")
DRC.bput("combine #{stock}", /you (combine|must)/i)
end
DRCC.stow_crafting_item("#{@stackmap[stock].first} #{stock}", @bag, nil)
end
Expand Down Expand Up @@ -402,7 +407,7 @@ class TaskMaster
DRCM.ensure_copper_on_hand(cost, @settings, "Crossing")
base_to_buy.times do
DRCT.order_item(@stackmap[base].last, @stockdata[@stackmap[base].first]['stock-number'])
fput("combine #{base}")
DRC.bput("combine #{base}", /you (combine|must)/i)
end
DRCC.stow_crafting_item(base, @bag, @settings.engineering_belt)
end
Expand All @@ -414,7 +419,7 @@ class TaskMaster
DRCM.ensure_copper_on_hand(cost, @settings, "Crossing")
base_to_buy.times do
DRCT.order_item(@stackmap[base].last, @stockdata[base]['stock-number'])
fput("combine #{base}")
DRC.bput("combine #{base}", /you (combine|must)/i)
end
DRCC.stow_crafting_item(base, @bag, @settings.engineering_belt)
end
Expand All @@ -429,9 +434,13 @@ class TaskMaster
end

def forge_item(item, count, type)
info = get_data('crafting')['blacksmithing']["Crossing"]
DRCC.check_consumables('oil', info['finisher-room'], info['finisher-number'], @bag, @bag_items, nil, count)
DRCC.find_anvil(@anvil_town)
unless @crafting_room
info = get_data('crafting')['blacksmithing']["Crossing"]
DRCC.check_consumables('oil', info['finisher-room'], info['finisher-number'], @bag, @bag_items, nil, count)
DRCC.find_anvil(@anvil_town)
else
DRCT.walk_to(@crafting_room)
end
DRCC.clean_anvil?
count.times do
DRC.wait_for_script_to_complete('forge', ['instructions', type, item, 'skip'])
Expand Down Expand Up @@ -508,7 +517,11 @@ class TaskMaster
end

def tailor_item(item, count, base, type)
DRCT.walk_to(14886) unless @marathon
unless @crafting_room
DRCT.walk_to(14886) unless @marathon
else
DRCT.walk_to(@crafting_room)
end
count.times do
DRC.wait_for_script_to_complete('sew', ['stow', 'instructions', type, item, base == 'yarn' ? 'knit' : nil, @marathon ? 'skip' : nil])
end
Expand Down Expand Up @@ -582,9 +595,10 @@ class TaskMaster
DRC.bput("get coin from my sack", "You pick up", "What were you")
end
result = DRC.bput("look in my sack", /^In the .* you see.*/)
if result.split(' ').any? { |word| @keeplist.include?(word) }
if result.match?(@keeplist_regex)
result.sub!(/In the woven sack you see (a|an|some) /, '').sub!(/\.$/, '')
DRC.message("Found a keeper: #{result}")
SlackBot.new.direct_message(@username, "Found a keeper: #{result}")
DRCI.put_away_item?('sack', @lootbag)
else
DRC.message("Nothing special: #{result}")
Expand Down
Loading