Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- # partner script, if you have a hunting parter for MA'ing, this script works for diff things
- AUTHOR: Aethor
- =end
- friendlist = ["Aethor","Aethorious", "Celebrim", "Ceba", "Gomble"]
- def wait_rt
- target_line = matchtimeout 4, "Roundtime:", "Cast Roundtime"
- if (target_line =~ /Roundtime\: (\d+) sec/i)
- sleep $1.to_f
- elsif (target_line =~ /Cast Roundtime (\d+) seconds/i)
- sleep $1.to_f
- end
- end
- def ammo_on_ground(ammo)
- echo "ammo_on_ground"
- return GameObj.loot.find { |i| i.name =~ /\b#{ammo}s?\b/i or i.noun =~ /^#{ammo}s?$/i }
- end
- def gather_ammo()
- echo "gather_ammo"
- ammo = UserVars.ammo
- container = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.quiver}/ }
- hide = @HIDE_FOR_AMMO
- if ammo.nil? or ammo.empty?
- return
- end
- if ammo =~ /\b(arrow|bolt|dart)\b/i
- ammo_noun = $1
- else
- echo "failed to gather: invalid ammo type specified (use the full name)"
- end
- if container.nil?
- echo "failed to gather: you must specify an ammo container to use this feature"
- return
- end
- while( ammo_on_ground(ammo_noun) )
- change_stance('defensive')
- unless GameObj.right_hand.id.nil?
- line = dothistimeout "stow ##{GameObj.right_hand.id}", 3, /put|closed/
- if line =~ /closed/
- fput "open my ##{Uservars.quiver}"
- fput "put ##{GameObj.right_hand.id} in my ##{UserVars.quiver}"
- end
- end
- result = dothistimeout( "gather #{ammo}", 2, /^You gather|^You pick up|^I could not|^What were you|^You may only|reach|on the ground/ )
- if( result =~ /on the ground/)
- result = dothistimeout "get #{ammo}s", 3, /^You gather|^You pick up|^I could not|^What were you|^You may only|reach|on the ground/
- end
- if( result =~ /^You gather|^You pick up/ )
- 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/ )
- fput "put my #{ammo_noun} in my ##{UserVars.quiver}" if righthand?
- elsif( result =~ /You may only/ )
- return
- elsif( result == false || result =~ /^I could not find|^What were you/ )
- return
- elsif( result =~ /reach/ )
- fput 'hide' if hide and not hidden?
- sleep 4
- end
- end
- end
- def change_stance( new_stance, force = true )
- return if Spell[1617].active? || Spell[216].active? || dead?
- if( stance() =~ /#{new_stance}/ )
- return
- elsif( checkcastrt() > 0 && new_stance =~ /def/ )
- return if stance() == 'guarded'
- end
- if(force)
- result = dothistimeout( "stance #{new_stance}", 3, /You are now in an?|Cast Round Time in effect|You are unable to change/ )
- else
- fput "stance #{new_stance}"
- end
- end
- def stand()
- fput "stand" if !standing? && !muckled? && checkrt == 0
- until(standing?)
- change_stance('defensive')
- fput 'stand'
- end
- end
- def npcs
- npcs = GameObj.npcs.find_all { |i| i.status !~ /dead/ }
- end
- def spellactive
- if Char.name =~ /Ceba/
- if !Spell[716].active
- Spell[716].cast if mana(20)
- end
- if !Spell[712].active
- Spell[712].cast if mana(20)
- end
- if !Spell[1711].active
- multifput "get orb from my #{UserVars.lootsack}", "rub orb", "put orb in my #{UserVars.lootsack}"
- end
- if !Spell[1712].active
- multifput "get statue from my #{UserVars.lootsack}", "rub my statue", "put my statue in my #{UserVars.lootsack}"
- end
- end
- end
- while(true)
- 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\]\-/ )
- friendlist.each do |person|
- if(target_line =~ /#{person} winks at you./i)
- if mana?(60)
- fput "send 40 #{person}"
- else
- fput "wave #{person}"
- fput "snicker #{person}"
- end
- elsif (target_line =~ /#{person} channels at./i)
- if Char.name =~ /Wahka/
- stand() if !standing?
- change_stance('guarded')
- Spell[1106].cast if mana(10)
- waitcastrt?
- end
- #elsif(target_line =~ /Aethorious gives his disk a flip./i)
- #fput "turn #{Char.name} disk"
- elsif(target_line =~ /#{person} rubs a small statue in his hand./i)
- if !Spell[1712].active
- fput "put ##{GameObj.left_hand.id} in my #{UserVars.lootsack}"
- multifput "get my statue","rub my statue","stow my statue"
- waitcastrt?
- if Char.name =~ /Gomble/
- fput "rem longbow"
- end
- end
- elsif(target_line =~ /#{person} is stunned./i)
- if Char.name =~ /Ceba/
- if mana?(10)
- multifput "prep 108", "cast #{person}"
- end
- end
- elsif (target_line =~ /#{person} slowly empties his lungs./i)
- start_script("waggle")
- elsif (target_line =~ /#{person} vanishes!/i)
- multifput "stow left","rem ring", "wear ring", "turn ring"
- elsif (target_line =~ /#{person} snaps his fingers./i)
- start_script ("isigils") unless running? 'isigils'
- elsif (target_line =~ /#{person} holds up two fingers and slowly pinches them together until they are almost touching./i)
- stop_script ("isigils") if running? 'isigils'
- elsif (target_line =~ /#{person} puckers his lips expectantly./i)
- Script.run("go2", "1704")
- elsif (target_line =~ /#{person} touches one finger to his lips./i)
- fput "join #{person}"
- elsif (target_line =~ /#{person} points up./i)
- Script.run("go2","188")
- elsif(target_line =~ /#{person} gestures at./i)
- if Char.name =~ /Wahka/
- stand() if !standing?
- change_stance('guarded')
- Spell[1106].cast if mana(10)
- waitcastrt?
- end
- elsif(target_line =~ /#{person} offers you./i)
- fput "put ##{GameObj.left_hand.id} in #{UserVars.lootsack}"
- fput "accept"
- fput "put ##{GameObj.left_hand.id} in #{UserVars.lootsack}"
- if checkleft !=nil
- fput "put ##{GameObj.left_hand.id} in my #{UserVars.lootsack}"
- elsif checkright.nil?
- if Char.name =~ /Celebrim/
- fput "get my runestaff"
- elsif Char.name =~ /Ceba/
- fput "get my runestaff"
- elsif Char.name =~ /Gomble/
- fput "get my longbow"
- end
- end
- elsif(target_line =~ /#{person} swings a vultite falchion at./i)
- if Char.name =~ /Wahka/
- stand() if !standing?
- change_stance('guarded')
- Spell[1106].cast if mana(10)
- waitcastrt?
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement