Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def wait_for_swing(target = nil)
- status_tags
- start = Time.now
- while(1)
- change_stance( 'defensive', false ) unless target && target.status =~ PRONE
- return if GameObj.npcs.size.nil? || GameObj.npcs.size == 0
- return if target && target.status =~ PRONE
- return if ( Time.now - start ) > 10
- return if matchtimeout( 1, /a exist="\d+" noun="\w+">.*?<\/a>.*you[\.|!]|d100|fumbles helplessly|thorny barrier surrounding you/ )
- end
- status_tags
- end
- def change_stance( new_stance, force = true )
- until( stance =~ /#{new_stance}/ )
- if( stance() =~ /#{new_stance}/ )
- return
- elsif( checkcastrt() > 0 && new_stance =~ /def/ )
- return if stance() == 'guarded'
- end
- if(force)
- bs_put "stance #{new_stance}"
- else
- put "stance #{new_stance}"
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement