## initialize gametype fakeConsole.game.gameType = 'ctf' ############# END setup test environment ################## print "================= ROUND 1 ===================" joe.takesFlag() joe.says('!flag') simon.returnsFlag() simon.takesFlag() time.sleep(1.5) simon.capturesFlag() time.sleep(0.5) simon.says('!flag') jack.takesFlag() time.sleep(0.8) jack.capturesFlag() time.sleep(0.5) jack.says('!fs') simon.takesFlag() time.sleep(1.23) simon.capturesFlag() time.sleep(0.5) simon.says('!fs') fakeConsole.queueEvent(b3.events.Event(b3.events.EVT_GAME_EXIT, None)) time.sleep(1)
</settings> </configuration> """) p = ChatloggerPlugin(fakeConsole, conf1) p.onLoadConfig() p.onStartup() joe.connects(1) simon.connects(3) joe.says("sql injec;tion ' test") joe.sendsPM("sql; injection ' test", simon) joe.says("!help sql injection ' test;") joe.name = "j'oe" simon.name = "s;m'n" joe.says("sql injection test2") joe.sendsPM("sql injection test2", simon) joe.says("!help sql injection test2") joe.name = "Joe" simon.name = "Simon" while True: joe.says("hello") simon.says2team("team test") joe.sendsPM("PM test", simon) simon.says("!help test command") time.sleep(20)
joe.kills(simon) moderator.kills(joe) print "-------------------------" fakeConsole.queueEvent(b3.events.Event(b3.events.EVT_GAME_ROUND_END, None, None)) time.sleep(5) print "-------------------------" joe.says('!duelcancel') moderator.kills(joe) moderator.kills(simon) print "-------------------------" joe.says('!duelreset') simon.kills(moderator) simon.kills(moderator) simon.kills(moderator) moderator.kills(joe) """ joe.connects(cid=1) simon.connects(cid=2) simon.groupBits = 1 joe.says('!duel simon') simon.says('!duel joe') time.sleep(1) joe.disconnects() while True: time.sleep(1)
</settings> <settings name="preferences"> <set name="no_level_check_level">20</set> </settings> </configuration> """) p = Poweradminbf3Plugin(fakeConsole, conf) p.onLoadConfig() p.onStartup() simon.connects("simon") simon.teamId = 1 moderator.connects('moderator') moderator.teamId = 2 superadmin.connects('superadmin') superadmin.teamId = 2 print "Simon's group is " + simon.maxGroup.name print "Moderator's group is " + moderator.maxGroup.name print "superadmin's group is " + superadmin.maxGroup.name assert p.no_level_check_level == 20 print "\n\n####################################### Simon should not be able to !changeteam Moderator" simon.says("!changeteam Moderator") print "\n\n####################################### moderator should be able to !changeteam God" moderator.says("!changeteam God") print "\n\n####################################### God should be able to !changeteam Moderator" superadmin.says("!changeteam Moderator")
<settings name="preferences"> <set name="no_level_check_level">20</set> </settings> </configuration> """) p = Poweradminbf3Plugin(fakeConsole, conf) p.onLoadConfig() p.onStartup() simon.connects("simon") simon.teamId = 1 moderator.connects('moderator') moderator.teamId = 2 superadmin.connects('superadmin') superadmin.teamId = 2 print "Simon's group is " + simon.maxGroup.name print "Moderator's group is " + moderator.maxGroup.name print "superadmin's group is " + superadmin.maxGroup.name assert p.no_level_check_level == 20 print "\n\n####################################### Simon should not be able to !changeteam Moderator" simon.says("!changeteam Moderator") print "\n\n####################################### moderator should be able to !changeteam God" moderator.says("!changeteam God") print "\n\n####################################### God should be able to !changeteam Moderator" superadmin.says("!changeteam Moderator")
You can use the following syntax as well 3d : purge all chat older than 3 days 2w : two weeks 6m : six month 1y : one year --> <set name="max_age">0</set> <!-- The purge action takes place once a day at the time define below. Default time is midnight --> <set name="hour">0</set> <!-- hour between 0 and 23 --> <set name="min">0</set> <!-- min between 0 and 59 --> </settings> </configuration> """) p = ChatloggerPlugin(fakeConsole, conf1) p.onStartup() joe.connects(1) simon.connects(3) while True: joe.says("hello") time.sleep(5) simon.says("hi") time.sleep(5) joe.says2team("team test") time.sleep(20)
p = Poweradminbf3Plugin(fakeConsole, conf) p.onLoadConfig() p.onStartup() simon.connects("simon") simon.teamId = 1 simon.squad = 7 joe.connects('Joe') joe.teamId = 1 joe.squad = 7 moderator.connects('moderator') moderator.teamId = 2 moderator.squad = 5 superadmin.connects('superadmin') superadmin.teamId = 2 superadmin.squad = 6 print "Joe's group is " + joe.maxGroup.name print "Simon's group is " + simon.maxGroup.name print "Moderator's group is " + moderator.maxGroup.name print "superadmin's group is " + superadmin.maxGroup.name assert p.no_level_check_level == 20 print "\n\n####################################### moderator should be able to swap God" moderator.says("!swap God") print "\n\n####################################### simon should not be able to swap Moderator" simon.says("!swap Moderator") print "\n\n####################################### God should be able to swap Moderator" superadmin.says("!swap Moderator")
joe.kills(simon) moderator.kills(joe) print "-------------------------" fakeConsole.queueEvent(b3.events.Event(b3.events.EVT_GAME_ROUND_END, None, None)) time.sleep(5) print "-------------------------" joe.says('!duelcancel') moderator.kills(joe) moderator.kills(simon) print "-------------------------" joe.says('!duelreset') simon.kills(moderator) simon.kills(moderator) simon.kills(moderator) moderator.kills(joe) """ joe.connects(cid=1) simon.connects(cid=2) simon.groupBits = 1 joe.says("!duel simon") simon.says("!duel joe") time.sleep(1) joe.disconnects() while True: time.sleep(1)
p.onLoadConfig() p.onStartup() simon.connects("simon") simon.teamId = 1 simon.squad = 7 joe.connects('Joe') joe.teamId = 1 joe.squad = 7 moderator.connects('moderator') moderator.teamId = 2 moderator.squad = 5 superadmin.connects('superadmin') superadmin.teamId = 2 superadmin.squad = 6 print "Joe's group is " + joe.maxGroup.name print "Simon's group is " + simon.maxGroup.name print "Moderator's group is " + moderator.maxGroup.name print "superadmin's group is " + superadmin.maxGroup.name assert p.no_level_check_level == 20 print "\n\n####################################### moderator should be able to swap God" moderator.says("!swap God") print "\n\n####################################### simon should not be able to swap Moderator" simon.says("!swap Moderator") print "\n\n####################################### God should be able to swap Moderator" superadmin.says("!swap Moderator")