def onHotkeyOrCommandEvent(self, keyword, schid=0): if not schid: schid = ts3lib.getCurrentServerConnectionHandlerID() # (err, status) = ts3lib.getConnectionStatus(schid) # if status != ts3defines.ConnectStatus.STATUS_CONNECTION_ESTABLISHED: return arguments = [] if keyword == "yatqa_start": pass elif keyword == "yatqa_connect_current": (err, ownID) = ts3lib.getClientID(schid) (err, ip) = ts3lib.getConnectionVariable( schid, ownID, ts3defines.ConnectionProperties.CONNECTION_SERVER_IP) (err, port) = ts3lib.getServerVariable( schid, ts3defines.VirtualServerPropertiesRare.VIRTUALSERVER_PORT) title = ("{} > {}".format(self.name, ip)) qport = inputInt(title, "Query Port:", 10011, 1, 65535) name = inputBox(title, "Query Login Name:", "serveradmin") pw = inputBox( title, "Query Login Password:"******"") args = ["-c", ip, qport] if name and pw: args.extend([name, pw, port]) else: args.append(port) self.yatqa.setArguments( args) # IP Query_Port [User Pass] [Voice_Port] elif keyword == "yatqa_stats_current": (err, ownID) = ts3lib.getClientID(schid) (err, ip) = ts3lib.getConnectionVariable( schid, ownID, ts3defines.ConnectionProperties.CONNECTION_SERVER_IP) (err, port) = ts3lib.getServerVariable( schid, ts3defines.VirtualServerPropertiesRare.VIRTUALSERVER_PORT) self.yatqa.setArguments(["-s", ip, port]) # IP elif keyword == "yatqa_blacklist_current": (err, ownID) = ts3lib.getClientID(schid) (err, ip) = ts3lib.getConnectionVariable( schid, ownID, ts3defines.ConnectionProperties.CONNECTION_SERVER_IP) self.yatqa.setArguments(["-b", ip]) # IP elif keyword == "yatqa_lookup_dns": (err, host, port, pw) = ts3lib.getServerConnectInfo(schid) self.yatqa.setArguments(["-d", host]) elif keyword == "yatqa_browse_icons": (err, suid) = ts3lib.getServerVariable( schid, ts3defines.VirtualServerProperties. VIRTUALSERVER_UNIQUE_IDENTIFIER) self.yatqa.setArguments(["-i", suid]) elif keyword == "yatqa_permission_editor": self.yatqa.setArguments(["-p"]) elif keyword == "yatqa_connect_default": self.yatqa.setArguments(["-a"]) else: return False if PluginHost.cfg.getboolean("general", "verbose"): print(self.bin, self.yatqa.arguments()) self.yatqa.start() return True
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): if atype == PluginMenuType.PLUGIN_MENU_TYPE_CHANNEL: if menuItemID == 0: if not self.dlg: self.dlg = StatusDialog(self) self.dlg.show(); self.dlg.raise_(); self.dlg.activateWindow() elif menuItemID == 1: (err, haspw) = ts3lib.getChannelVariable(schid, selectedItemID, ChannelProperties.CHANNEL_FLAG_PASSWORD) if not haspw: (err, name) = ts3lib.getChannelVariable(schid, selectedItemID, ChannelProperties.CHANNEL_NAME) msgBox("Channel \"{0}\" has no password to crack!".format(name), QMessageBox.Warning);return self.mode = 0 self.step = 1 self.pwc = 0 self.startTimer(schid, selectedItemID) elif menuItemID == 2: (err, haspw) = ts3lib.getChannelVariable(schid, selectedItemID, ChannelProperties.CHANNEL_FLAG_PASSWORD) if not haspw: (err, name) = ts3lib.getChannelVariable(schid, selectedItemID, ChannelProperties.CHANNEL_NAME) msgBox("Channel \"{0}\" has no password to crack!".format(name), QMessageBox.Warning);return self.mode = 1 step = inputBox(self.name, 'How much to increase per try?') if step: self.step = int(step) start = inputBox(self.name, 'Where to start?') if start: self.pwc = int(start) self.startTimer(schid, selectedItemID) elif menuItemID == 3: (err, path, pw) = ts3lib.getChannelConnectInfo(schid, selectedItemID) if pw == None or pw == False or pw == "": (err, name) = ts3lib.getChannelVariable(schid, selectedItemID, ChannelProperties.CHANNEL_NAME) msgBox('No password saved for channel {0}'.format(name));return elif pw in self.pws: msgBox("Not adding \"{0}\" to password db\n\nIt already exists!".format(pw), QMessageBox.Warning);return self.pws.append(pw) with open(self.pwpath, "a") as myfile: myfile.write('\n{0}'.format(pw)) msgBox("Added \"{0}\" to password db".format(pw)) elif menuItemID == 4: (err, name) = ts3lib.getChannelVariable(schid, selectedItemID, ChannelProperties.CHANNEL_NAME) pw = inputBox("{0} - {1}".format(self.name,name), "Password:"******"passwordCracker:manual") elif atype == PluginMenuType.PLUGIN_MENU_TYPE_GLOBAL: if menuItemID == 1: self.timer.stop() ts3lib.printMessageToCurrentTab('Timer stopped!') elif menuItemID == 2: pw = inputBox("Enter Channel Password to add", "Password:"******"": msgBox("Not adding \"{0}\" to password db".format(pw), QMessageBox.Warning);return elif pw in self.pws: msgBox("Not adding \"{0}\" to password db\n\nIt already exists!".format(pw), QMessageBox.Warning);return self.pws.append(pw) with open(self.pwpath, "a") as myfile: myfile.write('\n{0}'.format(pw)) msgBox("Added \"{0}\" to password db".format(pw))
def onMenuItemEvent(self, schid, atype, menuItemID, channel): if atype != ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_CHANNEL: return try: (error, ownID) = ts3lib.getClientID(schid) (error, maxclients) = ts3lib.getChannelVariable( schid, channel, ts3defines.ChannelProperties.CHANNEL_MAXCLIENTS) if self.debug: ts3lib.printMessageToCurrentTab( "error: {0} | maxclients: {1}".format(error, maxclients)) if menuItemID == 0: pw = inputBox("Enter Channel Password", "Password:"******"clients: {0}".format(clients)) (error, maxfamilyclients) = ts3lib.getChannelVariable( schid, channel, ts3defines.ChannelProperties.CHANNEL_MAXFAMILYCLIENTS) if self.debug: ts3lib.printMessageToCurrentTab( "error: {0} | maxfamilyclients: {1}".format( error, maxfamilyclients)) if clients < maxclients and clients < maxfamilyclients: ts3lib.requestClientMove(schid, ownID, channel, pw) return True (error, name) = ts3lib.getChannelVariableAsString( schid, channel, ts3defines.ChannelProperties.CHANNEL_NAME) self.schid = schid self.channel = channel self.password = pw self.cname = name if not pw: ts3lib.printMessageToCurrentTab( "Queued for channel [url=channelid://{0}]{1}[/url]. [color=red]{2}[/color] client(s) remaining." .format(channel, name, maxclients - clients + 1)) else: ts3lib.printMessageToCurrentTab( "Queued for channel [url=channelid://{0}]{1}[/url] with password \"{2}\". [color=red]{3}[/color] client(s) remaining." .format(channel, name, pw, maxclients - clients + 1)) elif menuItemID == 1: pw = inputBox("Enter Channel Password", "Password:"******"pyTSon", 0)
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): if atype != ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_GLOBAL: return if menuItemID == 0: self.enabled = not self.enabled if self.enabled: ts3lib.printMessageToCurrentTab( "{} > [color=green]Enabled!".format(self.name)) else: ts3lib.printMessageToCurrentTab( "{} > [color=red]Disabled!".format(self.name)) elif menuItemID == 1: err, host, port, pw = ts3lib.getServerConnectInfo(schid) host = inputBox(self.name, "Server address:", host) if not host: msgBox("Nothing to add!", title=self.name) return if host in self.whitelist: self.whitelist.remove(host) ts3lib.printMessageToCurrentTab( "{} > Removed {} from whitelist!".format(self.name, host)) else: self.whitelist.append(host.lower()) ts3lib.printMessageToCurrentTab( "{} > Added {} to whitelist!".format(self.name, host)) with open(self.whitelist_ini, "a") as myfile: myfile.write('\n{0}'.format(host))
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): if menuItemID != 0: return if atype == ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_GLOBAL: if schid in self.targets: self.stop("", schid, self.targets[schid]) else: ts3lib.printMessageToCurrentTab( "{} {}: [color=red]Not following anyone on this tab.[/color]" .format(timestamp(), self.name)) uid = inputBox(self.name, "UID:", QApplication.clipboard().text()) parsed = parseClientURL(uid) if parsed: uid = parsed[1] elif atype == ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_CLIENT: (err, ownID) = ts3lib.getClientID(schid) if selectedItemID == ownID: return (err, uid) = ts3lib.getClientVariable( schid, selectedItemID, ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER) if not uid: ts3lib.printMessageToCurrentTab( "{} {}: [color=red]Cannot follow[/color] {}".format( timestamp(), self.name, selectedItemID)) return self.targets[schid] = uid ts3lib.printMessageToCurrentTab( "{} {}: [color=green]Now auto-following[/color] {}".format( timestamp(), self.name, clientURL(schid, selectedItemID))) if PluginHost.cfg.getboolean("general", "verbose"): print(self.name, "> self.targets[schid]", self.targets[schid], "selectedItemID", selectedItemID) self.joinTarget(schid)
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): if atype == ts3defines.PluginItemType.PLUGIN_SERVER: if menuItemID == 0: self.dynamicSilence = not self.dynamicSilence ts3lib.printMessageToCurrentTab( "{}{}: DynamicSilence set to [color=orange]{}".format( timestamp(), self.name, self.dynamicSilence)) elif menuItemID == 1: self.askForAvatar = not self.askForAvatar ts3lib.printMessageToCurrentTab( "{}askForAvatar set to [color=orange]{}".format( timestamp(), self.askForAvatar)) if not self.askForAvatar: self.clids = [] self.timer.stop() return (err, clids) = ts3lib.getClientList(schid) for c in clids: ts3lib.requestClientVariables(schid, c) for c in clids: (err, uid) = ts3lib.getClientVariable( schid, c, ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER) if getContactStatus(uid) == ContactStatus.BLOCKED: continue if uid in self.alreadyAsked: continue (err, sgroups) = ts3lib.getClientVariableAsString( schid, c, ts3defines.ClientPropertiesRare.CLIENT_SERVERGROUPS) sgroups = sgroups.split(",") if self.ruheGroupID in sgroups: continue if set(sgroups).isdisjoint(self.premiumGroupIDs): continue self.clids.append(c) ts3lib.printMessageToCurrentTab( "{}Asking {} clients for avatar".format( timestamp(), len(self.clids))) self.schid = schid self.timer.start(1000) if atype == ts3defines.PluginItemType.PLUGIN_CHANNEL: ts3lib.requestSendChannelTextMsg(schid, self.steammsg, selectedItemID) elif atype == ts3defines.PluginItemType.PLUGIN_CLIENT: if menuItemID == 0: ts3lib.requestSendPrivateTextMsg(schid, self.steammsg, selectedItemID) elif menuItemID == 1: print(self.aka) if self.aka != (0, 0, "", ""): self.aka = (0, 0, "", "") return realname = inputBox(self.name, "Real name:") if not realname: return (err, name) = ts3lib.getClientVariable( schid, selectedItemID, ts3defines.ClientProperties.CLIENT_NICKNAME) ts3lib.setClientSelfVariableAsString( schid, ts3defines.ClientProperties.CLIENT_NICKNAME, "{} aka {}".format(realname, name)) ts3lib.flushClientSelfUpdates(schid) self.aka = (schid, selectedItemID, realname, name)
def disconnect(self, schid=0, close_tab=False): if schid < 1: schid = ts3lib.getCurrentServerConnectionHandlerID() (err, status) = ts3lib.getConnectionStatus(schid) if status != ts3defines.ConnectStatus.STATUS_CONNECTION_ESTABLISHED: return clipboard = QApplication.clipboard().text() msg = inputBox("Disconnect", "Message", clipboard) if close_tab: self.schid = schid ts3lib.stopConnection(schid, msg if msg else "")
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): try: url = "" if atype == ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_CLIENT: if menuItemID == 1: # Nickname (TSViewer) url = "http://www.tsviewer.com/index.php?page=search&action=ausgabe_user&nickname=%%CLIENT_NAME_PERCENT_ENCODED%%" elif menuItemID == 2: # Nickname (GameTracker) url = "http://www.gametracker.com/search/?search_by=online_offline_player&query=%%CLIENT_NAME_PERCENT_ENCODED%%" elif menuItemID == 3: # Nickname (TS3Index) url = "http://ts3index.com/?page=searchclient&nickname=%%CLIENT_NAME_PERCENT_ENCODED%%" elif menuItemID == 4: # Nickname (Google) url = "https://www.google.com/search?q=%%CLIENT_NAME_PERCENT_ENCODED%%" elif menuItemID == 5: # Profil (GameTracker) url = "http://www.gametracker.com/search/?search_by=profile_username&query=%%CLIENT_NAME_PERCENT_ENCODED%%" elif menuItemID == 6: # UID (TS3Index) url = "http://ts3index.com/?page=searchclient&uid=%%CLIENT_UNIQUE_ID%%" elif menuItemID == 7: # UID (Google) url = "https://www.google.com/search?q=%%CLIENT_UNIQUE_ID%%" elif menuItemID == 8: # Besitzer (TSViewer) url = "http://www.tsviewer.com/index.php?page=search&action=ausgabe&suchbereich=ansprechpartner&suchinhalt=%%CLIENT_NAME_PERCENT_ENCODED%%" elif menuItemID == 9: # Badges (TS3Index) url = "https://ts3index.com/?page=searchclient&badges=%%CLIENT_BADGES%%" else: return # payload = {'username':'******', 'password':'******'} # nickname_encoded = urlencode(nickname, quote_via=quote_plus) # nickname_encoded = nickname_encoded.replace("+", "%2B").replace("/", "%2F").replace("=", "%3D") if "%%CLIENT_NAME_PERCENT_ENCODED%%" in url: if selectedItemID: (err, nickname) = ts3lib.getClientVariable( schid, selectedItemID, ts3defines.ClientProperties.CLIENT_NICKNAME) else: nickname = inputBox(self.name, "Nickname:", QApplication.clipboard().text()) parsed = parseClientURL(nickname) if parsed: nickname = parsed[2] else: nickname = QUrl.toPercentEncoding(nickname) url = url.replace("%%CLIENT_NAME_PERCENT_ENCODED%%", "{}".format(nickname)) if "%%CLIENT_UNIQUE_ID%%" in url: if selectedItemID: (err, uid) = ts3lib.getClientVariable( schid, selectedItemID, ts3defines.ClientProperties. CLIENT_UNIQUE_IDENTIFIER) else: uid = inputBox(self.name, "UID:", QApplication.clipboard().text()) parsed = parseClientURL(uid) if parsed: uid = parsed[1] url = url.replace("%%CLIENT_UNIQUE_ID%%", "{}".format(QUrl.toPercentEncoding(uid))) if "%%CLIENT_BADGES%%" in url: if selectedItemID: (err, badges) = ts3lib.getClientVariable( schid, selectedItemID, ts3defines.ClientPropertiesRare.CLIENT_BADGES) else: badges = inputBox(self.name, "Badges:", QApplication.clipboard().text()) url = url.replace("%%CLIENT_BADGES%%", badges) else: return if PluginHost.cfg.getboolean("general", "verbose"): ts3lib.printMessageToCurrentTab( "Opening URL: \"{}\"".format(url)) QDesktopServices.openUrl(QUrl(url)) except: ts3lib.logMessage(format_exc(), ts3defines.LogLevel.LogLevel_ERROR, "pyTSon", 0)
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): if atype == PluginMenuType.PLUGIN_MENU_TYPE_CHANNEL: if menuItemID == 0: if not self.dlg: self.dlg = StatusDialog(self) self.dlg.show() self.dlg.raise_() self.dlg.activateWindow() elif menuItemID == 1: (err, haspw) = ts3lib.getChannelVariable( schid, selectedItemID, ChannelProperties.CHANNEL_FLAG_PASSWORD) (err, name) = ts3lib.getChannelVariable( schid, selectedItemID, ChannelProperties.CHANNEL_NAME) if not haspw: msgBox( "Channel \"{0}\" has no password to crack!".format( name), QMessageBox.Warning) return self.mode = 0 self.step = 1 self.pwc = 0 content = [] with open(self.pwpath, encoding="utf-8") as f: content = f.readlines() self.pws = [x.strip() for x in content] (err, clids) = ts3lib.getChannelClientList(schid, selectedItemID) for clid in clids: (err, cname) = ts3lib.getClientVariable( schid, clid, ClientProperties.CLIENT_NICKNAME) self.pws[:0] = [cname, cname.lower(), cname.upper()] (err, cnamep) = ts3lib.getClientVariable( schid, selectedItemID, ClientPropertiesRare.CLIENT_NICKNAME_PHONETIC) if cnamep: self.pws[:0] = [cnamep, cnamep.lower(), cnamep.upper()] self.pws[:0] = [name, name.lower(), name.upper()] list(OrderedDict.fromkeys(self.pws)) self.startTimer(schid, selectedItemID) elif menuItemID == 2: (err, haspw) = ts3lib.getChannelVariable( schid, selectedItemID, ChannelProperties.CHANNEL_FLAG_PASSWORD) if not haspw: (err, name) = ts3lib.getChannelVariable( schid, selectedItemID, ChannelProperties.CHANNEL_NAME) msgBox( "Channel \"{0}\" has no password to crack!".format( name), QMessageBox.Warning) return self.mode = 1 step = inputBox(self.name, 'How much to increase per try?') if step: self.step = int(step) start = inputBox(self.name, 'Where to start?') if start: self.pwc = int(start) self.startTimer(schid, selectedItemID) elif menuItemID == 3: (err, path, pw) = ts3lib.getChannelConnectInfo(schid, selectedItemID) if pw == None or pw == False or pw == "": (err, name) = ts3lib.getChannelVariable( schid, selectedItemID, ChannelProperties.CHANNEL_NAME) msgBox('No password saved for channel {0}'.format(name)) return elif pw in self.pws: msgBox( "Not adding \"{0}\" to password db\n\nIt already exists!" .format(pw), QMessageBox.Warning) return self.pws.append(pw) with open(self.pwpath, "a") as myfile: myfile.write('\n{0}'.format(pw)) msgBox("Added \"{0}\" to password db".format(pw)) elif menuItemID == 4: (err, name) = ts3lib.getChannelVariable( schid, selectedItemID, ChannelProperties.CHANNEL_NAME) pw = inputBox("{0} - {1}".format(self.name, name), "Password:"******"passwordCracker:manual") elif atype == PluginMenuType.PLUGIN_MENU_TYPE_GLOBAL: if menuItemID == 1: self.timer.stop() ts3lib.printMessageToCurrentTab('Timer stopped!') elif menuItemID == 2: pw = inputBox("Enter Channel Password to add", "Password:"******"": msgBox("Not adding \"{0}\" to password db".format(pw), QMessageBox.Warning) return elif pw in self.pws: msgBox( "Not adding \"{0}\" to password db\n\nIt already exists!" .format(pw), QMessageBox.Warning) return self.pws.append(pw) with open(self.pwpath, "a") as myfile: myfile.write('\n{0}'.format(pw)) msgBox("Added \"{0}\" to password db".format(pw))
def onMenuItemEvent(self, schid, atype, menuItemID, selectedItemID): if self.nickname != "": self.nickname = "" return nickname = inputBox(self.name, "Forced nickname:") if nickname: self.nickname = nickname