Changeset 76
- Timestamp:
- 02/25/08 21:55:17 (5 years ago)
- Location:
- trunk/Phergie
- Files:
-
- 4 modified
-
Driver/Streams.php (modified) (1 diff)
-
Plugin/Karma.php (modified) (3 diffs)
-
Plugin/Quit.php (modified) (1 diff)
-
Plugin/Tld.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Phergie/Driver/Streams.php
r71 r76 199 199 array_unshift($args, $target); 200 200 } else { 201 $args = explode(' :', $args );201 $args = explode(' :', $args, 2); 202 202 } 203 203 break; -
trunk/Phergie/Plugin/Karma.php
r71 r76 74 74 'mc2' => 'mc2 has karma of e', 75 75 'mc²' => 'mc² has karma of e', 76 'i' => 'I haz big karma', 76 77 ); 77 78 … … 118 119 $source = $this->event->getSource(); 119 120 $message = $this->event->getArgument(1); 120 // Karma status request 121 if (preg_match('#^karma (\S+?)$#i', $message, $m)) { 121 122 // Karma status request 123 if (preg_match('#^karma (.+)$#i', $message, $m)) { 122 124 $term = strtolower($m[1]); 125 // Replaces multiple spaces by one 126 $term = preg_replace('#\s+#', ' ', $term); 123 127 // Return fixed value if set 124 128 if (isset ($this->fixedKarma[$term])) { … … 134 138 } 135 139 // Incrementation/decrementation request 136 } elseif (preg_match('#^(\S+? )(\+\+|--)\s*(.*)$#i', $message, $m)) {140 } elseif (preg_match('#^(\S+?|\(.+?\)+)(\+{2,}|-{2,})(?: \s+(.*))?$#i', $message, $m)) { 137 141 $word = strtolower($m[1]); 138 // Do nothing if the karma fixed 142 // Strip parenthesis grouping multiple words 143 if(substr($word, 0, 1) === '(' && substr($word, -1) === ')') { 144 $word = substr($word, 1, -1); 145 } else { // Add trailing + or -'s 146 if(strlen($m[2]) > 2) { 147 $word .= substr($m[2], 2); 148 $m[2] = substr($m[2], -2); 149 } 150 } 151 // Replaces multiple spaces by one 152 $word = preg_replace('#\s+#', ' ', $word); 153 // Do nothing if the karma is fixed 139 154 if (isset($this->fixedKarma[$word])) { 140 155 return; -
trunk/Phergie/Plugin/Quit.php
r59 r76 27 27 $this->doQuit('by request of ' . $this->event->getNick()); 28 28 } 29 30 public function onDoDie() 31 { 32 $this->doQuit('bows to ' . $this->event->getNick() .' and commits seppuku'); 33 } 29 34 } -
trunk/Phergie/Plugin/Tld.php
r71 r76 296 296 'zm' => 'Zambia', 297 297 'zw' => 'Zimbabwe', 298 // Pranks 299 'spoon' => 'Don\'t you know ? There is no spoon !', 300 'poo' => 'Do you really think that\'s funny ?', 298 301 ); 299 302