2
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
The creator of these plugins has not shown activity in a while. Posting in this board may not result in a fast reply or a reply at all. [ Read the full Support Disclaimer here ]
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Voting Plugin  (Read 40010 times)

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Voting Plugin
« on: May 30, 2009, 06:01:26 AM »
NOTE: You might want to check out: http://www.bigbrotherbot.net/forums/releases/voting-plugin-2804/ an updated version of my plugin by danger89

The idea behind this plugin is to enable only regular users to call on votes. There are two votes implemented, votemap and votekick.

Limiting votekick is to avoid noobs trying to kick out good players.
Limiting votemap is to avoid constant map changes by noobs. Also, it limits the votable maps.

Votekick should work on all games as this uses the bot's method of kicking. Votemap will work on games which use "map mapname" command to change map.

Regular users can be set by use of !makereg command or the !putgroup (though that command is by default limited to level 90 and above).

This code hasn't been thoroughly tested. Please report any bugs you find!


********* New functionality provided *********

!votekick or !vk
Initiate a votekick against a player.
The votes can only be initated by players above configured level. Admins can't be voted out.
If more than tempban_minvotes players vote, and more than tempban_percent of them are "yes", the player will be tempbanned for tempban_interval.

!votemap or !vm
Initate a votemap for a map.
If the map is in maplist.txt, a vote will be carried out. Players only need to write a substring of the map's name. For example, if they wish to vote "ut4_austria", they can type "!vm aus" (assuming no other map has that string in their name).

!maplist or !mapl
Lists all the available maps on the server. (Reads maplist.txt)

!voteyes or !vy
!voteno or !vn
Vote yes or no in the current vote.

!voteveto or !vveto
Veto the current vote

*** Configurable variables ***
min_level_*
Set the minimal level for the command.

vote_times
How many times the bot tells how the vote is going and asks for votes. When the times are up, the vote ends.

vote_interval
Approximate time between failed votes.

tempban_minvotes
tempban_interval
tempban_percent
If more than tempban_minvotes players vote, and more than tempban_percent of them are "yes", the player will be tempbanned for tempban_interval.

mapfile
File to read the allowed maps for voting.

Download:
Voting1.5.zip



« Last Edit: February 14, 2011, 12:10:37 AM by Ismael »

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: Votekick
« Reply #1 on: May 30, 2009, 10:05:19 AM »
surely promote does the same thing as !makereg?
I do like the votekick idea though!

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: Votekick
« Reply #2 on: May 30, 2009, 01:02:19 PM »
What game is it designed for?

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Re: Votekick
« Reply #3 on: May 30, 2009, 05:17:00 PM »
This was thought for Urban Terror, but there isn't any UrT specific code so it might work on many other games.

About !makereg, doc says:
!makereg <name>
Level 80
Scope Public

make a name a regular * Level 1 user

Level 1? Isn't that the same as the player doing !register? Though, I just tested the command, and yes, it does what it should (make it a level 2 user). I'll remove the !promote in the next version.

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Re: Votekick
« Reply #4 on: May 30, 2009, 06:37:59 PM »
Ok. I removed the !promote command. Use !makereg to make registered users :)

I added a delay between failed votes, though it isn't working exactly as I expected. If I ask for it to clear a user in 3 minutes, it does so in a time like 10, 20, 30... and not in between. I'm using OneTimeCronTab(command, 0, "*/somenumber"). Is this the Right Way?

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Votekick
« Reply #5 on: May 30, 2009, 06:58:05 PM »
for cron related commands, "*/x" means "every x minutes".
So that might not be what you want for a OneTimeCronTab.
Hope that helps

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Re: Votekick
« Reply #6 on: May 30, 2009, 11:16:23 PM »
But if I use just a number, it doesn't do anything :(

Offline eire.32

  • Echelon v2. Dev.
  • Former Dev. (senate)
  • Full Member
  • *****
  • Posts: 114
    • e32designs.com
Re: Votekick
« Reply #7 on: May 31, 2009, 02:40:07 PM »
Now that you have a voting framework could you extend it so that it can choose a map vote? I know thats a little more orientated but if the map names were in the config then there should be no reason the python code bit needs to be different for each game if it just calling the name of the map from config file.

Is this a little hard or do able?

I do really love this plugin though, good stuff.
Eire.32
Eire.32

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Re: Votekick
« Reply #8 on: May 31, 2009, 06:27:58 PM »
Yes, it can be done, and it's not very complicated. I just wanted to do this one first. In a not so far future I'll implement votemap too.

I'd like to remark that all this is possible thanks to the great framework that B3 is. It's amazing how much you can extend it :)

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: Votekick
« Reply #9 on: June 07, 2009, 10:09:17 AM »
Ismael, I noticed that you can get one of your vars from the admin plugin.

you could use
Code: python [Select]
self._adminPlugin.config.get("settings","admins_level")


one less configurable to worry about :)

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Re: Votekick
« Reply #10 on: June 13, 2009, 11:30:50 PM »
New release:
!vk requires a motive to kick
If more than a certain percent of voters vote yes, the victim is tempbanned
Added !vkveto
Modlevel is read from admin plugin settings (thanks Bakes)

Offline Ismael

  • Moderator
  • Full Member
  • *
  • Posts: 70
Re: Voting Plugin
« Reply #11 on: July 25, 2009, 09:02:53 PM »
New release.

Now can vote map! Available maps are read from a file.
Easier to extend to other votes.

Offline leonpadi

  • Full Member
  • ***
  • Posts: 53
Re: Voting Plugin
« Reply #12 on: August 05, 2009, 02:32:39 PM »
Ismael congratulations for your efforts :)
I would like to ask you about Call of Duty 4.
Even if i didn't tested yet, i would like to see your plugin to work like this...

The server admin puts the available maps in a file.
For example, file's contents are...

Map1
Map2
Map3
Map4
Map5

Now, suppose people are voting to play Map3, and so be it, Map3 starts.
After Map3's end, i would like not to see the Map3 to be available for the next map votings.
So only...

Map1
Map2
Map4
Map5

...will be available for voting.

If Map1 is selected...after it's end, this map (Map1) should not be in the list for the next map.
For the next map, the list of available maps should be...

Map2
Map4
Map5

Then if Map4 selected, after it ends,  only...

Map2
Map5

...maps should be available...

And after Map2's end (or Map5 which could have been voted as well), there will be only AutoVoting for the last (and not played yet) map.

After all these maps, the script should be able to start again and so on...

It may be a scripting headpain, but it's something unique which possibly gives another twisting power on server's admin hands.

Offline Nox1V

  • Newbie
  • *
  • Posts: 1
Re: Voting Plugin
« Reply #13 on: December 21, 2009, 07:19:07 PM »
Hi,

To start i would like to thank Ismael for the idea, because i have a Windows UrT server and without the EXE fix for the callvote hack this is the best way to mantain votes on my server without the danger of being hacked.

I noticed a problem in the plugin, dunno why it happens, but at some point users call for !vm and the plugin says that there is a vote already running and we have to wait until it ends, question is, no vote is running and we wait like 20 mins and it's always saying the same message, most of the times i have to restart bot so users can vote again.

Hope someone have an idea of what's wrong.

Thanks

Nox

Offline danger89

  • Full Member
  • ***
  • Posts: 129
    • JoinMyServer - Game Servers
Re: Voting Plugin
« Reply #14 on: December 26, 2009, 10:52:27 PM »
The plugin does work, but sometimes (alot actually) it keep saying:
Quote
A vote is already in progress, wait until it finishes

So we can't vote, and yes the latest vote was a long time ago  ???

Is this a common bug? I'm get the latest (1.5) version of this Vote plugin using CoD4.

thx already

Kind regards,
Melroy
« Last Edit: December 26, 2009, 11:05:32 PM by danger89 »
JoinMyServer.com
Call of Duty 4 Game Servers

 


Rate this page +1 at Google Search