Changeset 72
- Timestamp:
- 02/25/08 06:55:08 (5 years ago)
- Location:
- trunk/Phergie
- Files:
-
- 5 modified
-
Plugin/Acronym.php (modified) (1 diff)
-
Plugin/Daddy.php (modified) (1 diff)
-
Plugin/Logging.php (modified) (2 diffs)
-
Plugin/Url.php (modified) (3 diffs)
-
phergie.ini (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Phergie/Plugin/Acronym.php
r71 r72 99 99 $message = $this->event->getArgument(1); 100 100 101 if (!preg_match('/((?:[A-Z]\.?){2,})\?/AD', $message, $acronym)) { 101 // Matches an optional "Nick: " followed by an acronym formatted as A.B.C. or ABC 102 if (!preg_match('/^(?:[A-Za-z0-9\[\]`|{}_-]+: )?((?:[A-Z]\.?){2,})\?$/', $message, $acronym)) { 102 103 return; 103 104 } -
trunk/Phergie/Plugin/Daddy.php
r68 r72 23 23 $text = $this->event->getArgument(1); 24 24 if (preg_match('/' . $bot . '\s*:?\s+?who\'?s your daddy\??/iAD', $text)) { 25 $this->doPrivmsg($this->event->getSource(), 'You\'re my daddy, ' . $this->event->getNick() . '!'); 25 if($this->getIni('curses') === 'true' && rand(0,10) === 10) { 26 $this->doPrivmsg($this->event->getSource(), $this->event->getNick() . ': I am your daddy, bitch!'); 27 } else { 28 $this->doPrivmsg($this->event->getSource(), 'You\'re my daddy, ' . $this->event->getNick() . '!'); 29 } 26 30 } 27 31 } -
trunk/Phergie/Plugin/Logging.php
r60 r72 491 491 public function onDoSeen($user) 492 492 { 493 // Don't match if user has a space (obviously it's not a nick) 494 if (strpos($user, ' ') !== false) { 495 return; 496 } 497 493 498 $source = $this->event->getSource(); 494 499 $target = $this->event->getNick(); … … 553 558 public function onDoHeard($user) 554 559 { 560 // Don't match if user has a space (obviously it's not a nick) 561 if (strpos($user, ' ') !== false) { 562 return; 563 } 564 555 565 $source = $this->event->getSource(); 556 566 $target = $this->event->getNick(); -
trunk/Phergie/Plugin/Url.php
r71 r72 23 23 24 24 /** 25 * Saves the last url parsed to avoid spamming/looping with multiple bots25 * Saves the last urls parsed to avoid spamming/looping with multiple bots 26 26 * 27 * It's saved in a n array containing (url, tinyurl)so both are checked27 * It's saved in a flat array containing (url, tinyurl) couples so both are checked 28 28 * 29 29 * @var array 30 30 */ 31 protected $lastUrl = array();31 protected $lastUrls = array(); 32 32 33 33 /** … … 57 57 $url = rtrim($m[1], '), ]'); 58 58 // Spam check on base URL 59 if(array_search($url, $this->lastUrl ) !== false)59 if(array_search($url, $this->lastUrls) !== false) 60 60 return; 61 61 // Convert url 62 62 $tinyUrl = $this->tinyUrl($url); 63 63 // Spam check on tinyURL 64 if(array_search($tinyUrl, $this->lastUrl ) !== false)64 if(array_search($tinyUrl, $this->lastUrls) !== false) 65 65 return; 66 66 … … 114 114 ); 115 115 116 $this->lastUrl = array($url, $tinyUrl); 116 // Remove one url couple if it exceeds 5 couples 117 if (count($this->lastUrls) > 10) { 118 array_shift($this->lastUrls); 119 array_shift($this->lastUrls); 120 } 121 122 // Add the latest couple 123 $this->lastUrls[] = $url; 124 $this->lastUrls[] = $tinyUrl; 117 125 } 118 126 } -
trunk/Phergie/phergie.ini
r71 r72 33 33 ; refer to itself in the third person for actions 34 34 gender = 35 36 ; curses : 37 ; boolean flag indicating whether or not the bot is allowed to use curses, 38 ; bad words, etc. defaults to false. 39 curses = 35 40 36 41 ; plugins :