Sign in to follow this  
Followers 0
Fedzor

Party Chat for Deathrun 1.2- Python/b3 Plugin W.I.P

22 posts in this topic

Okay so the last plugin i posted, i was exposed, i have worked on this for the past 30 min now, it's not done, but i think it's a good idea, and is looking good so far, let me know what you think :)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

# Author: Fedzor & GHz
# Plugin: PartyChat
# How it works: !startparty, creates a party for the player that executed the cmd, !invite PlayerName, adds the players to your party, !partykick PlayerName, Kicks the player from the party.
# faggot's: mist.
# [This Plugin is for use with deathrun, big brother bot.
# ------------------------------------------------------------------------
import b3
import b3.events
import functions
import re
import string
import sys
import threading
import time
import traceback
import Cod4
import Variables

class ClientVar(voice):
    value = On

def startparty(self, value):
self.value = on
return 0

return int(self.value)

_command = startparty
_commandexec = open.chatlobby

def  invite <PLAYER_PID>(self, value):
self.value = on
return 0

return int(self.value)

_command = invite <PLAYER_PID>
_commandexec = find. <PLAYER_PID> iPrintinBold "<PLAYER_PID> has invtied you to their party, !yes or !no"
_command = yes
_commandexec = add <PLAYER_PID>
_command = no
_commandexec = Return 0

def partykick <PLAYER_PID>(self, value):
self.value = on
return 0

return int(self.value)

_command = partykick
_commandexec = adm kick:&&1

return:
_command
_commandexec
import

0

Share this post


Link to post
Share on other sites

Not sure what you're trying to accomplish, but good luck with it.

 

Couple of comments based on what I've seen so far:

 

Following code may be a bit messy since I'm a nub:

The way you've declared your class is wrong, and b3 will throw an error

class PartychatPlugin(b3.plugin.Plugin):
  _adminPlugin = None
This code is unnecessary, as you can just declare these as global variables in the beginning of the class.

return int(self.value)


_command = partykick
_commandexec = adm kick:&&1


return:
_command
_commandexec
import
I'd remove all but the following based on what I've seen so far:

import b3, re
import b3.events
import time
Add this to your first line of the code, otherwise none of your commands will work

def startup(self):
    """\
    Initialize plugin settings
    """

    # get the admin plugin so we can register commands
    self._adminPlugin = self.console.getPlugin('admin')
    if not self._adminPlugin:
      # something is wrong, can't start without admin plugin
      self.error('Could not find admin plugin')
      return False
      

    # register our commands
    if 'commands' in self.config.sections():
      for cmd in self.config.options('commands'):
        level = self.config.get('commands', cmd)
        sp = cmd.split('-')
        alias = None
        if len(sp) == 2:
          cmd, alias = sp

        func = self.getCmd(cmd)
        if func:
          self._adminPlugin.registerCommand(self, cmd, level, func, alias)

    self.debug('Started')
Add this as your second function, as you can add commands by defining a function

def getCmd(self, cmd):
    cmd = 'cmd_%s' % cmd
    if hasattr(self, cmd):
      func = getattr(self, cmd)
      return func

    return None
Add this as well, this allows for interception of events called via gamelog

def onEvent(self, event):
    """\
    Handle intercepted events
    """

This is an example of my code from previous project: 

if event.type == b3.events.EVT_GAME_MAP_PREV:
                        self.Prevmap = event.data
                        self.Prevmapscore = self.console.getCvar('dr_info_%s' % (event.data))
                        self.stripscoredata(self.Prevmapscore)
                        self.verbose("[MapSave]: Saving Scores For %s" % (str(self.Prevmap)))
                        self.verbose("[MapSave]: Score for %s is '%s'" % (str(self.Prevmap),str(self.Prevmapscore)))
                        if self.Prevmapscore != None:
                                con = mdb.connect(self.Hostname,self.Username,self.Password,self.Database)
                                cur = con.cursor()
                                cur.execute("SELECT * FROM mapsave WHERE mapname = '%s'" % (str(self.Prevmap)));
                                if (cur.rowcount == 0):
                                        try:
                                                cur.execute("INSERT INTO mapsave (mapname,score) VALUES ('%s','%s')" % (str(self.Prevmap),str(self.Prevmapscore)))
                                                time.sleep(10)
                                                self.console.say("[MapSave]: Successfully inserted new scores!")
                                        except:
                                                self.error('[MapSave]: Error Inserting New Scores For %s' % (str(self.Prevmap)))
                                                time.sleep(10)
                                                self.console.say("[MapSave] Encountered an error inserting new scores!")
                                else:
                                        try:
                                                cur.execute("UPDATE mapsave SET score = '%s' WHERE mapname = '%s'" % (str(self.Prevmap),str(self.Prevmapscore)))
                                                time.sleep(10)
                                                self.console.say("[MapSave]: Successfully updated scores!")
                                        except:
                                                self.error('[MapSave]: Error Updating New Scores For %s' % (str(self.Prevmap)))
                                                time.sleep(10)
                                                self.console.say("[MapSave]: Encountered an error updating scores!")
                        else:
                                time.sleep(10)
                                self.console.say("[MapSave]: There was no previous map to save or an error has occurred!")
                elif event.type == b3.events.b3.events.EVT_GAME_MAP_CURR:
                        self.Currmap = event.data
                        con = mdb.connect(self.Hostname,self.Username,self.Password,self.Database)
                        cur = con.cursor()
                        cur.execute("SELECT * FROM mapsave WHERE mapname = '%s'" % (str(self.Currmap)));
                        if (cur.rowcount == 0):
                                self.console.say("[MapSave]: No Scores For This Map. Can You Beat The Scores?")
                                self.verbose("[MapSave]: Map %s Has No Scores" % (str(self.Currmap)))
                        else:
                                try:
                                        row = cur.fetchone()
                                        cmapname = str((row[1]))
                                        ckillval = str((row[2]))
                                        ckillguid = str((row[3]))
                                        ckillplayer = str((row[4]))
                                        cdeathsval = str((row[5]))
                                        cdeathsguid = str((row[6]))
                                        cdeathsplayer = str((row[7]))
                                        cheadshotsval = str((row[8]))
                                        cheadshotsguid = str((row[9]))
                                        cheadshotsplayer = str((row[10]))
                                        cscoreval = str((row[11]))
                                        cscoreguid = str((row[12]))
                                        cscoreplayer = str((row[13]))
                                        cknifesval = str((row[14]))
                                        cknifesguid = str((row[15]))
                                        cknifesplayer = str((row[16]))
                                        ctimeval = str((row[17]))
                                        ctimeguid = str((row[18]))
                                        ctimeplayer = str((row[19]))
                                        ctotal = ';kills,%s,%s,%s;deaths,%s,%s,%s;headshots,%s,%s,%s;score,%s,%s,%s;knifes,%s,%s,%s;time,%s,%s,%s' % ((killval),(killguid),(killplayer),(deathsval),(deathsguid),(deathsplayer),(headshotsval),(headshotsguid),(headshotsplayer),(scoreval),(scoreguid),(scoreplayer)(knifesval),(knifesguid),(knifesplayer),(timeval),(timeguid),(timeplayer))
                                        self.console.write("set dr_info_%s %s" % (str(self.cmapname),str(self.ctotal)))
                                        self.verbose("[MapSave]: Map %s Has Has Scores, Getting Default Scores Ready For Map End" % (cmapname))
                                        time.sleep(10)
                                        self.console.say("[MapSave]: Type !mapscore To View The Scores. Can You Beat The Scores?")
                                except:
                                        self.error("[MapSave]: Something Unexpected Has Happened! Mapname:%s Scores:%s" % ((self.cmapname),(ctotal)))

Add commands using the following:

def cmd_site(self, data, client, cmd=None):
    """\
    !site - What is our website
       """
    cmd.sayLoudOrPM(client, 'Our website is www.raid-gaming.net')
    return True

Good luck finishing the plugin!

0

Share this post


Link to post
Share on other sites

You haven't helped with any of it yet -_-

It isn't yours plugin, otherwise you would have posted the corresponding .GSC part of it  :dave:

 

 

It's my last warning, if you post a code that isn't yours and you'll claim you're the author, I will ban you from forums.

0

Share this post


Link to post
Share on other sites

BraXi, on 07 Mar 2015 - 09:58 AM, said:

BraXi, on 07 Mar 2015 - 01:58 AM, said:

It isn't yours plugin, otherwise you would have posted the corresponding .GSC part of it :dave:

It's my last warning, if you post a code that isn't yours and you'll claim you're the author, I will ban you from forums.

this is mine and fedzor plugin no hate to him all to me

0

Share this post


Link to post
Share on other sites

It isn't yours plugin, otherwise you would have posted the corresponding .GSC part of it  :dave:

 

 

It's my last warning, if you post a code that isn't yours and you'll claim you're the author, I will ban you from forums.

Braxi i was in a call with him, and he laughing his ass off when he posted that, this only took me 20 min to design but if i'm getting blamed for stealing a plugin, then ban me from this forum, idgaf anymore, you obviously go straight to the conclusion that he's telling the truth, and i don't like that, you only look at one side of everything, if i have to stay away from the forums because people seem to hate me, including my internet best friend @SpeedArTz, maybe i should just retire from deathrun, i am trying to make a mence, but i'm failing epicly, i'm not posting anymore of my creations to this forum, because i steal all of them right? -_-

0

Share this post


Link to post
Share on other sites

, if i have to stay away from the forums because people seem to hate me, including my internet best friend @SpeedArTz, maybe i should just retire from deathrun, 

 

I don't know how many times you're going to say that you're going to stop playing deathrun and that you're going to leave, but if you're going to keep threatening it, you may as well just bloody do it..

 

 

Secondly, BraXi didn't say that he believed SpeedArtz over you, he said that you didn't make it for the reason being that you didn't post any of the files that would have made it work on ANY server, you only posted the plugin for B3 itself. 

0

Share this post


Link to post
Share on other sites

I don't know how many times you're going to say that you're going to stop playing deathrun and that you're going to leave, but if you're going to keep threatening it, you may as well just bloody do it..

 

 

Secondly, BraXi didn't say that he believed SpeedArtz over you, he said that you didn't make it for the reason being that you didn't post any of the files that would have made it work on ANY server, you only posted the plugin for B3 itself. 

The script is no where near finnished, so why would i post a file that won't work?

 

0

Share this post


Link to post
Share on other sites

if it's nowhere near finished, why would you post the current code for it? That would mean others can take it.

0

Share this post


Link to post
Share on other sites

if it's nowhere near finished, why would you post the current code for it? That would mean others can take it.

I was pretty much looking for feedback from the community on what they thought.

0

Share this post


Link to post
Share on other sites

Then you could have posted the idea and asked what people think :P If you post your code online to the public before it's finished there's a good chance someone will steal it, just letting you know.

0

Share this post


Link to post
Share on other sites

Then you could have posted the idea and asked what people think :P If you post your code online to the public before it's finished there's a good chance someone will steal it, just letting you know.

Ok, well, Thanks for the info.

0

Share this post


Link to post
Share on other sites

You know it's fedzor because it's messy and there's no spacings/tabs etc :dave:

0

Share this post


Link to post
Share on other sites

You know it's fedzor because it's messy and there's no spacings/tabs etc :dave:

i know, i'm a nub  :lol:

0

Share this post


Link to post
Share on other sites

maybe i should just retire from deathrun

 

If you enjoy Deathrun, and "retire from it" just because of my post, then lets be honest - you're hurting yourself like an emo because I can only say "fine, your decission" and forget :dave:

 

i'm not posting anymore of my creations to this forum, because i steal all of them right? -_-

 

Thank God, whatever you posted was buggy and incomplete... :doge: But if you change your mind (I asume you'll do it soon) and release something "half baked", at least mention it so other people don't try to install an incomplete plugin :dave: OH!.. and joking about ownership isn't smart :dave:

 

 

However, my post isn't a hate bait, I'm just telling the truth so #nohate  #keepcalm #benice #friends4lyfe :dave:

2

Share this post


Link to post
Share on other sites

Pointless thread is pointless, since fedzor is now banned

 

Locked.

1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0