Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. custom_require.call(%w(common common-arcana common-items common-travel drinfomon events spellmonitor equipmanager))
  2.  
  3. class Athletics
  4. include DRC
  5. include DRCA
  6. include DRCI
  7. #include DRCS
  8. include DRCT
  9.  
  10. def initialize
  11. @settings = get_settings()
  12. @athletics_options = get_data('athletics').athletics_options
  13. @climbing_target = get_data('athletics').practice_options[@settings.climbing_target]
  14. @swimming_target = get_data('athletics').swimming_options[@settings.swimming_target]
  15.  
  16. return unless DRSkill.getxp('Athletics') < 20
  17.  
  18. DRC.wait_for_script_to_complete('buff', ['eotb']) if DRStats.necromancer?
  19.  
  20. if DRSkill.getrank('Athletics') >= 525
  21. hlc_athletics
  22. elsif @climbing_target
  23. climb_practice(@climbing_target['target'], @climbing_target['hide'])
  24. elsif @swimming_target
  25. swim_loop(@swimming_target['rooms'])
  26. elsif @settings.hometown == 'Crossing'
  27. crossing_athletics
  28. elsif @settings.hometown == 'Riverhaven'
  29. riverhaven_athletics
  30. elsif @settings.hometown == 'Shard'
  31. shard_athletics
  32. elsif @settings.hometown == 'Hibarnhvidar'
  33. hib_athletics
  34. elsif @settings.hometown == 'Ratha'
  35. ratha_athletics
  36. end
  37.  
  38. DRC.wait_for_script_to_complete('buff', ['eotb']) if DRStats.necromancer?
  39. end
  40.  
  41. def swim_loop(rooms)
  42. return unless rooms
  43.  
  44. while DRSkill.getxp('Athletics') < 29
  45. rooms.each { |x| walk_to(x) }
  46. end
  47. end
  48.  
  49. def hlc_athletics
  50. start_script('skill-recorder') unless Script.running?('skill-recorder')
  51. walk_to(2245)
  52. if DRSkill.getxp('Athletics') < 29
  53. walk_to(2245)
  54. walk_to(9607)
  55. walk_to(19_464)
  56. while DRSkill.getxp('Athletics') < 29
  57. walk_to(2245)
  58. walk_to(9607)
  59. walk_to(11_126)
  60. walk_to(19_464)
  61. break if DRSkill.getxp('Athletics') >= 29
  62. end
  63. end
  64. end
  65.  
  66. def riverhaven_athletics
  67. while DRSkill.getxp('Athletics') < 29
  68. walk_to(473)
  69. walk_to(1375)
  70. break if DRSkill.getxp('Athletics') >= 29
  71. end
  72. end
  73.  
  74. def crossing_athletics
  75. if DRSkill.getrank('Athletics') >= 400
  76. climb_branch
  77. else
  78. while DRSkill.getxp('Athletics') <= 30
  79. DRC.wait_for_script_to_complete('buff', ['eotb']) if DRStats.necromancer?
  80.  
  81. @athletics_options
  82. .reject { |data| @settings.avoid_athletics_in_justice && data['justice'] }
  83. .each do |data|
  84. break unless climb?(data['room'], data['targets'])
  85. end
  86. end
  87. end
  88. end
  89.  
  90. def shard_athletics
  91. while DRSkill.getxp('Athletics') <= 30
  92. walk_to(11481)
  93. walk_to(11482)
  94. walk_to(11483)
  95. end
  96. end
  97.  
  98. def hib_athletics
  99. walk_to(4155)
  100. move('nw')
  101.  
  102. while DRSkill.getxp('Athletics') <= 30
  103. fput('climb bank')
  104. 3.times do
  105. fput('south')
  106. waitrt?
  107. end
  108. #walk_to(4155)
  109. fput('climb bank')
  110. walk_to(4155)
  111. move('nw')
  112. end
  113. fput('climb bank')
  114. waitrt?
  115. walk_to(@settings.safe_room)
  116. end
  117.  
  118. def ratha_athletics
  119. while DRSkill.getxp('Athletics') <= 30
  120. walk_to(11549)
  121. walk_to(11550)
  122. walk_to(11551)
  123. walk_to(11552)
  124. end
  125. end
  126.  
  127. def climb_practice(target, to_hide = false)
  128. return unless target
  129. walk_to(@climbing_target['id'])
  130.  
  131. while DRSkill.getxp('Athletics') < 29
  132. if DRStats.necromancer?
  133. DRC.wait_for_script_to_complete('buff', ['eotb'])
  134. end
  135. retreat
  136. if to_hide
  137. attempts_to_hide = 5
  138. while attempts_to_hide > 0
  139. break if hide?
  140. attempts_to_hide -= 1
  141. end
  142. return if attempts_to_hide == 0
  143. end
  144. Flags.add('ct-climbing-finished', 'You finish practicing')
  145. Flags.add('ct-climbing-combat', 'You are engaged in combat')
  146. bput("climb practice #{target}", 'You begin to practice ')
  147. loop do
  148. pause 1
  149. break if Flags['ct-climbing-finished']
  150. return if Flags['ct-climbing-combat']
  151. if DRSkill.getxp('Athletics') > 28
  152. fput('stop climb')
  153. break
  154. end
  155. end
  156. end
  157.  
  158. bput('unhide', 'You come out of hiding', 'You slip out of hiding', 'But you are not')
  159. end
  160.  
  161. def climb?(room, targets)
  162. targets.each do |target|
  163. walk_to(room)
  164. return true if DRRoom.npcs.length >= 3
  165.  
  166. fput "climb #{target}"
  167. pause
  168. waitrt?
  169. return false if DRSkill.getxp('Athletics') >= 30
  170. end
  171. true
  172. end
  173.  
  174. def climb_branch
  175. walk_to(2245)
  176. if DRSkill.getxp('Athletics') < 29
  177. walk_to(2245)
  178. if UserVars.athletics < 550
  179. climb_practice('branch', true)
  180. end
  181. end
  182. end
  183. end
  184.  
  185. Athletics.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement