home *** CD-ROM | disk | FTP | other *** search
- ; Vote Master Custom Identifiers
- ;
- alias vote.percent {
- set %vote.percent $round($calc($1 / $2),2)
- if ($left(%vote.percent,1) == 0) {
- if ($right(%vote.percent,2) == 00) { return 0% }
- elseif ($mid(%vote.percent,3,1) == 0) { return $mid(%vote.percent,4,1) $+ $chr(37) }
- else { return $right(%vote.percent,2) $+ $chr(37) }
- }
- elseif ($mid(%vote.percent,2,1) == $chr(46)) { return $remove(%vote.percent,$chr(46)) $+ $chr(37) }
- }
- ;
- ; Vote Master Aliases
- ;
- alias vote.timesup {
- if ($chan(%vote.chan) == $null) { echo 6 -a Voting Booth Closed | echo 4 -a ERROR: Unable to display results! You're not on %vote.chan | goto end }
- msg %vote.chan 6Voting Booth Closed
- msg %vote.chan 12Topic was: %vote.topic
- msg %vote.chan 2People who said Yes:4 %vote.yes 2(12 $+ $vote.percent(%vote.yes,%vote.total) $+ 2)
- msg %vote.chan 2People who said No:4 %vote.no 2(12 $+ $vote.percent(%vote.no,%vote.total) $+ 2)
- if (%vote.no == 0 && %vote.yes == 0) { msg %vote.chan 5No one voted! Geez... }
- elseif (%vote.no == %vote.yes) { msg %vote.chan 5It's a Tie! }
- elseif (%vote.no > %vote.yes) { msg %vote.chan 5The Majority Voted NO }
- elseif (%vote.no < %vote.yes) { msg %vote.chan 5The Majority Voted YES }
- :end
- unset %vote.*
- }
- ;
- ; Vote Master Events
- ;
- on 1:text:!yes*:#: {
- if (%vote.topic != $null && $chan == %vote.chan) {
- if (%vote.nick. [ $+ [ $nick ] ] != $null) { notice $nick You've already placed your vote! | halt }
- inc %vote.yes 1
- inc %vote.total 1
- notice $nick Thanks for placing your vote!
- set %vote.nick. [ $+ [ $nick ] ] voted
- }
- }
- on 1:text:!no*:#: {
- if (%vote.topic != $null && $chan == %vote.chan) {
- if (%vote.nick. [ $+ [ $nick ] ] != $null) { notice $nick You've already placed your vote! | halt }
- inc %vote.no 1
- inc %vote.total 1
- notice $nick Thanks for placing your vote!
- set %vote.nick. [ $+ [ $nick ] ] voted
- }
- }
- on 1:connect:unset %vote.*
-