Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- custom_require.call(%w[common common-arcana])
- class MagicTraining
- include DRC
- include DRCA
- def initialize
- @mana_threshold = 40 #percentage
- loop do
- unless train_magics
- return
- else
- pause 1
- end
- end
- 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) > 20 }
- return false if skills_to_train.empty?
- skills_to_train.sort_by { |skill| DRSkill.getxp(skill) }
- .each { |skill|
- # Get settings here so I can update on the fly
- echo "Training: #{skill}"
- settings = get_settings
- magics = settings.magic_training
- spell_data = magics[skill]
- before_xp = DRSkill.getxp(skill)
- cast_spell(spell_data, settings, true) if mana > @mana_threshold
- echo "#{skill} gains: #{DRSkill.getxp(skill) - before_xp}"
- }
- true
- end
- end
- before_dying do
- fput('release spell')
- fput('release sym')
- end
- MagicTraining.new
Advertisement
Add Comment
Please, Sign In to add comment