Everything's pretty straightfoward. Just type !poll for the questions and options etc. And then type !answer (option) for sending in your vote. Typing !answer voted will show you the results. You may only vote once per poll.
CREATE YOUR POLL FIRST! Right click on any channel/status or open the commands menu and hover over 'Poll'. You have the options: Clear Poll, which completely makes the poll blank. Create new poll will make a new poll.
;----------------------------------;
; Poll Script - By Elite Charizard ;
;----------------------------------;
on !*:TEXT:!poll:#:{
msg $chan Current poll: $readini poll.ini questions question
msg $chan Options: $readini poll.ini questions options
msg $chan How to vote: Type !answer option.
}
on !*:TEXT:!answer*:#:{
if $readini poll.ini voted $address($nick,2) == lol {
msg $chan Sorry, $nick $+ , but you have aldready voted in this poll.
msg $chan Votes: A: %OptionA - B: %OptionB - C: %OptionC - D: %optionD
}
elseif $2- = A || $2- = B || $2- = C || $2- = D {
inc %Option $+ $2
msg $chan Voted for: $2
msg $chan Votes: A: %OptionA // B: %OptionB // C: %OptionC // D: %OptionD
writeini poll.ini voted $address($nick,2) lol
}
elseif $2 = votes {
msg $chan Votes: A: %OptionA // B: %OptionB // C: %OptionC // D: %OptionD
}
else {
msg $chan Invalid Option. Valid Options: A B C and D. Please type !poll for question and options.
msg $chan Votes: A: %OptionA // B: %OptionB // C: %OptionC // D: %OptionD
}
}
menu status,channel,menubar {
.Poll
..Clear:{
if ($$?!="Are you sure you want to clear this poll? This cannot be undone." == $true) {
/remini poll.ini voted
/writeini poll.ini questions question No Question Yet
/writeini poll.ini questions options No Options
}
}
..Create New:{
/remini poll.ini voted
/writeini poll.ini questions question $$?="Question:"
/writeini poll.ini questions options A. $$?="Option A:" - B. $$?="Option B:" - C. $$?="Option C:" - D. $$?="Option D:"
/set %OptionA 0
/set %OptionB 0
/set %OptionC 0
/set %OptionD 0
}
}