BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Age of Conan Archive => AoC 0.6.x Custom/Unofficial modules => Topic started by: Glarawyn on September 21, 2009, 08:48:46 pm
-
I've updated my Vote Core module and Simple Vote (http://bebot.link/0-4-x-customunofficial-modules/vote-core-module-and-simple-vote/) modules for BeBot 0.6.
About the module:
This is a core module to deal with holding an election/poll/vote on BeBot 0.6. Votes are not maintained on a bot restart, so it is designed to be a short (seconds or minutes) poll. Results of the vote are recorded to the database for future reference. Currently there is nothing coded for displaying the historical information logged to the database.
The Vote_Core.php module will help you in creating your own modules that use voting.
I've included SimpleVote.php which is what I used to test things. SimpleVote lets you create a simple yes/no vote.
Commands provided by Vote_Core.php:
/tell yourbot !vote <voteid> <option>
Commands provided by SimpleVote.php:
/tell yourbot !simplevote Enter a yes/no question here.
Installation:
Extract VoteCore_1.0.0.zip to your custom directory.
Download:
Vote_Core_1.0.0.zip (http://code.campalot.info/bebot-code/bebot-0-6-2/Vote_Core_1.0.0.zip?attredirects=0&d=1)
-
Thanks for this one mate! :)
Having problems downloading the file though.
-
Fixed the link in the original post. ;D
-
kk nice module ... but how i can see the result ???
-
kk nice module ... but how i can see the result ???
The included Simple Vote module will display the results automatically at the end of the vote.
-
ah kk ... works fine ... ty
-
Re: Simplevote
Is it possible to get feedback on how many voted yes vs no in the result?
Edit: Just looked through the code and is it so that the module actually only records enough votes in order to get a majority? As in if there's 20 available members to use the poll and the module collects 11 Yes, it will announce the result even though only a bit more that 50% did vote?
-
Re: Simplevote
Is it possible to get feedback on how many voted yes vs no in the result?
Edit: Just looked through the code and is it so that the module actually only records enough votes in order to get a majority? As in if there's 20 available members to use the poll and the module collects 11 Yes, it will announce the result even though only a bit more that 50% did vote?
SimpleVote only creates new votes using VoteCore. All votes are registered through he core module. The information you are looking for is recorded in the database. Results are recorded in the database.
The missing piece is displaying history of the votes, which should be added to vote core...
The vote history table has the following columns:
- voteid: Timestamp the vote was started.
- topic: The question posed to voters.
- options: Options posed to voters. (Each option is separated by a semicolon)
- tally: The tally for each option. Again semicolon separated.
- total_votes: Total numver of cotes registered.
- winner: which option won the vote.
-
The vote_core.php errors on bot restart in line 331. The bot won't restart with it
-
First thanks for developing this module! I find it very useful.
In my case there aren't any errors, but it seems to give incorrect results. One member voted YES and two NO, but the bot gave YES as result.
Bot output: Botname [GROUP] [MSG] [Guild Name] Seshafi: !simplevote Rename guild to "Followers of Seshafi"
Botname [GROUP] [MSG] [Guild Name] Botname: Vote in progress: [link]Rename guild to "Followers of Seshafi"[/link]
Botname [TELL] [INC] AAA: !vote 1258494850 0
Botname [TELL] [OUT] -> AAA: Your vote for option 0 in vote number 1258494850 was registered successfully.
Botname [TELL] [INC] Seshafi: !vote 1258494850 1
Botname [TELL] [OUT] -> Seshafi: Your vote for option 1 in vote number 1258494850 was registered successfully.
Botname [GROUP] [MSG] [Guild Name] Botname: Vote in progress: [link]Rename guild to "Followers of Seshafi"[/link]
Botname [TELL] [INC] BBB: !vote 1258494850 0
Botname [TELL] [OUT] -> BBB: Your vote for option 0 in vote number 1258494850 was registered successfully.
Botname [GROUP] [MSG] [Guild Name] Botname: Vote in progress: [link]Rename guild to "Followers of Seshafi"[/link]
Botname [GROUP] [MSG] [Guild Name] Botname: Vote in progress: [link]Rename guild to "Followers of Seshafi"[/link]
Botname [GROUP] [MSG] [Guild Name] Botname: Vote in progress: [link]Rename guild to "Followers of Seshafi"[/link]
Botname [GROUP] [MSG] [Guild Name] Botname: Vote in progress: [link]Rename guild to "Followers of Seshafi"[/link]
Botname [GROUP] [MSG] [Guild Name] Botname: Vote number 1258494850 [Rename guild to "Followers of Seshafi"] Result: Yes!
MySQL table _vote_history after voting is done:
INSERT INTO `Botname_vote_history` (`voteid`, `topic`, `options`, `tally`, `total_votes`, `winner`) VALUES
(1258494850, 'Rename guild to "Followers of Seshafi"', '0:No;1:Yes;', '1:1;', 3, 1);
As you can see, it hasn't recorded votes for 0 (only 1:1;), tho' it has increased votes count (3).
Any help much appreciated.
-
the download link doesn't work anymore...does anyone have the files?
Thanks
-
Had a few hiccups (weather, transportation, holidays) moving my server to a new hosting facility. Server is up now in my basement crawlspace, and at least some of the DNS records have rolled over. You should be able to grab files now. :D
-
For simplevote could bot output: 187 votes result is yes with xx votes.
-
Its is no longer avaiable, could you reupload it , thanks
-
yeah would be nice :D
-
DynamicDNS didn't update. Fixed that and things should be good to go again.
-
I am sorry to say that but Download link doesn't work any more
-
Does anyone still have this module and could load it up, please?
-
I moved all my BeBot stuff over to http://code.campalot.info. You can find the module there.
http://code.campalot.info/bebot-code/bebot-0-6-2/Vote_Core_1.0.0.zip?attredirects=0&d=1
-
thx