mIRC Homepage
Posted By: spermis Vote with static answers - 10/04/12 03:00 PM
Could someone make a snippet for me, that allows users to vote, but vote for choices that are permament and saved in a text file.

Example would be - if admin writes !presidentvote , the bot says:

Vote has started: choose to vote for Obama, Bush, Craig, George.

Then users vote with command - !vote Obama etc.
For example four people type !vote Obama , and three people !vote Craig .
The bot should automatically stop the vote after 1 minute, and then show the results like this:

Vote results: Obama - 4 , Craig - 3 .

It should show them without showing the ones which did not get any votes.
Posted By: macrobody Re: Vote with static answers - 12/04/12 02:44 PM
I found something old but maybe you can use it:

Polling options
.Conduct a poll in $chan:{
if (%pollchan != $null) {
/set %uatext Sorry, there is allready a poll in progress on %pollchan $+ !
/set %uaatext It expires in $timer(endpoll).secs seconds - please try again then.
/write votecheck.txt Checker file
/set %pollchan $chan
/set %polltitle $?="Enter poll title"
if (%polltitle == $null) { /unset %pollchan | /halt }
/set %numoptions $?="Enter number of options"
if (%numoptions == $null) { /unset %pollchan | /halt }
if ((%numoptions < 1) || (%numoptions !isnum)) goto getnumoptions
/var %counter 1
if (%counter < %numoptions + 1) {
/var %option $?="Enter option %counter $+ "
if (%option == $null) { /unset %pollchan | /halt }
/write voteoptions.txt 0 %option
/inc %counter
goto getoptions
/set %timelimit $?="Enter voting time limit in seconds"
if (%timelimit == $null) { /unset %pollchan | /halt }
if ((%timelimit < 1) || (%timelimit !isnum)) goto getlimit
.Abort current poll:{
if (%pollchan == $null) {
/set %uatext There is no poll in progress at the moment.
else {
/set %timeleft $timer(endpoll).secs
/set %aborted 1
.timerendpoll off
Posted By: sparta Re: Vote with static answers - 13/04/12 06:04 AM
You can go here and look if you find something for you.


Search the Addon, Snippets and Tutorials section.
Posted By: spermis Re: Vote with static answers - 13/04/12 10:16 AM
I know, I didnt find anything that suits my needs. frown
Posted By: sparta Re: Vote with static answers - 13/04/12 10:22 AM
Look at the addons you find there, you asked for a tutorial, see how they made it and try make fit ur needs..
© mIRC Discussion Forums