You are here: Big Brother Bot ForumCommunity DevelopersPlugin Developerscustom commands (new plugin)
Pages: [1]   Go Down
  Print  
Author Topic: custom commands (new plugin)  (Read 1262 times) Bookmark and Share
Jr. Member
**
OS: Windows
Type: Renting Server, no B3
Gameservers: cod4
Posts: 19
Offline Offline
« on: October 14, 2011, 05:31:44 AM »

hey all

for my clan server i sould like to have some custom commands,
the problem is non of is is that advanced in programming.

i've already been able to set the !rules from max 20 to max 40 (we have 32 rules)
now i whant to be able to do exactly the same as the normal !rules but only for a few of them.
as our rules are scrambled, we would like the ability to give players rules that are only the tactical once or only the server rules (like english only, chat spamming, abusive lnguage ect)
we also would like to be able to spam only 1 rule (like the !spam), but this only to 1 player, we had this on our b3 but our clan fell appart and is started up again now and we miss these commands in b3 (the command was !sr)

i sould like to have some additional commands like !mp and !setmp (!mp telling people who is currently in command of bans ect and !setmp to change between moderators or admins)

can someone help me writing a plugin like that or does it already exists or does a part of it already exists?


thank you

edit:
already tryied some but python is not a language for me, i'll stick to c++/c/vb.net/html/css
http://pastebin.com/8PjBTzBc
« Last Edit: October 14, 2011, 05:53:17 AM by Blacky » Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #1 on: October 14, 2011, 08:11:21 AM »

This !spam <rule> [<person>], I'd be glad to see in new version of the bot:) However I'm not sure if the devs will look into this.

If you've got programming skills in other languages, then writing such simple plugin shouldn't be the problem for you. I'm currently quite busy with other things, but if you'd like to write your own plugin for this !mp thing, you can make it simpler. Don't use !setmp command, but read from the database players of desired level.
Logged

Jr. Member
**
OS: Windows
Type: Renting Server, no B3
Gameservers: cod4
Posts: 19
Offline Offline
« Reply #2 on: October 14, 2011, 09:02:08 AM »

well i'm working on it :p
i wouldn't say i got skills at programming, but i'm a quick learner on languages.
if yiu count html and css as programming then you can say i'm quite skilled :p
but c++/c/vb.net is just in the learning phase.

i'll look into already made plugins to see the possibility's and try to assemble it out of that.
now i'm working on that plugin that can spam part of the rules but i didn't figure out how to read the rules out of the plugin_admin.xml using another plugin.

if there are persons whit more skill than me who whant to assist me i would kindly accept

my xfire: dutywascalled
Logged
Sr. Member
****
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 180
Offline Offline
WWW
« Reply #3 on: October 14, 2011, 10:15:43 AM »

This allows you to do !spam rule1 for every or !spam name rule1 for just that person
Code:
    def cmd_spam(self, data, client=None, cmd=None):
        """\
        [<name>] <message> - spam a predefined message
        """
        input = self.parseUserCmd(data)
        if not input:
            client.message('^7Invalid parameters')
            return False
        if input[1]:
            cid = input[0]
            sclient = self.findClientPrompt(cid, client)

            if sclient:
                m = re.match('^([^ ]{2,})$',input[1])
                if not m:
                    client.message('^7Invalid parameters')
                    return False

                keyword = m.group(1)
                s = self.getSpam(keyword)
                if s:
                    sclient.message(s)
                else:
                    client.message('^7Could not find spam message %s' % keyword)
            else:
                return False
        else:
            m = re.match('^([^ ]{2,})$', data)
            if not m:
                client.message('^7Invalid parameters')
                return False

            keyword = m.group(1)
            s = self.getSpam(keyword)
            if s:
                self.console.say(s)
            else:
                client.message('^7Could not find spam message %s' % keyword)

just replace def cmd_spam in the admin plugin with this code.
Logged

Jr. Member
**
OS: Windows
Type: Renting Server, no B3
Gameservers: cod4
Posts: 19
Offline Offline
« Reply #4 on: October 14, 2011, 11:22:17 AM »

thx spoon!

its not the !sr as i'm used to but it sould do the same!
now only working on that !tr thingy
Logged
Sr. Member
****
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 180
Offline Offline
WWW
« Reply #5 on: October 14, 2011, 11:26:46 AM »

so what does !mp and !tr do? add me on xfire and i will see if i can help you with these commands. xfire: EHDSpoon
Logged

Jr. Member
**
OS: Windows
Type: Renting Server, no B3
Gameservers: cod4
Posts: 19
Offline Offline
« Reply #6 on: October 14, 2011, 01:04:41 PM »

!tr sould spam the tactical rules lets say teh tactical rules are Rule1-rule5 and rule8 so it sould spam rule 1 to 5 and rule 8
!mp, maybe i sould change it to !asset, and it sould be use by all players to see who is in command of assets
(and !setasset <playername allies> <playername axis> sould set who is in charge)
Logged
Jr. Member
**
OS: Windows
Type: Renting Server, no B3
Gameservers: cod4
Posts: 19
Offline Offline
« Reply #7 on: October 31, 2011, 01:24:02 PM »

so i got following command from spoon

Code:
def cmd_spam(self, data, client=None, cmd=None):
        """\
        [<name>] <message> - spam a predefined message
        """
        input = self.parseUserCmd(data)
        if not input:
            client.message('^7Invalid parameters')
            return False
        if input[1]:
            cid = input[0]
            sclient = self.findClientPrompt(cid, client)

            if sclient:
                m = re.match('^([^ ]{2,})$',input[1])
                if not m:
                    client.message('^7Invalid parameters')
                    return False

                keyword = m.group(1)
                s = self.getSpam(keyword)
                if s:
                    sclient.message(s)
                else:
                    client.message('^7Could not find spam message %s' % keyword)
            else:
                return False
        else:
            m = re.match('^([^ ]{2,})$', data)
            if not m:
                client.message('^7Invalid parameters')
                return False

            keyword = m.group(1)
            s = self.getSpam(keyword)
            if s:
                self.console.say(s)
            else:
                client.message('^7Could not find spam message %s' % keyword)

how can i get it that it says to the spammer that (if command* is used) that the rule is being spammed to A user

*!s black rule1
Logged
Newbie
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: CoD7
Posts: 9
Offline Offline
« Reply #8 on: February 20, 2012, 07:17:55 PM »

Hi, I am sorry this is kinda late.

I need some help I am trying to put you command lines into my server and
I am not sure where to put this in.

Any help would be appreciated.
Logged
Support Hero
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: 2x CoD4, 1x BF3
Posts: 2627
Offline Offline
Owner of Host4B3.com - Over 70 bots hosted!
WWW
« Reply #9 on: February 21, 2012, 05:39:32 AM »

Hi, I am sorry this is kinda late.

I need some help I am trying to put you command lines into my server and
I am not sure where to put this in.

Any help would be appreciated.

The code spoon posted goes into the admin.py in the plugins folder. You will only have this if you use a source install.
Logged

Need B3 Bot hosting? Check out Host4B3.com
Check Twitter.com/Host4B3 for updates if the site it down.

Help will be given to those with a b3.log

System: Python 2.7.1 - B3 Source Code - Locally hosted MySQL & Apache - Win 2k3
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal