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!

You are here: Big Brother Bot ForumAdd-OnsPlugins Discussion (Moderator: MordyT)Lets talk about rules...
Pages: [1]   Go Down
  Print  
Author Topic: Lets talk about rules...  (Read 646 times) Bookmark and Share
Moderator
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: 2x CoD4, 1x BF3
Posts: 2627
Offline Offline
Owner of Host4B3.com - Over 70 bots hosted!
WWW
« on: August 28, 2011, 03:19:44 PM »

Ok, so recently we were taking a look at expanding our B3 bot to take more load off the admins... and one of the things that came up was rules. How to send rules in many languages, etc. So I take a look, here is the international rules plugin... https://github.com/Rhidalin-Bytes/International-rules
Download, extract the .py to extplugins, the .xml to extplugins/conf and the .rules files to /bot/rules/
Edit the .xml, have it load in the b3.xml right under plugin_admin... try to start the bot, it would not start. Log attached. So is my b3.xml and my rules.xml

Several Questions...
1) So this plugin completely replaces the rules built in? So in my plugin_admin.xml those rules are disregarded?
2) What does the first command (the rules-r) do? If a player (level 1) tries to use it will he be able to since by default it is set to 20?
3) Why won't b3 start?

thanks for all your help!
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

Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #1 on: August 28, 2011, 03:57:12 PM »

1) If you just do !rules with no language then it uses the default rules from plugin_admin.xml
2) The default for using the new rules is 20, you can set it to what you want though.
3) Do you have rules files for the 2 default languages in the xml?
Logged
Moderator
*
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 #2 on: August 28, 2011, 04:48:11 PM »

1) If you just do !rules with no language then it uses the default rules from plugin_admin.xml
2) The default for using the new rules is 20, you can set it to what you want though.
3) Do you have rules files for the 2 default languages in the xml?

For 2: So I need to set that to 0 so all guests can see the rules, correct? Or will they be able to use !rules and get the rules from plugin_admin.xml without that being changed? I guess I am confused why it would be set to 20 just to see that rules? unless that is for spamming the rules to other players?

Here is the deal. I want to be able to do !rules player es and have it spam the rules in es to that player. But I also want the player to be able to do !rules and see the rules (as typed in plugin_admin.xml). I do not want a player (guest) to be able to do !rules player es and send the rules to someone...

3) I have:
/bot/rules/cryll.rules
/bot/rules/czech.rules
/bot/b3/extpluginsKH/rules.py
/bot/b3/extpluginsKH/conf/rules.xml


the rules.xml is as follows:
Code:
<configuration plugin="rules">
<settings name="commands">
        <set name="rules-r">20</set>
        <set name="languages-lang">20</set>
    </settings>
    <settings name="files">
        <set name="czech">/bot/rules/czech.rules</set>
        <set name="cryll">/bot/rules/cryll.rules</set>
    </settings>
</configuration>
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
Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #3 on: August 28, 2011, 07:33:58 PM »

We don't allow new players to spam themselves the rules, even the default ones, which is why the level is set to 20, and why Rhidalin wrote it the way that he did.

Looking at the code, it may not allow a non-admin to spam the rules to someone with an equal or higher level than themselves, but you would have to run a test to find out.

Do your language files have non-ascii/ANSI characters in them? I wonder if that is causing the problem with the encoding. We have our files converted to ascii for it to work, and I believe that dbcs is an ANSI encoding

Logged
Moderator
*
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 #4 on: August 29, 2011, 04:46:46 AM »

We don't allow new players to spam themselves the rules, even the default ones, which is why the level is set to 20, and why Rhidalin wrote it the way that he did.

Looking at the code, it may not allow a non-admin to spam the rules to someone with an equal or higher level than themselves, but you would have to run a test to find out.

Do your language files have non-ascii/ANSI characters in them? I wonder if that is causing the problem with the encoding. We have our files converted to ascii for it to work, and I believe that dbcs is an ANSI encoding



Ok.
2 Last things...
1) We are using the 2 files included without any mods. We have not even edited them yet... Maybe I need to specify how they are uploaded in filezilla? Saw that once with SMF and avatars...

2) Your explanations are great. I assume the lang variable in the .xml is the level needed to use other languages... i.e. !rules es would only work if you had that level or higher, correct?
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
Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #5 on: August 29, 2011, 04:59:11 AM »

To be honest, I hadn't even looked in the conf folder and seen those 2 files there!!!!!  I would try using files that don't have any non ascii characters in them and see if that solves the encoding problem.

The !lang just gives a list of the available languages and their spellings to the admin, it doesn't spam any rules.
Logged
Moderator
*
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 #6 on: August 29, 2011, 05:50:42 AM »

To be honest, I hadn't even looked in the conf folder and seen those 2 files there!!!!!  I would try using files that don't have any non ascii characters in them and see if that solves the encoding problem.

The !lang just gives a list of the available languages and their spellings to the admin, it doesn't spam any rules.

Ok. So I made a en.rules (attached as e.rules.txt) and modded my rules.xml (see rules.xml attached). Started the bot, errored out. Log attached.

Thanks so much for helping with this, I do appreciate it.
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
Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #7 on: August 29, 2011, 06:49:32 AM »

OK, found that dbcs is windows only!

Try editing rules.py and replace dbcs in line 54:

in_file = codecs.open(self.files[n], 'r', 'dbcs')

with latin_1 and see if that gets it running at least.
Logged
Moderator
*
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 #8 on: August 29, 2011, 06:59:08 AM »

Just to confirm:

Find:
Code: python
                for n in self.files:
                   in_file = codecs.open(self.files[n], 'r', 'dbcs')
                   L = in_file.readline()
Replace with:
Code: python
                for n in self.files:
                   in_file = codecs.open(self.files[n], 'r', 'latin_1')
                   L = in_file.readline()
Correct?

EDIT: Made that change and it works... When I get home I will hop into the server and test. But the bot starts now.
« Last Edit: August 29, 2011, 08:32:03 AM by MordyT » 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
Moderator
*
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: August 29, 2011, 05:22:14 PM »

Ok, so I logged into the server did a !rules ultra en rule2... did not work.

According to help...
^3[pm]^7 ^2!rules ^7- say the rules with option language or single rule. <target> <language> <rule number> !languages for list'"

Error in log shown below.

P.S. !rules ultra rule2 also has the same error.

Let me know if you need anything else.

Code: php
110830 04:55:31	VERBOSE	'StatusPlugin: Building XML status'
110830 04:55:31 DEBUG 'StatusPlugin: Writing XML status to /bot/xlr/statusKH.xml'
110830 04:55:31 CONSOLE '7009:00 say;3cd4813b4f3f48e0e5f818c7fc5933f4;3;RvO[*]Mordy;\x15!rules ultra en rule2'
110830 04:55:31 VERBOSE 'Queueing event Say !rules ultra en rule2'
110830 04:55:31 VERBOSE 'Parsing Event: Say: AdminPlugin'
110830 04:55:31 DEBUG 'AdminPlugin: OnSay handle 5:"!rules ultra en rule2"'
110830 04:55:31 DEBUG 'AdminPlugin: Handle command !rules ultra en rule2'
110830 04:55:31 VERBOSE "RCON sending (85.234.137.75:2304) 'tell 3 [^4R^1vO^4B^1ot^7]: ^3[pm]^7 Yes sir, spamming the rule(s) to ultra rockazzZ^7'"
110830 04:55:31 ERROR "STDERR 'Unhandled exception in thread started by '"
110830 04:55:31 ERROR "STDERR '\\n'"
110830 04:55:31 ERROR "STDERR 'Traceback (most recent call last):\\n'"
110830 04:55:31 ERROR 'STDERR \'  File "/bot/b3/extpluginsKH/rules.py", line 135, in _sendRules\\n\''
110830 04:55:31 ERROR "STDERR '    '"
110830 04:55:31 ERROR 'STDERR "rus.append(self._adminPlugin.config.getTextTemplate(\'spamages\', \'rule%s\' % rule))\\n"'
110830 04:55:31 VERBOS2 'Say event handled by AdminPlugin in 0.000 ms'
110830 04:55:31 CONSOLE '7009:00 D;940d882ce5568a1ecd171f709fa18962;10;allies;{AOD}Static;71766c47abfe159ea630602a1bb4dc45;11;axis;dreadydetty;ak47_mp;47;MOD_RIFLE_BULLET;torso_lower'
110830 04:55:31 VERBOSE 'Parsing Event: Say: ChatloggerPlugin'
110830 04:55:31 DEBUG 'ChatloggerPlugin: ALL, 2, RvO[*]Mordy, !rules ultra en rule2'
110830 04:55:31 VERBOS2 'Aborted Making Alias for cid: 11, name is the same'
110830 04:55:31 DEBUG 'ChatloggerPlugin: writing to file'
110830 04:55:31 DEBUG 'ChatloggerPlugin: writing to database'
110830 04:55:31 VERBOS2 'Aborted Making Alias for cid: 10, name is the same'
110830 04:55:31 ERROR 'STDERR \'  File "/bot/b3/config.py", line 112, in getTextTemplate\\n\''
110830 04:55:31 VERBOSE "Queueing event Client Damage (47.0, 'ak47_mp', 'torso_lower', 'MOD_RIFLE_BULLET')"
110830 04:55:31 ERROR "STDERR '    '"
110830 04:55:31 ERROR "STDERR 'value = b3.functions.vars2printf(self.get(section, setting, True)).strip()\\n'"
110830 04:55:31 ERROR 'STDERR \'  File "/bot/b3/config.py", line 109, in get\\n\''
110830 04:55:31 ERROR "STDERR '    '"
110830 04:55:31 ERROR "STDERR 'raise ConfigParser.NoOptionError(setting, section)\\n'"
110830 04:55:31 ERROR "STDERR 'ConfigParser'"
110830 04:55:31 ERROR "STDERR '.'"
110830 04:55:31 ERROR "STDERR 'NoOptionError'"
110830 04:55:31 DEBUG 'ChatloggerPlugin: rowcount: 1, id:4414'
110830 04:55:31 ERROR "STDERR ': '"
110830 04:55:31 ERROR 'STDERR "No option \'ruleen rule2\' in section: \'spamages\'"'
110830 04:55:31 ERROR "STDERR '\\n'"
110830 04:55:31 CONSOLE '7009:00 D;940d882ce5568a1ecd171f709fa18962;10;allies;{AOD}Static;71766c47abfe159ea630602a1bb4dc45;11;axis;dreadydetty;ak47_mp;7;MOD_RIFLE_BULLET;torso_lower'
110830 04:55:31 VERBOS2 'Aborted Making Alias for cid: 11, name is the same'
110830 04:55:31 VERBOS2 'Aborted Making Alias for cid: 10, name is the same'
110830 04:55:31 VERBOSE "Queueing event Client Damage (7.0, 'ak47_mp', 'torso_lower', 'MOD_RIFLE_BULLET')"
110830 04:55:31 VERBOS2 'Say event handled by ChatloggerPlugin in 10.000 ms'
110830 04:55:31 VERBOSE 'Parsing Event: Say: TranslatorsPlugin'
110830 04:55:31 VERBOS2 'Say event handled by TranslatorsPlugin in 0.000 ms'
110830 04:55:31 VERBOSE 'Parsing Event: Client Damage: AntinoobPlugin'
110830 04:55:31 CONSOLE '7009:00 D;c2bbc9a7ff1037be8a15726ac34ea349;7;axis;PrinceOfPersia;940d882ce5568a1ecd171f709fa18962;10;allies;{AOD}Static;p90_reflex_mp;42;MOD_PISTOL_BULLET;torso_upper'
110830 04:55:31 VERBOS2 'Aborted Making Alias for cid: 10, name is the same'
110830 04:55:31 VERBOS2 'Aborted Making Alias for cid: 7, name is the same'
110830 04:55:31 VERBOSE "Queueing event Client Damage (42.0, 'p90_reflex_mp', 'torso_upper', 'MOD_PISTOL_BULLET')"
110830 04:55:31 VERBOS2 'Client Damage event handled by AntinoobPlugin in 0.000 ms'
110830 04:55:31 VERBOSE 'Parsing Event: Client Damage: XlrstatsPlugin'
110830 04:55:31 VERBOSE 'XlrstatsPlugin: ---> XLRstats: Not enough damage done to award an assist'
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
Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #10 on: August 30, 2011, 07:25:41 PM »

It was broken, try the version here:

https://82ndab-Bravo17@github.com/82ndab-Bravo17/International-rules.git

Just use !rules name language no

eg !rules mordy swahili 3
Logged
Moderator
*
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 #11 on: August 31, 2011, 04:34:26 AM »

It was broken, try the version here:

https://82ndab-Bravo17@github.com/82ndab-Bravo17/International-rules.git

Just use !rules name language no

eg !rules mordy swahili 3

Awesome. I update the file on my server (had to switch the dbcs to latin_1 to get it to start) and tonight when I get home I will test (can't get telnet plugin working, but that is another story)
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