1: <?php
2:
3: namespace Budabot\User\Modules;
4:
5: 6: 7: 8: 9: 10:
11: class OSController {
12:
13: 14: 15: 16:
17: public $moduleName;
18:
19:
20: public $chatBot;
21:
22:
23: public $timerController;
24:
25: 26: 27: 28:
29: public function osTimerEvent($eventObj) {
30:
31:
32:
33: if (preg_match("/^Blammo! (.+) has launched an orbital attack!$/i", $eventObj->message, $arr)) {
34: $orgName = $this->chatBot->vars["my_guild"];
35:
36: $launcher = $arr[1];
37:
38: for ($i = 1; $i <= 10; $i++) {
39: $name = "$orgName OS/AS $i";
40: if ($this->timerController->get($name) == null) {
41: $runTime = 15 * 60;
42: $msg = $this->timerController->addTimer($launcher, $name, $runTime, 'guild');
43: $this->chatBot->sendGuild($msg);
44: break;
45: }
46: }
47: }
48: }
49: }
50: