Advertisement
Whiteaxe

partner2

Feb 5th, 2020
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.74 KB | None | 0 0
  1. =begin
  2. # partner script, if you have a hunting parter for MA'ing, this script works for diff things
  3. AUTHOR: Aethor
  4. =end
  5. friendlist = ["Aethor","Aethorious", "Celebrim", "Ceba", "Gomble"]
  6.  
  7. def wait_rt
  8. target_line = matchtimeout 4, "Roundtime:", "Cast Roundtime"
  9. if (target_line =~ /Roundtime\: (\d+) sec/i)
  10. sleep $1.to_f
  11. elsif (target_line =~ /Cast Roundtime (\d+) seconds/i)
  12. sleep $1.to_f
  13. end
  14. end
  15. def ammo_on_ground(ammo)
  16. echo "ammo_on_ground"
  17. return GameObj.loot.find { |i| i.name =~ /\b#{ammo}s?\b/i or i.noun =~ /^#{ammo}s?$/i }
  18. end
  19. def gather_ammo()
  20. echo "gather_ammo"
  21. ammo = UserVars.ammo
  22. container = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.quiver}/ }
  23. hide = @HIDE_FOR_AMMO
  24.  
  25. if ammo.nil? or ammo.empty?
  26. return
  27. end
  28.  
  29. if ammo =~ /\b(arrow|bolt|dart)\b/i
  30. ammo_noun = $1
  31. else
  32. echo "failed to gather: invalid ammo type specified (use the full name)"
  33. end
  34.  
  35. if container.nil?
  36. echo "failed to gather: you must specify an ammo container to use this feature"
  37. return
  38. end
  39.  
  40. while( ammo_on_ground(ammo_noun) )
  41. change_stance('defensive')
  42.  
  43. unless GameObj.right_hand.id.nil?
  44. line = dothistimeout "stow ##{GameObj.right_hand.id}", 3, /put|closed/
  45. if line =~ /closed/
  46. fput "open my ##{Uservars.quiver}"
  47. fput "put ##{GameObj.right_hand.id} in my ##{UserVars.quiver}"
  48. end
  49. end
  50.  
  51. result = dothistimeout( "gather #{ammo}", 2, /^You gather|^You pick up|^I could not|^What were you|^You may only|reach|on the ground/ )
  52.  
  53. if( result =~ /on the ground/)
  54. result = dothistimeout "get #{ammo}s", 3, /^You gather|^You pick up|^I could not|^What were you|^You may only|reach|on the ground/
  55. end
  56.  
  57. if( result =~ /^You gather|^You pick up/ )
  58. dothistimeout( "put my #{ammo_noun} in my #{ammo_noun}s in my #{UserVars.quiver}", 2, /^I could not find|^You can't seem to|^You add|^You bundle|You cannot bundle/ )
  59. fput "put my #{ammo_noun} in my ##{UserVars.quiver}" if righthand?
  60. elsif( result =~ /You may only/ )
  61. return
  62. elsif( result == false || result =~ /^I could not find|^What were you/ )
  63. return
  64. elsif( result =~ /reach/ )
  65. fput 'hide' if hide and not hidden?
  66. sleep 4
  67. end
  68. end
  69. end
  70. def change_stance( new_stance, force = true )
  71. return if Spell[1617].active? || Spell[216].active? || dead?
  72.  
  73. if( stance() =~ /#{new_stance}/ )
  74. return
  75. elsif( checkcastrt() > 0 && new_stance =~ /def/ )
  76. return if stance() == 'guarded'
  77. end
  78.  
  79. if(force)
  80. result = dothistimeout( "stance #{new_stance}", 3, /You are now in an?|Cast Round Time in effect|You are unable to change/ )
  81. else
  82. fput "stance #{new_stance}"
  83. end
  84. end
  85. def stand()
  86.  
  87. fput "stand" if !standing? && !muckled? && checkrt == 0
  88. until(standing?)
  89. change_stance('defensive')
  90. fput 'stand'
  91. end
  92. end
  93. def npcs
  94. npcs = GameObj.npcs.find_all { |i| i.status !~ /dead/ }
  95. end
  96. def spellactive
  97. if Char.name =~ /Ceba/
  98. if !Spell[716].active
  99. Spell[716].cast if mana(20)
  100. end
  101. if !Spell[712].active
  102. Spell[712].cast if mana(20)
  103. end
  104. if !Spell[1711].active
  105. multifput "get orb from my #{UserVars.lootsack}", "rub orb", "put orb in my #{UserVars.lootsack}"
  106. end
  107. if !Spell[1712].active
  108. multifput "get statue from my #{UserVars.lootsack}", "rub my statue", "put my statue in my #{UserVars.lootsack}"
  109. end
  110. end
  111. end
  112. while(true)
  113.  
  114. target_line = waitfor("gestures at","vanishes!","points up","puckers his lips expectantly", "touches one finger to his lips", "channels at","slowly empties his lungs","snaps his fingers","holds up two fingers and slowly pinches them together until they are almost touching","rubs a small statue in his hand","Aethorious gives his disk a flip","offers you","is stunned","winks at you","swings a vultite falchion at", /\[Private\]\-/ )
  115.  
  116. friendlist.each do |person|
  117.  
  118. if(target_line =~ /#{person} winks at you./i)
  119. if mana?(60)
  120. fput "send 40 #{person}"
  121. else
  122. fput "wave #{person}"
  123. fput "snicker #{person}"
  124. end
  125.  
  126. elsif (target_line =~ /#{person} channels at./i)
  127. if Char.name =~ /Wahka/
  128. stand() if !standing?
  129. change_stance('guarded')
  130. Spell[1106].cast if mana(10)
  131. waitcastrt?
  132. end
  133. #elsif(target_line =~ /Aethorious gives his disk a flip./i)
  134. #fput "turn #{Char.name} disk"
  135. elsif(target_line =~ /#{person} rubs a small statue in his hand./i)
  136. if !Spell[1712].active
  137. fput "put ##{GameObj.left_hand.id} in my #{UserVars.lootsack}"
  138. multifput "get my statue","rub my statue","stow my statue"
  139. waitcastrt?
  140. if Char.name =~ /Gomble/
  141. fput "rem longbow"
  142. end
  143. end
  144. elsif(target_line =~ /#{person} is stunned./i)
  145. if Char.name =~ /Ceba/
  146. if mana?(10)
  147. multifput "prep 108", "cast #{person}"
  148. end
  149. end
  150. elsif (target_line =~ /#{person} slowly empties his lungs./i)
  151. start_script("waggle")
  152. elsif (target_line =~ /#{person} vanishes!/i)
  153. multifput "stow left","rem ring", "wear ring", "turn ring"
  154. elsif (target_line =~ /#{person} snaps his fingers./i)
  155. start_script ("isigils") unless running? 'isigils'
  156. elsif (target_line =~ /#{person} holds up two fingers and slowly pinches them together until they are almost touching./i)
  157. stop_script ("isigils") if running? 'isigils'
  158. elsif (target_line =~ /#{person} puckers his lips expectantly./i)
  159. Script.run("go2", "1704")
  160. elsif (target_line =~ /#{person} touches one finger to his lips./i)
  161. fput "join #{person}"
  162. elsif (target_line =~ /#{person} points up./i)
  163. Script.run("go2","188")
  164. elsif(target_line =~ /#{person} gestures at./i)
  165. if Char.name =~ /Wahka/
  166. stand() if !standing?
  167. change_stance('guarded')
  168. Spell[1106].cast if mana(10)
  169. waitcastrt?
  170. end
  171. elsif(target_line =~ /#{person} offers you./i)
  172. fput "put ##{GameObj.left_hand.id} in #{UserVars.lootsack}"
  173. fput "accept"
  174. fput "put ##{GameObj.left_hand.id} in #{UserVars.lootsack}"
  175. if checkleft !=nil
  176. fput "put ##{GameObj.left_hand.id} in my #{UserVars.lootsack}"
  177. elsif checkright.nil?
  178. if Char.name =~ /Celebrim/
  179. fput "get my runestaff"
  180. elsif Char.name =~ /Ceba/
  181. fput "get my runestaff"
  182. elsif Char.name =~ /Gomble/
  183. fput "get my longbow"
  184. end
  185. end
  186. elsif(target_line =~ /#{person} swings a vultite falchion at./i)
  187. if Char.name =~ /Wahka/
  188. stand() if !standing?
  189. change_stance('guarded')
  190. Spell[1106].cast if mana(10)
  191. waitcastrt?
  192. end
  193. end
  194. end
  195. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement