Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page = <<< TXT
- CASE "grml"\r\n
- prflidty$ = "Gremlin"\r\n
- prflactn$ = "movebitepnch"\r\n
- IF RND(1) > .2 THEN\r\n
- prflactn$ = prflactn$ + "dggr"\r\n
- END IF\r\n
- prflgpic$ = "grml"\r\n
- prflidty! = 4\r\n
- prflhp! = 25\r\n
- prflstr! = 90\r\n
- prflspd! = 1\r\n
- prflarmr! = 1\r\n
- prflvalu! = 5\r\n
- prflpirc! = 2\r\n
- prfllv! = 1\r\n
- prflhpmax! = 25\r\n
- prflstrmax! = 90\r\n
- TXT;
- echo '<html><head><title>mk11STATSRAW</title></head><body>'.gen_statsheet($page).'</body></html>';
- function gen_statsheet( $page = '' ) {
- $return = '';
- $pattern = '/(?:prfl(?<stat>idty|hp|str|spd|armr|valu|pirc|lv|hpmax|strmax|essmax|essspd)!) = (?<value>[.\d]+)/';
- while( preg_match( $pattern, $page, $matches, PREG_UNMATCHED_AS_NULL ) )
- {
- if( isset( $matches[ 'stat' ] ) and isset( $matches[ 'value' ] ) )
- {
- if( !is_null( $matches[ 'stat' ] ) and !is_null( $matches[ 'value' ] ) )
- {
- $return .= '<p>'. $matches[ 'stat' ]. '='. $matches[ 'value' ]. '</p>';
- $page = str_replace( $matches[0], '', $page );
- }
- }
- }
- return $return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement