self._adminPlugin.warnClient(event.client, 'spam') spamins = int(spamins / 1.5) event.client.setvar(self, 'spamins', spamins) raise b3.events.VetoEvent elif event.client.var(self, 'ignore_till').value > self.console.time(): #ignore the user raise b3.events.VetoEvent if __name__ == '__main__': from b3.fake import fakeConsole from b3.fake import joe p = SpamcontrolPlugin(fakeConsole, '@b3/conf/plugin_spamcontrol.xml') p.onStartup() p.info("---------- start spamming") joe.says("i'm spammmmmmmmmming") time.sleep(1) joe.says2team("i'm spammmmmmmmmming") time.sleep(1) joe.says("i'm spammmmmmmmmming") time.sleep(1) joe.says2team("i'm spammmmmmmmmming") time.sleep(1) joe.says("i'm spammmmmmmmmming") time.sleep(1) joe.says("i'm spammmmmmmmmming") p.info("_________ end of test ____________") time.sleep(1) # give console thread a chance to end gracefully
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)
else: client.message("^7The Chat Spy is [^1OFF^7]") if data == "on": if client not in self._listeners: self._listeners.append(client) client.message("^7Spy: [^2ON^7]") else: client.message("You are already spying on chats!") if data == "off": if client in self._listeners: self._listeners.remove(client) client.message("^7Spy: [^1OFF^7]") else: client.message("You are not spying on chats!") if __name__ == "__main__": from b3.fake import fakeConsole, joe, moderator, superadmin plugin = ChatspyPlugin(fakeConsole) plugin.onStartup() superadmin.connects(cid = 0) superadmin.team = 1 joe.connects(cid = 1) joe.team = 2 moderator.connects(cid = 2) moderator.team = 3 superadmin.says("!spy on") joe.says2team("haha") superadmin.says("!spy on") superadmin.says("!help spy") joe.says2team("admin is a big fat noob") superadmin.disconnects()