Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplified the logic in the privmsg hooks
- Loading branch information
1 parent
b240535
commit cfbb792
Showing
15 changed files
with
287 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
|
||
return function($message) { | ||
global $accessArray; | ||
global $initiated; | ||
global $nick; | ||
|
||
$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost(); | ||
|
||
$search = searchAccess($hostmask, $accessArray); | ||
|
||
$parameters = $message->getParameters(); | ||
$where = $parameters[0]; | ||
$command = substr(trim($parameters[1]), 0, 1);; | ||
|
||
if ($search !== FALSE && $where == $nick && $command == "c") { | ||
global $initiated; | ||
|
||
if ($initiated == TRUE) { | ||
global $channel; | ||
global $position; | ||
global $lecture; | ||
if ($where != $nick) return; | ||
|
||
$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost(); | ||
if (!searchAccess($hostmask, $accessArray)) return; | ||
|
||
if ($parameters[1][0] != 'c') return; | ||
|
||
if (!$initiated) | ||
return say("Please initiate a lecture to show slides."); | ||
|
||
global $channel; | ||
global $position; | ||
global $lecture; | ||
|
||
$realPos = trim(substr($parameters[1], 1)); | ||
$realPos = trim(substr($parameters[1], 1)); | ||
|
||
if (!empty($lecture[$realPos])) { | ||
$position = $realPos; | ||
say("Changed slide position to " . $realPos . "."); | ||
} else { | ||
say("The requested slide could not be found."); | ||
} | ||
} else { | ||
say("Please initiate a lecture to show slides."); | ||
} | ||
if (!empty($lecture[$realPos])) { | ||
$position = $realPos; | ||
say("Changed slide position to " . $realPos . "."); | ||
} else { | ||
say("The requested slide could not be found."); | ||
} | ||
} | ||
}; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
|
||
return function($message) { | ||
global $accessArray; | ||
global $initiated; | ||
global $nick; | ||
|
||
$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost(); | ||
|
||
$search = searchAccess($hostmask, $accessArray); | ||
|
||
$parameters = $message->getParameters(); | ||
$where = $parameters[0]; | ||
$text = trim($parameters[1]); | ||
|
||
if ($where != $nick) return; | ||
|
||
$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost(); | ||
if (!searchAccess($hostmask, $accessArray)) return; | ||
|
||
if ($parameters[1][0] != 'n') return; | ||
|
||
if (!$initiated) | ||
return say("Please initiate a lecture to show slides."); | ||
|
||
if ($search !== FALSE && $where == $nick && $text == "n") { | ||
global $initiated; | ||
|
||
if ($initiated == TRUE) { | ||
global $channel; | ||
global $position; | ||
global $lecture; | ||
global $channel; | ||
global $position; | ||
global $lecture; | ||
|
||
if (!empty($lecture[$position])) { | ||
talk($channel, $lecture[$position]); | ||
say("Played slide " . $position . "."); | ||
$position++; | ||
} else { | ||
say("Out of slides."); | ||
} | ||
} else { | ||
say("Please initiate a lecture to show slides."); | ||
} | ||
if (!empty($lecture[$position])) { | ||
talk($channel, $lecture[$position]); | ||
say("Played slide " . $position . "."); | ||
$position++; | ||
} else { | ||
say("Out of slides."); | ||
} | ||
} | ||
}; | ||
?> |
Oops, something went wrong.