minomino / minqlbot Goto Github PK
View Code? Open in Web Editor NEWAn administration tool for the Quake Live client, extensible with plugins.
License: GNU General Public License v3.0
An administration tool for the Quake Live client, extensible with plugins.
License: GNU General Public License v3.0
!silence mutes a player but doesn't unmute it when the time expires. Also, if I try to use !unsilence it doesn't work neither.
Sometimes bot is disconnected from server and I have this message logged from console as reason.
Maybe this msg can be ignored somehow instead of disconnecting?
maybe it should trigger abort event?.....
Recently 'server host' server went down with all game servers. Bot unload following this event, and therefore autoconnect plugin couldn't work (and join specified person as fallover after reconnect)
I noticed that sometimes during balance, sb that was being switched is left on spec.
Probably QL loosing packets. Maybe switch should perform some final check to assure proper switching even if some command is lost on its way to server?
I added a plugin called mute.py and put it in the config.cfg plugin list. I can get most of the stuff to work but I can't get the bot to execute the auto mute on player connect. Here is the contents of the mute.py file:
import minqlbot
import time
class mute(minqlbot.Plugin):
def init(self):
super().init()
self.add_hook("player_connect", self.handle_player_connect, minqlbot.PRI_NORMAL)
self.add_command("mute", self.cmd_mute, 1, usage="")
self.add_command("unmute", self.cmd_unmute, 1, usage="")
self.add_command("addmute", self.cmd_addmute, 2)
self.add_command("delmute", self.cmd_delmute, 2)
#self.mute_timer = None
def handle_player_connect(self, player):
self.delay(5, self.check_mute(player))
def cmd_mute(self, player, msg, channel):
if len(msg) < 2:
return minqlbot.RET_USAGE
n = self.find_player(msg[1])
if n:
self.mute(n)
else:
channel.reply("^7I do not know '{}'.".format(msg[1]))
def cmd_unmute(self, player, msg, channel):
if len(msg) < 2:
return minqlbot.RET_USAGE
n = self.find_player(msg[1])
if n:
self.unmute(n)
else:
channel.reply("^7I do not know '{}'.".format(msg[1]))
def cmd_addmute(self, player, msg, channel):
if len(msg) < 1:
return
name = msg[1].lower()
#Permission level 5 players not auto mutable
if self.has_permission(name, 5):
channel.reply("^6{}^7 has permission level 5 and cannot be auto muted.".format(name))
return
else:
c = self.db_query("SELECT * FROM Mutes WHERE name=?", name)
if not c.fetchone():
self.db_query("INSERT INTO Mutes VALUES(?, 0, 0, 0, 0)", name)
self.db_commit()
self.db_query("UPDATE Mutes SET active=1 WHERE name=?", name)
self.db_commit()
channel.reply("^6{} ^7has been added to the Auto Mute list.".format(name))
n = self.find_player(msg[1])
if n:
self.mute(n)
def cmd_delmute(self, player, msg, channel):
if len(msg) < 1:
return
else:
name = msg[1].lower()
c = self.db_query("SELECT * FROM Mutes WHERE name=?", name)
delmute = False
for row in c:
if row[1]: # if active Mute
self.db_query("UPDATE Mutes SET active=0 WHERE name=? AND issued=?", row[0], row[2])
self.db_commit()
delmute = True
if delmute:
channel.reply("^6{}^7 has been removed form the auto mute list.".format(name))
n = self.find_player(msg[1])
if n:
self.unmute(n)
else:
channel.reply("^7No active auto mutes on ^6{}^7 found.".format(name))
def check_mute(self, player, channel):
channel.reply("Start")
config = minqlbot.get_config()
channel.reply("0")
if "Mute" in config and "AutoMute" in config["Mute"]:
auto_pass = config["Mute"].getboolean("AutoMute")
channel.reply("1")
if auto_pass:
channel.reply("2")
name = self.clean_name(player).lower()
c = self.db_query("SELECT * FROM Mutes WHERE name=?", name)
for row in c:
if name == row["name"] and row["active"]:
channel.reply("3")
self.mute(name)
channel.reply("^6{}^7 has been muted. Msg BarelyMiSSeD or xXThatDudeXx if this is in error.".format(player))
The addmute and delmute seem to be working but when a player connects nothing happens. I put the commands "channel.reply("1")" and the ones like it in to see where it was getting in the code, but I am not seeing any messages at all when a player in the mutes database is added, not even the "Start" message. Any ideas?
i have set up the bot, one on standalone and one on steam btw,,, anyway in either case my bot have permission level 0, obviously with admin or referee status,,any help?
From IRC:
<Thaya> you know those times when you use like a shortcut of someones name for a cmd
<Thaya> and theres a dude with the exact same first letters in name
<Thaya> so you end up doing something completely different sometimes
<Thaya> it should actually just cancel the command when this happens
<Thaya> and maybe throw a message like "there's two players whos names start with 'abc'"
<Thaya> it doesn't happen a lot but it's annoying as FUCK if it does
<Thaya> you can ruin rounds + cause global confusion etc
<Thaya> so worth fixing imo
Is there a limit to the amount of commands that can be added, or a naming convention that can't be used?
I tried adding a command in essentials.py like so:
self.add_command("protect", self.cmd_protect, 4, usage="<full_name>")
def cmd_protect(self, player, msg):
if len(msg) < 2:
return minqlbot.RET_USAGE
but if doesn't work when I say !protect in quake live. Any ideas?
The bot balances teams after a shuffle vote passes. However I noticed that it doesn't balance teams when the server does an automatic shuffle. Could you implement it, please?
Hey, the enhancement request is pretty self-explanatory, it'd be great to have a feature that automatically bumps longest playing player up to 1/2/3 admin levels.
This stuff is confusing me
in original q3 code, server ignores commands if they are send with less delay than 1s
I need to manually press ESC to avoid infinite awating gamestate. We should have some automatic workaround.
I am running Windows 7 Professional 64 bit. I installed the 32 bit versions of python and Visual C++ and I keep getting 'failed to inject' when I try to run Minjection.exe. I ran Dependency Walker and the only thing that shows as RED is the CPU (x64 in red) on the system dll files. This is a fresh installation of windows on a pc that I run Teamspeak and Murmur voice servers.
Any ideas what I need to do next? I would love to try out the server bot.
The bot will time out in IRC at times. I don't know why, but is there a way to get the bot to reconnect to IRC without restarting Quake Live?
I would like to use the vote passing feature, but it is currently set to pass a vote if the majority votes yes. I would like to be able to set that value to something like 75% and to turn not use the auto pass if it is a map vote outside of warm-up.
I was looking through the python files and I found the start of the process in the essentials.py file. Do you have something like this in the works? Or is it something I an easily edit?
Thanks
probably doable with extraql but would be much cleaner if builtin
could write plugin that for subscribed ppl could for example announce new matches (players .. waiting etc.) or similar.
invites don't work that well as they are not displayed in-game. Sometimes ppl want me to let them know when they could join.
If I try to modify a single character of the minqlbot.dll and then I try to inject it says "Failed to inject". I thought I hadn't some dependencies but everything was ok. How is it possible? And how can I modify the minqlbot.dll without breaking it?
Trying to inject your bot @MinoMino - always getting "Failed to inject".
Here's some screenshots:
i'd like to hook to event like this to capture debug msgs in plugin.
Probably it would be best to move almost everything that can be moved from minqlbot to minqlbot-plugins. It would make development easier and minqlbot 'core' could be improved and made less complex, more stable and reliable.
Just thought I'd put this as a sort of warning, if you will. It's very likely I'll switch to a client-server NoSQL database when the Steam exclusive update hits. Why? Primarily for the following reasons:
At the time of writing, I'm leaning towards MongoDB, as I've worked with it before, has a first-party Python driver and has good documentation.
it raises exception:
except NonexistentPlayerError:
self.__invalidate("Tried to initialize a Player instance of a nonexistant player.")
but its needed to represent player that is not on server, for future-proof implementations for example all functions should pass Player instances instead of names. Behind the scenes, in methods like 'getelo' player instance could be used of the player that exists but is not necessarily on server and whose lets say steam id was found in some other way.
I am trying to get a random response from the bot when someone types the bot's name (other). I edited the code in the fun.py but I can't get it to work. Any ideas? Here is the code from the file:
import minqlbot
import random
class fun(minqlbot.Plugin):
def init(self):
self.add_command("cookies", self.cmd_cookies)
self.add_command("<3", self.cmd_heart, channels=("chat", "team_chat", "tell"))
self.add_command("stfu", self.cmd_stfu)
self.add_command("other", self.cmd_other)
self.add_command("flowers", self.cmd_flowers)
self.add_command("lies", self.cmd_lies)
self.add_command("foc", self.cmd_foc)
def cmd_cookies(self, player, msg, channel):
channel.reply("^7For me? Thank you, {}!".format(player))
def cmd_heart(self, player, msg, channel):
s = ("^1\r oo oo"
"\no o o o"
"\no o o"
"\n o o"
"\n o o"
"\n o o"
"\n o")
channel.reply(s.replace("o", "\x08"))
def cmd_stfu(self, player, msg, channel):
channel.reply("^1Fuck You ^2{}^1! ^7You can't stop my ^4POWER^1!!".format(player))
def cmd_other(self, player, msg, channel):
fo = open("other.txt","r")
ln = sum(1 for line in fo)
sl = random.randrange(1, ln + 1)
fo.close()
global othertext
othertext = open("other.txt","r").readline(sl)
channel.reply(othertext.format(player))
#othertext.close()
def cmd_flowers(self, player, msg, channel):
channel.reply("^7Awww, ^1Flowers ^7are so thoughtful {}^7. Still no sex for you!".format(player))
def cmd_lies(self, player, msg, channel):
channel.reply("^1LIES?!? ^7Who is full of lies? {} ^7You should kick the liar!".format(player))
def cmd_foc(self, player, msg, channel):
channel.reply("^1F^7.O.^4C^7 The ^1BEST^7 clan in the ^2World^1!^7!^4!".format(player))
The part that doesn't work is the cmd_other. I worked in the python IDLE command line and I was able to verify that I can read a random line from a file using the code I have in that command, but it doesn't work when I put the code in here. Does it have something to do with "channel.reply(othertext.format(player))"?
Here is a sample line from the other.txt file:
^7I am just a bot {}^7. I can’t give your life meaning!!
ignore if it is the correct behavior that map event fires, and fires even before bot connect event.
I'd like to run both a server bot and my normal client, is this somehow possible? I've tried to copy the relevant files into a new directory (including all the .pk3s), but when I try to launch the game it tells me that I cannot run quakelive.exe directly and need to run the launcher.
I could fire up a Virtual Machine, but this seems kind of excessive just for the server management.
Some people have asked me about it. Fairly trivial to implement, so I'll likely do this.
A feature to make a TOP 500 Ca server would be nice. With elo encreasing all the time, you have to adjust elo higher, when players get higher elos. Making a rank/top feature, you would not have to care about elo changing.
Shouldn't be too hard to implement, since the bot already knows your rank.
From #minqlbot on Quakenet.
<quaker_oats> Is it normal for example my binds for \dropflag and \droppowerup to be delayed if minqlbot is active ?
<@mitch> Yes
<quaker_oats> Any way to remedy?
<@mitch> No, it's how the bot works :> Mino can explain it better than I can off the top of my head
<@Mino> Oh wow, I had no idea those commands were passed through the text channel.
<quaker_oats> Ah
<@Mino> That's kinda dumb.
<quaker_oats> ?
<@Mino> Basically there are two channels, one is text-based and has stuff like team changes, chat, getting scores, and so on. The other one has stuff like players' movement, shooting, jumping, etc.
<@Mino> And it's unexpected to hear that dropflag and such isn't taken care of by the latter.
<@Mino> The bot has a queue system for the former channel to avoid having the bot and the user execute commands more or less at the same time, because the server will simply ignore one of them if you do so.
<quaker_oats> My bind for "\team s" is delayed a split second also in case you're wondering anything like that
<@Mino> So if dropflag is one of the delayed ones, it means that if you were to press dropflag and a chat bind more or less at the same time, only one will go through.
<quaker_oats> And also "\team r" and "\team b"
<@Mino> Which is pretty dumb, in my opinion.
<@mitch> Off the top of my head, I would guess it's to stop spam
<@mitch> Seeing as you get the announcer with and flag interactions
<@Mino> Ah
<@mitch> Same reason I would guess they made /say etc. not be able to be used repeatedly at the same time
<quaker_oats> "get the announcer with"?
<@mitch> any*
<@mitch> The announcer shouts stuff on flag interactions
<@mitch> voice over, w/e
<quaker_oats> oh
<@Mino> Well, I could modify the queue system to push dropflag first in queue. Can't think of a better solution.
<@Mino> The other solution would be to bypass the queue system, but that could make the bot drop messages or commands.
<@Mino> or have dropflag be dropped if someone was to do something like !teams right before
<@Mino> so the first solution sounds like the best to me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.