Advertisement
Guest User

Untitled

a guest
May 27th, 2010
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.02 KB | None | 0 0
  1.     def wait_for_swing(target = nil)
  2.         status_tags
  3.         start = Time.now
  4.         while(1)
  5.             change_stance( 'defensive', false ) unless target && target.status =~ PRONE
  6.             return if GameObj.npcs.size.nil? || GameObj.npcs.size == 0
  7.             return if target && target.status =~ PRONE
  8.             return if ( Time.now - start ) > 10
  9.             return if matchtimeout( 1, /a exist="\d+" noun="\w+">.*?<\/a>.*you[\.|!]|d100|fumbles helplessly|thorny barrier surrounding you/ )
  10.         end
  11.         status_tags
  12.     end
  13.  
  14.     def change_stance( new_stance, force = true )
  15.         until( stance =~ /#{new_stance}/ )
  16.             if( stance() =~ /#{new_stance}/ )
  17.                 return
  18.             elsif( checkcastrt() > 0 && new_stance =~ /def/ )
  19.                 return if stance() == 'guarded'
  20.             end
  21.  
  22.             if(force)
  23.                 bs_put "stance #{new_stance}"
  24.             else
  25.                 put "stance #{new_stance}"
  26.                 break
  27.             end
  28.         end
  29.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement