All pastes #550842 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-08 15:21 UTC
rendered paste body
<?php
	
	$sb = false;
	
	$crushings = 0;
	
	$cl = file('attempt2.txt');
	
	foreach($cl as $line)
	{
		if(strpos($line, 'Drowe gains Shield Block.'))
		{
			$sb = true;
		}
		else if(strpos($line, 'Shield Block fades from Drowe.'))
		{
			$sb = false;
		}
		else if(preg_match('/Bloodlord Mandokir hits Drowe for [0-9]*\. \(crushing\)/',$line))
		{
			if($sb)
			{
				$crushings++;
				echo $line;
			}
		}
	}
	
	echo $crushings;
	
?>