This is an old script that I wrote.
.poll
You can vote in private with a query to the bot:
+1 #chan
or -1 #chan
If you want you can vote in public in #chan:
+1
or -1
For finish you type .result
; Poll Script
on *:text:.poll*:#: {
if ( $nick isop $chan ) {
if ( $2 == $null ) { .msg $chan 7:: You have to insert a question. 3.poll <Question>. Ex: .poll Do you like ice cream? 7:: | halt }
if ( $readini(poll.ini,n,$chan,Question) != $null ) { .msg $chan 7::1 $nick Already is a poll working:2 $readini(poll.ini,n,$chan,Question) 7:: Questioner:2 $readini(poll.ini,n,$chan,Who) 7::1 For close the poll put 3.result 7:: | halt }
writeini poll.ini Poll Amount $calc($readini(poll.ini,n,Poll,Amount) + 1 )
writeini poll.ini $chan Who $nick
writeini poll.ini $chan Question $2-
writeini poll.ini $chan VPositive 0
writeini poll.ini $chan VNegative 0
.msg $chan 4Poll!! 7::4 $nick 2ask you the next question 7::1 $readini(poll.ini,n,$chan,Question) 7:: 1If your answer is 3positive1 /query $me and write 3+1 $chan 7::1 If your answer is 4negative1 /query $me and write4 -1 $chan 7::1 If you want public answer put in $chan 3+1 o 4-17 ::1 $nick when you want finish the poll write 3.result 7::
halt
}
else { .msg $chan 7::1 You aren't OP, you can't make a poll 7:: | halt }
}
; ## +1 QUERY
on *:text:+1*:?: {
if ($2 == $null ) { .msg $nick 7::1 You have to write 3+1 #channel 1where #channel is where is the question. 7:: | halt }
if ( $readini(poll.ini,n,$2,Question) == $null ) { .msg $nick 7::1 Any Poll active in this channel $2 check it 7:: | halt }
if ( $2 ischan ) {
if ( $nick ison $2 ) {
if ( $readini(poll.ini,n,$2,$nick) == Vote ) { .msg $nick 7::1 You already vote 7:: | halt }
else {
writeini poll.ini $2 VPositive $calc( $readini(poll.ini,n,$2,VPositive) + 1 )
writeini poll.ini $2 $nick Vote
.msg $nick 7::1 You vote 3Positive2 $readini(poll.ini,n,$2,Question) 7::
.msg $2 7::2 $nick 7:: 1vote in private the question 7::1 $readini(poll.ini,n,$2,Question) 7::
halt }
}
else { .msg $nick 7::1 You are not in $2 7::1 You have to be in $2 for vote 7:: | halt }
}
else { .msg $nick 7::1 I'm not in $2 7:: | halt }
}
; ## -1 QUERY
on *:text:-1*:?: {
if ($2 == $null ) { .msg $nick 7::1 You have to write 3+1 #channel 1where #channel is where is the question. 7:: | halt }
if ( $readini(poll.ini,n,$2,Question) == $null ) { .msg $nick 7::1 Any Poll active in this channel $2 check it 7:: | halt }
if ( $2 ischan ) {
if ( $nick ison $2 ) {
if ( $readini(poll.ini,n,$2,$nick) == Vote ) { .msg $nick 7::1 You already vote 7:: | halt }
else {
writeini poll.ini $2 VNegative $calc( $readini(poll.ini,n,$2,VNegative) + 1 )
writeini poll.ini $2 $nick Vote
.msg $nick 7::1 You vote 4Negative2 $readini(poll.ini,n,$2,Question) 7::
.msg $2 7::2 $nick 7:: 1vote in private the question 7::1 $readini(poll.ini,n,$2,Question) 7::
halt }
}
else { .msg $nick 7::1 You are not in $2 7::1 You have to be in $2 for vote 7:: | halt }
}
else { .msg $nick 7::1 I'm not in $2 7:: | halt }
}
; ## +1 CHAN
on *:text:+1*:#: {
if ( $readini(poll.ini,n,$chan,Question) == $null ) { halt }
if ( $readini(poll.ini,n,$chan,$nick) == Vote ) { .msg $nick 7::1 You already vote 7:: | halt }
else {
writeini poll.ini $chan VPositive $calc( $readini(poll.ini,n,$chan,VPositive) + 1 )
writeini poll.ini $chan $nick Vote
.msg $chan 7::2 $nick 7:: 1vote 3Positive1 the question 7::1 $readini(poll.ini,n,$chan,Question) 7::
}
}
; ## -1 CHAN
on *:text:-1*:#: {
if ( $readini(poll.ini,n,$chan,Question) == $null ) { halt }
if ( $readini(poll.ini,n,$chan,$nick) == Vote ) { .msg $nick 7::1 You already vote 7:: | halt }
else {
writeini poll.ini $chan VNegative $calc( $readini(poll.ini,n,$chan,VNegative) + 1 )
writeini poll.ini $chan $nick Vote
.msg $chan 7::2 $nick 7:: 1vote 4Negative1 the question 7::1 $readini(poll.ini,n,$chan,Question) 7::
}
}
; ## Comand RESULT
on *:text:.result:#: {
if ( $nick isop $chan ) {
if ( $readini(poll.ini,n,$chan,Question) == $null ) { .msg 7::1 No poll in $chan 7:: | halt }
.msg $chan 7::1 POLL'S RESULT 7::2 $readini(poll.ini,n,$chan,Question) 7::
.msg $chan 7::3 POSITIVES7 ::1 $readini(poll.ini,n,$chan,VPositive)
.msg $chan 7::4 NEGATIVES7 ::1 $readini(poll.ini,n,$chan,VNegative)
if ( $readini(poll.ini,n,$chan,VPositive) > $readini(poll.ini,n,$chan,VNegative) ) { .msg $chan 7::3 POSITIVES1 WIN7 :: }
if ( $readini(poll.ini,n,$chan,VPositive) < $readini(poll.ini,n,$chan,VNegative) ) { .msg $chan 7::4 NEGATIVES1 WIN7 :: }
if ( $readini(poll.ini,n,$chan,VPositive) == $readini(poll.ini,n,$chan,VNegative) ) { .msg $chan 7::1 WE HAVE A 7DRAW 7:: }
remini poll.ini $chan
}
else { .msg $chan 7::1 You are not OP 7::2 $readini(poll.ini,n,$chan,Who) ask the question 7:: | halt }
}
Sorry, is long cause I was not good scripter :3