Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- custom_require.call(%w[common common-travel])
- class StationaryTraining
- include DRC
- def initialize
- @dump_item_count = get_settings.dump_item_count
- @magics = get_settings.combat_spell_training
- @safe_room = get_settings.safe_room
- @repair_every = get_settings.repair_every
- @mana_threshold = 40 #percentage
- @pow_time = Time.now - 60
- @perc_timer = Time.now - 60
- @junk_timer = Time.now
- @hunt_timer = Time.now - 1801
- @poison_timer = Time.now - 60
- @hunting_runs = 0
- loop do
- #check_for_poison
- #train_attunement
- #train_perception
- unless train_magics
- #train_mech
- #train_locks
- #train_appr
- #train_outdoors
- #train_athletics
- #train_fa
- #train_weapons
- else
- pause 5
- end
- end
- end
- def train_fa
- return unless DRSkill.getxp('First Aid') < 15
- wait_for_script_to_complete('first-aid')
- end
- def check_for_poison
- return unless (Time.now - @poison_timer) > 60
- fput('health')
- cast_spell('FP', '20', 'cast') if reget(15, 'You have a .* poisoned')
- @poison_timer = Time.now
- end
- def train_magics
- return false unless mana > @mana_threshold
- skills_to_train = %w[Utility Warding Augmentation Sorcery]
- skills_to_train.reject! { |skill| DRSkill.getxp(skill) > 30 }
- return false if skills_to_train.empty?
- skills_to_train.sort_by { |skill| DRSkill.getxp(skill) }
- .each { |skill| cast_spell( @magics[skill]['abbrev'],
- @magics[skill]['mana'],
- @magics[skill]['cast']) if mana > @mana_threshold }
- true
- end
- def cast_spell(abbrev, mana, cast)
- return unless abbrev && mana && cast
- bput('release sym', 'You pause for a moment', 'But you haven\'t')
- bput('release spell', 'You let your', 'You aren\'t preparing')
- bput('prep sym', 'You recall the exact', 'But you\'ve already')
- bput("prepare #{abbrev} #{mana}", 'With rigid movements', 'You trace')
- waitfor('You feel fully prepared')
- bput("#{cast}", 'You gesture', 'You don\'t have')
- end
- def train_locks
- return unless DRSkill.getxp('Locksmithing') < 25
- wait_for_script_to_complete('bitchin-pick', ['pets', '99'])
- wait_for_script_to_complete('bitchin-pick')
- end
- def train_athletics
- return unless DRSkill.getxp('Athletics') < 1
- wait_for_script_to_complete('athletics')
- DRCT.walk_to(@safe_room)
- end
- def train_attunement
- return unless ((Time.now - @pow_time > 60)) && DRSkill.getxp('Attunement') < 30
- bput('pow', 'You reach out')
- @pow_time = Time.now
- end
- def train_perception
- return unless ((Time.now - @perc_timer) > 60) && DRSkill.getxp('Perception') < 30
- bput('hunt', 'You take note of ', 'You find yourself unable to hunt in this area')
- @perc_timer = Time.now
- end
- def train_mech
- return unless DRSkill.getxp('Mechanical Lore') < 25
- dump_junk
- wait_for_script_to_complete('mech-lore')
- end
- def train_appr
- return unless DRSkill.getxp('Appraisal') < 10
- %w[first second third fourth].each { |itr|
- bput("get #{itr} pouch in my bag", 'You get')
- bput('appr my pouch', 'The suede')
- waitrt?
- pause 0.25
- bput("put my pouch in my bag", 'You put')
- }
- end
- def train_outdoors
- while DRSkill.getxp('Outdoorsmanship') < 25
- DRC.collect('rock')
- waitrt?
- DRC.kick_pile? unless DRC.kick_pile?("rocks")
- dump_junk
- end
- end
- def train_weapons
- return unless ((Time.now - @hunt_timer) > 1800) && DRSkill.getxp('Light Thrown') < 5
- stop_script('healbot') if Script.running?('healbot')
- stop_script('regen') if Script.running?('regen')
- fput('release cyclic', 'The tingling across', 'You have no cyclic')
- wait_for_script_to_complete('hunting-buddy', ['weapons'])
- @hunting_runs += 1
- if @hunting_runs >= @repair_every
- wait_for_script_to_complete('sloot', ['shard'])
- wait_for_script_to_complete('repair', ['shard'])
- @hunting_runs = 0
- end
- DRCT.walk_to(@safe_room)
- @hunt_timer = Time.now
- start_script('healbot')
- end
- def dump_junk
- #return unless @settings.dump_junk
- return unless (Time.now - @junk_timer) > 300
- return unless DRRoom.room_objs.size > @dump_item_count
- bput('dump junk', 'You should just kick', 'You have marked this room', 'You cannot summon', 'The janitor was recently summoned')
- @junk_timer = Time.now
- end
- end
- before_dying do
- stop_script('mech-lore') if Script.running?('mech-lore')
- stop_script('athletics') if Script.running?('athletics')
- stop_script('bitchin-pick') if Script.running?('bitchin-pick')
- stop_script('first-aid') if Script.running?('first-aid')
- 2.times { fput('put my massive codex in my pack') }
- fput('stop climb')
- fput('release spell')
- 2.times { fput('drop grass') }
- fput('drop rope')
- fput("put my pouch in my bag")
- fput('stow left')
- fput('stow right')
- DRC.kick_pile?("rocks")
- end
- StationaryTraining.new
Advertisement
Add Comment
Please, Sign In to add comment