rendered paste bodyon *:TEXT:!Poll *:#:{
if (%poll. [ $+ [ $chan ] ] == $null) {
/set %yes. [ $+ [ $chan ] ] 0
/set %no. [ $+ [ $chan ] ] 0
/set %poll. [ $+ [ $chan ] ] $2-
/msg $chan Poll: %poll. [ $+ [ $chan ] ] type: !yes : to vote yes! !no : to vote no!
}
else {
/msg $chan there is already an active poll in this channel.. Please type !endpoll to stop the current one.
}
}
on *:TEXT:!yes:#:{
if (%poll. [ $+ [ $chan ] ] == $null) { halt }
if (%lol. [ $+ [ $+($nick,.,$chan) ] ] == on) {
/notice $nick You've already voted in this poll.
}
if (%lol. [ $+ [ $+($nick,.,$chan) ] ] != on) {
/set %lol. [ $+ [ $+($nick,.,$chan) ] ] on
/inc %yes. [ $+ [ $chan ] ] 1
/msg $chan $nick $+ , you have voted yes.
}
}
on *:TEXT:!no:#:{
if (%poll. [ $+ [ $chan ] ] == $null) { halt }
if (%lol. [ $+ [ $+($nick,.,$chan) ] ] == on) {
/notice $nick You've already voted in this poll.
}
if (%lol. [ $+ [ $+($nick,.,$chan) ] ] != on) {
/set %lol. [ $+ [ $+($nick,.,$chan) ] ] on
/inc %no. [ $+ [ $chan ] ] 1
/msg $chan $nick $+ , you have voted no.
}
}
on *:TEXT:!endpoll:#:{
if (%poll. [ $+ [ $chan ] ] == $null) {
/msg $chan There is no active poll in $chan type: !poll <question> to start a poll!
}
elseif ((%poll. [ $+ [ $chan ] ] != $null) && (%yes. [ $+ [ $chan ] ] > %no. [ $+ [ $chan ] ] )) {
/msg $chan Poll: %poll. [ $+ [ $chan ] ]
/msg $chan Poll has been ended by: $nick $+ , Yes Votes: %yes. [ $+ [ $chan ] ] No Votes: %no. [ $+ [ $chan ] ]
/msg $chan $chan is more in favor of yes then no by $calc(%yes. [ $+ [ $chan ] ] - %no. [ $+ [ $chan ] ] ) Votes!
/unset %no. [ $+ [ $chan ] ]
/unset %yes. [ $+ [ $chan ] ]
/unset %poll. [ $+ [ $chan ] ]
/unset %lol. [ $+ [ $+(*,.,$chan) ] ] on
/halt
}
elseif ((%poll. [ $+ [ $chan ] ] != $null) && (%yes. [ $+ [ $chan ] ] < %no. [ $+ [ $chan ] ] )) {
/msg $chan Poll: %poll. [ $+ [ $chan ] ]
/msg $chan Poll has been ended by $nick $+ . Yes Votes: %yes No Votes: %no. [ $+ [ $chan ] ]
/msg $chan $chan is more in favor of no then yes by $calc(%yes. [ $+ [ $chan ] ] - %no. [ $+ [ $chan ] ] ) Votes!
/unset %no. [ $+ [ $chan ] ]
/unset %yes. [ $+ [ $chan ] ]
/unset %poll. [ $+ [ $chan ] ]
/unset %lol. [ $+ [ $+(*,.,$chan) ] ] on
/halt
}
elseif ((%poll. [ $+ [ $chan ] ] != $null) && (%yes. [ $+ [ $chan ] ] == %no. [ $+ [ $chan ] ])) {
/msg $chan Poll: %poll. [ $+ [ $chan ] ]
/msg $chan Poll has been ended by $nick $+ . Yes Votes: %yes. [ $+ [ $chan ] ] No Votes: %no. [ $+ [ $chan ] ]
/msg $chan $chan Voted a TIE!
/unset %no. [ $+ [ $chan ] ]
/unset %yes. [ $+ [ $chan ] ]
/unset %poll. [ $+ [ $chan ] ]
/unset %lol. [ $+ [ $+(*,.,$chan) ] ] on
/halt
}
}