Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
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 By Beber888  (Read 9860 times)

Offline Need

  • Jr. Member
  • **
  • Posts: 11
Re: Voting Plugin By Beber888
« Reply #15 on: January 08, 2013, 06:03:49 PM »
Thank you very much for the plugin, works perfect.

But if you upgrade some plugins, I can mention something more practical for the command (! Vm) and must currently written as such: (! Vm ut4_tohunga_b10) and could be simplified by writing just a name string, say so: (! vm tohu) and mentioned this reconosca map completely without writing their name, as some are very long and difficult to remember his name.

thanks
regards

Offline LouK

  • Full Member
  • ***
  • Posts: 119
    • The Sni:{Per}:Jum Clan
Re: Voting Plugin By Beber888
« Reply #16 on: January 13, 2013, 02:26:53 AM »
Hey!

Nice plugin! I also added !votenextmap(based on knightork's code(http://forum.bigbrotherbot.net/plugins-by-ismael/voting-plugin/15/))

here is the code with nextmap vote(I couldn't post it here because it was very long): http://forums.6326.n7.nabble.com/Add-votenextmap-for-voting-plugin-td320.html


But I have a problem, all is fine except the sniperonly plugin, could you tell me what is wrong in the .py?(I set my own commands, but knifeonly and pistolony is working, idk why this isn't)

b3.log:
Code: [Select]
CONSOLE	'19:42 say: 4 ^3:^2{^7Per^5}^3:^7LouK: !votesniperonly'
130113 05:20:34 VERBOSE 'Client Found: :{Per}:LouK on slot 4'
130113 05:20:34 VERBOSE 'Queueing event Say !votesniperonly'
130113 05:20:34 VERBOSE 'Parsing Event: Say: AdminPlugin'
130113 05:20:34 DEBUG 'AdminPlugin: OnSay handle 5:"!votesniperonly"'
130113 05:20:34 DEBUG 'AdminPlugin: Handle command !votesniperonly'
130113 05:20:34 VERBOSE "RCON sending (198.144.176.204:27960) 'g_gear'"
130113 05:20:34 VERBOSE 'RCON: More data to read in socket'
130113 05:20:35 DEBUG 'Get cvar g_gear = ["g_gear" is:"None^7" default:"0^7"]'
130113 05:20:35 VERBOSE "RCON sending (198.144.176.204:27960) 'tell 4 ^7 ^3[pm]^7 ^7There was an error processing your command'"
130113 05:20:35 ERROR 'handler AdminPlugin could not handle event Say: ValueError: invalid literal for int() with base 10: \'None\' [(\'/home/louk/BigBrotherBot/b3/parser.py\', 1008, \'handleEvents\', \'hfunc.parseEvent(event)\'), (\'/home/louk/BigBrotherBot/b3/plugin.py\', 158, \'parseEvent\', \'self.onEvent(event)\'), (\'/home/louk/BigBrotherBot/b3/plugin.py\', 176, \'onEvent\', \'self.handle(event)\'), (\'/home/louk/BigBrotherBot/b3/plugins/admin.py\', 235, \'handle\', \'self.OnSay(event)\'), (\'/home/louk/BigBrotherBot/b3/plugins/admin.py\', 380, \'OnSay\', \'results = command.execute(data, event.client)\'), (\'/home/louk/BigBrotherBot/b3/plugins/admin.py\', 2028, \'execute\', \'self.func(data, client, copy.copy(self))\'), (\'/home/louk/BigBrotherBot/b3/plugins/voting.py\', 304, \'cmd_votesniper\', \'if not self._currentVote.start_vote(data, client):\'), (\'/home/louk/BigBrotherBot/b3/plugins/voting.py\', 908, \'start_vote\', "self.GearAvant = self.console.getCvar(\'g_gear\').getInt()"), (\'/home/louk/BigBrotherBot/b3/cvar.py\', 54, \'getInt\', \'return int(self.value)\')]'
130113 05:20:35 VERBOSE 'Parsing Event: Say: CensorPlugin'
130113 05:20:35 VERBOSE 'Parsing Event: Say: SpamcontrolPlugin'
130113 05:20:35 VERBOSE 'Parsing Event: Say: TranslatorPlugin'
130113 05:20:35 VERBOSE 'Parsing Event: Say: ChatloggerPlugin'
130113 05:20:35 DEBUG 'ChatloggerPlugin: ALL, 2, :{Per}:LouK, !votesniperonly'
130113 05:20:35 DEBUG 'ChatloggerPlugin: writing to file'
130113 05:20:35 DEBUG 'ChatloggerPlugin: rowcount: 1, id:7747'
130113 05:20:35 VERBOSE 'Parsing Event: Say: ExtraadminPlugin'
130113 05:20:35 ERROR "RCON: too much tries. Abording ('tell 4 ^7 ^3[pm]^7 ^7There was an error processing your command')"
130113 05:20:35 DEBUG 'RCON: Did not send any data'
130113 05:20:36
I also tried changing to many different names the command, but idk

Thanks
« Last Edit: January 13, 2013, 02:39:20 AM by LouK »

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Voting Plugin By Beber888
« Reply #17 on: January 13, 2013, 03:23:38 AM »
It looks like B3 failed to read your game server cvar g_gear

Offline LouK

  • Full Member
  • ***
  • Posts: 119
    • The Sni:{Per}:Jum Clan
Re: Voting Plugin By Beber888
« Reply #18 on: January 13, 2013, 04:00:26 AM »
It looks like B3 failed to read your game server cvar g_gear
and why it works with knife and pistol?

Offline LouK

  • Full Member
  • ***
  • Posts: 119
    • The Sni:{Per}:Jum Clan
Re: Voting Plugin By Beber888
« Reply #19 on: January 13, 2013, 06:54:12 PM »
Fixed! I just changed a line that(i think) was wrong at line 17 of class SniperOnlyVote (at the end of the voting.py)

From:
self.GearAvant = self.console.getCvar('g_gear').getInt()


to:

self.GearAvant = self.console.game.gear

here my class SniperOnlyVote (voting.py)
Code: [Select]
class SniperOnlyVote:
    _adminPlugin = None
    console = None
    config = None

    _data = None
    _client = None

    def startup(self,  adminPlugin,  console,  config):
        """\
        Initialize plugin settings
        """

        self._adminPlugin = adminPlugin
        self.console = console
        self.config = config

    def start_vote(self,  data,  client):
        self._data = data
        self._client = client
        self.GearAvant = self.console.game.gear
        return True

    def Fin_SO(self):
        self.console.write('g_gear %s' % self.GearAvant)
        self.console.say('^6SNIPER ONLY ^1OFF')
        VotingPlugin.ModeEnCours = False
        VotingPlugin.ModeSniperOnly = False

    def vote_reason(self):
        return "to play with sniper weapons"

    def end_vote_yes(self,  yes,  no):
        VotingPlugin.ModeEnCours = True
        VotingPlugin.ModeSniperOnly = True
        self.console.write('g_gear 61')
        self.console.say('^6SNIPER ONLY ^7(^5%s^7 min)' % VotingPlugin.time_sniperonly)
        TimeSO = VotingPlugin.time_sniperonly * 60
        VotingPlugin.TempoSniperOnly = threading.Timer(TimeSO, self.Fin_SO)
        VotingPlugin.TempoSniperOnly.start()


    def end_vote_no(self,  yes,  no):
        self.console.say("No sniper only!")

Also notify that you forgot the letter "i" in the "min" (self.console.say('^6SNIPER ONLY ^7(^5%s^7 mn)' % VotingPlugin.time_sniperonly))

Offline Need

  • Jr. Member
  • **
  • Posts: 11
Re: Voting Plugin By Beber888
« Reply #20 on: January 16, 2013, 07:14:33 PM »
Thank you very much, everything works well so far.

regards

|D42C|Killerchris (GER)

  • Guest
Re: Voting Plugin By Beber888
« Reply #21 on: March 23, 2013, 05:57:44 PM »
Hey :D

I Got a Problem there..

I Installed the Plugin on the actual B3 Version, and so far it is going on.

But it tells me that the Moon Vote is not possible.

I got Superadmin, and on !h it is not listed.

I had it running about 1 Year ago on b3 1.7.3 or something) perfectly...

If you Need Log/Config or whatever just tell me ;)

Offline dopi

  • Newbie
  • *
  • Posts: 7
Re: Voting Plugin By Beber888
« Reply #22 on: April 02, 2013, 10:17:53 AM »

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: Voting Plugin By Beber888
« Reply #23 on: April 03, 2013, 12:54:29 AM »
Python, Php, UrT SourceCode

Offline dopi

  • Newbie
  • *
  • Posts: 7
Re: Voting Plugin By Beber888
« Reply #24 on: April 03, 2013, 09:15:29 AM »

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: Voting Plugin By Beber888
« Reply #25 on: April 03, 2013, 10:32:20 PM »
Python, Php, UrT SourceCode

Offline dopi

  • Newbie
  • *
  • Posts: 7
Re: Voting Plugin By Beber888
« Reply #26 on: April 05, 2013, 11:24:21 PM »
« Last Edit: April 05, 2013, 11:35:18 PM by dopi »

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: Voting Plugin By Beber888
« Reply #27 on: April 06, 2013, 10:10:58 PM »
Python, Php, UrT SourceCode

Offline dopi

  • Newbie
  • *
  • Posts: 7
Re: Voting Plugin By Beber888
« Reply #28 on: April 08, 2013, 10:51:00 AM »

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: Voting Plugin By Beber888
« Reply #29 on: April 08, 2013, 09:51:45 PM »
« Last Edit: April 08, 2013, 10:04:24 PM by Beber888 »
Python, Php, UrT SourceCode

 


Rate this page +1 at Google Search

anything