def loadDefaultConfig(): # Clear data QtBind.setText(gui, tbxQuestionPattern, "") QtBind.setText(gui, tbxAnswerPattern, "") QtBind.setText(gui, tbxReplyTo, "") QtBind.clear(gui, lstTriviaData)
def loadDefaultConfig(): # Clear data global lstMobsData, lstIgnore, lstOnlyCount lstMobsData = [] QtBind.clear(gui, lstMobs) lstIgnore = [] QtBind.setChecked(gui, cbxIgnoreGeneral, False) QtBind.setChecked(gui, cbxIgnoreChampion, False) QtBind.setChecked(gui, cbxIgnoreGiant, False) QtBind.setChecked(gui, cbxIgnoreTitan, False) QtBind.setChecked(gui, cbxIgnoreStrong, False) QtBind.setChecked(gui, cbxIgnoreElite, False) QtBind.setChecked(gui, cbxIgnoreUnique, False) QtBind.setChecked(gui, cbxIgnoreParty, False) QtBind.setChecked(gui, cbxIgnoreChampionParty, False) QtBind.setChecked(gui, cbxIgnoreGiantParty, False) lstOnlyCount = [] QtBind.setChecked(gui, cbxOnlyCountGeneral, False) QtBind.setChecked(gui, cbxOnlyCountChampion, False) QtBind.setChecked(gui, cbxOnlyCountGiant, False) QtBind.setChecked(gui, cbxOnlyCountTitan, False) QtBind.setChecked(gui, cbxOnlyCountStrong, False) QtBind.setChecked(gui, cbxOnlyCountElite, False) QtBind.setChecked(gui, cbxOnlyCountUnique, False) QtBind.setChecked(gui, cbxOnlyCountParty, False) QtBind.setChecked(gui, cbxOnlyCountChampionParty, False) QtBind.setChecked(gui, cbxOnlyCountGiantParty, False) QtBind.setChecked(gui, cbxAcceptForgottenWorld, False)
def btnCheck_clicked(): QtBind.clear(gui, lstPlugins) # List all files from Plugins folder files = os.listdir(GetPluginsFolder()) for filename in files: # Check only python files if re.search("[.]py", filename): pyFile = GetPluginsFolder() + "\\" + filename with open(pyFile, "r") as f: pyCode = str(f.read()) # Read file and check his version if re.search("\npVersion = [0-9a-zA-Z.'\"]*", pyCode): pyVersion = re.search("\npVersion = ([0-9a-zA-Z.'\"]*)", pyCode).group(0)[1:-1] pyName = re.search("\npName = ([0-9a-zA-Z'\"]*)", pyCode).group(0)[1:-1] pyDesc = pyVersion if pyName and pyName + ".py" != filename: pyDesc = pyName + " " + pyDesc # It's up to the plugin if the url is wrong :P pyUrl = pyCode.find("\npUrl = ") pyMsg = "Updated" if pyUrl != -1: pyUrl = pyCode[pyUrl + 9:].split('\n')[0][:-1] pyNewVersion = getVersion(pyUrl) if pyNewVersion and compareVersion( pyVersion, pyNewVersion): pyMsg = "Update available (v" + pyNewVersion + ") [" + pyUrl + "]" else: pyMsg = "Cannot be update: URL not found" QtBind.append(gui, lstPlugins, filename + " (" + pyDesc + ") - " + pyMsg)
def getMobCount(radius): # Clear QtBind.clear(gui, lstMonsterCounter) QtBind.append(gui, lstMonsterCounter, 'Name (Type)') # Header count = 0 # Get my position to calc radius p = get_position() if radius != None else None # Check all mob around monsters = get_monsters() if monsters: for key, mob in monsters.items(): # Ignore if this mob type is found if mob['type'] in lstIgnore: continue # Only count setup if len(lstOnlyCount) > 0: # If is not in only count, skip it if not mob['type'] in lstOnlyCount: continue # Ignore mob names elif ListContains(mob['name'], lstMobsData): continue # Checking radius if radius != None: if round(GetDistance(p['x'], p['y'], mob['x'], mob['y']), 2) > radius: continue # Adding GUI for a complete UX QtBind.append(gui, lstMonsterCounter, mob['name'] + ' (' + str(mob['type']) + ')') count += 1 return count
def getMobCount(): # Clear QtBind.clear(gui, lstMonsterCounter) QtBind.append(gui, lstMonsterCounter, 'Name (Type)') # Header count = 0 # Check all mob around monsters = get_monsters() if monsters: for key, mob in monsters.items(): # Ignore if this mob type is found if ListContains(str(mob['type']), lstIgnore): continue # Only count setup if len(lstOnlyCount) > 0: # If is not in only count, skip it if not ListContains(str(mob['type']), lstOnlyCount): continue # Ignore mob names elif QtBind_ItemsContains(mob['name'], lstMobs): continue # Adding GUI for a complete UX QtBind.append(gui, lstMonsterCounter, mob['name'] + ' (' + str(mob['type']) + ')') count += 1 return count
def btnCheck_clicked(): QtBind.clear(gui, lvwPlugins) # List all files from Plugins folder pyFolder = GetPluginsFolder() files = os.listdir(pyFolder) # Load plugins data global lstPluginsData for filename in files: # Check only python files if filename.endswith(".py"): pyFile = pyFolder + "\\" + filename with open(pyFile, "r") as f: pyCode = str(f.read()) # Read file and check his version if re.search("\npVersion = [0-9a-zA-Z.'\"]*", pyCode): # Extract version pyVersion = re.search("\npVersion = ([0-9a-zA-Z.'\"]*)", pyCode).group(0)[13:-1] # Extract name if has one pyName = filename[:-3] if re.search("\npName = ([0-9a-zA-Z'\"]*)", pyCode): pyName = re.search("\npName = ([0-9a-zA-Z'\"]*)", pyCode).group(0)[10:-1] # Check if has url pyUrl = pyCode.find("\npUrl = ") # Show basic plugin info pyInfo = filename + " (" + pyName + " v" + pyVersion + ") - " # Getting all required to update the plugin pData = {} pData['canUpdate'] = False # Save all data if has url if pyUrl != -1: # Extract the rest url, it's up to the plugin if the url is wrong :P pyUrl = pyCode[pyUrl + 9:].split('\n')[0][:-1] pyNewVersion = getVersion(pyUrl) # Check if version is found and can be updated if pyNewVersion and compareVersion( pyVersion, pyNewVersion): # Save data to update pData['canUpdate'] = True pData['url'] = pyUrl pData['filename'] = filename pData['pName'] = pyName # Notify update pyInfo += "Update available (v" + pyNewVersion + ")" else: pyInfo += "Updated" else: pyInfo += "Cannot be updated: URL not found" # Add info to GUi QtBind.append(gui, lvwPlugins, pyInfo) lstPluginsData.append(pData)
def btnRefreshMobs_clicked(): # Clear the list QtBind.clear(gui,lstMobs) global lstMobsData lstMobsData = [] # Get all mobs near to you mobs = get_monsters() if mobs: # add all kind of mobs actually found for uid, mob in mobs.items(): # Add mob QtBind.append(gui,lstMobs,mob['name']+" ("+getMobType(mob['type'])+") "+(' - HP ('+str(mob['hp'])+'/'+str(mob['max_hp'])+')' if showHP else '')+" - UID ["+str(uid)+']') lstMobsData.append(mob)
def UpdateTriviaData(): # Clean it global trivia_data trivia_data = [] QtBind.clear(gui, lstTriviaData) # Check the trivia data if os.path.exists(getTriviaPath()): # Try to Load trivia file with open(getTriviaPath(), "r") as f: trivia_data = json.load(f) # Load the listview for trivia in trivia_data: QtBind.append(gui, lstTriviaData, 'Q: "' + trivia['q'] + '" A: "' + trivia['a'] + '"')
def btnNpcs_clicked(): # Get all NPCs and teleporters npcs = get_npcs() # Clear list QtBind.clear(gui, lstNpcs) # Add header QtBind.append(gui, lstNpcs, '[Name] [ServerName] [ModelID] (UniqueID)') if npcs: # Header data separation QtBind.append(gui, lstNpcs, ' -') for UniqueID, NPC in npcs.items(): # Append every NPC description to the list QtBind.append( gui, lstNpcs, "[" + NPC['name'] + "] [" + NPC['servername'] + "] [" + str(NPC['model']) + "] (" + str(UniqueID) + ")")
def joined_game(): # Clear all lists to avoid issues global lvwHatItemsData, lvwDressItemsData, lvwAccesoryItemsData, lvwFlagItemsData QtBind.clear(gui, lvwHatItems) lvwHatItemsData = [] QtBind.clear(gui, lvwDressItems) lvwDressItemsData = [] QtBind.clear(gui, lvwAccesoryItems) lvwAccesoryItemsData = [] QtBind.clear(gui, lvwFlagItems) lvwFlagItemsData = []
def loadDefaultConfig(): # Clear data QtBind.setText(gui, tbxChannels, "") QtBind.clear(gui, lstChannels) QtBind.setText(gui, tbxKey, JELLYDIX_KEY) QtBind.setText(gui, tbxUrl, JELLYDIX_URL) QtBind.setChecked(gui, cbxAddTimeStamp, False) # Reset triggers for name, cmbx in cmbxTriggers.items(): QtBind.clear(gui, cmbx) QtBind.append(gui, cmbx, "") QtBind.setChecked(gui, cbxEvtMessage_global_filter, False) QtBind.setText(gui, tbxEvtMessage_global_filter, " Filter by message") QtBind.setChecked(gui, cbxEvtMessage_uniqueSpawn_filter, False) QtBind.setText(gui, tbxEvtMessage_uniqueSpawn_filter, " Filter by name") QtBind.setChecked(gui, cbxEvtMessage_uniqueKilled_filter, False) QtBind.setText(gui, tbxEvtMessage_uniqueKilled_filter, " Filter by name") for name, cmbx in cmbxTriggers_.items(): QtBind.clear(gui_, cmbx) QtBind.append(gui_, cmbx, "") QtBind.setChecked(gui_, cbxEvtPick_name_filter, False) QtBind.setText(gui_, tbxEvtPick_name_filter, " Filter by name") QtBind.setChecked(gui_, cbxEvtPick_servername_filter, False) QtBind.setText(gui_, tbxEvtPick_servername_filter, " Filter by servername")
def loadDefaultConfig(): # Clear data QtBind.setText(gui,tbxChannels,"") QtBind.clear(gui,lstChannels) QtBind.setText(gui,tbxToken,'') QtBind.setText(gui,tbxWebsite,'https://jellydix.ddns.net') # Reset triggers for name,cmbx in cmbxTriggers.items(): QtBind.clear(gui,cmbx) QtBind.append(gui,cmbx,"") QtBind.setChecked(gui,cbxEvtMessage_global_filter,False) QtBind.setText(gui,tbxEvtMessage_global_filter," Filter by message") QtBind.setChecked(gui,cbxEvtMessage_uniqueSpawn_filter,False) QtBind.setText(gui,tbxEvtMessage_uniqueSpawn_filter," Filter by name") QtBind.setChecked(gui,cbxEvtMessage_uniqueKilled_filter,False) QtBind.setText(gui,tbxEvtMessage_uniqueKilled_filter," Filter by name") for name,cmbx in cmbxTriggers_.items(): QtBind.clear(gui_,cmbx) QtBind.append(gui_,cmbx,"") QtBind.setChecked(gui_,cbxEvtPick_name_filter,False) QtBind.setText(gui_,tbxEvtPick_name_filter," Filter by name") QtBind.setChecked(gui_,cbxEvtPick_servername_filter,False) QtBind.setText(gui_,tbxEvtPick_servername_filter," Filter by servername") QtBind.setChecked(gui_,cbxAddTimestamp,False) QtBind.setChecked(gui_,cbxDiscord_read_messages,False) QtBind.setText(gui_,tbxDiscord_guild_id," Discord Server ID...") QtBind.setChecked(gui_,cbxDiscord_read_all,False)
def btnSearchItem_clicked(): # vSRO only locale = get_locale() if locale != 22: return # Check is not empty itemName = QtBind.text(gui, tbxSearchItem) if not itemName: return # Check if process is running on background global isSearching if isSearching: return # Quick ingame check if not isJoined(): return # Clear list QtBind.clear(gui, lvwItems) global lvwItemsData lvwItemsData = [] isSearching = True Timer(0.001, SearchItem, [itemName]).start()
def loadDefaultConfig(): # Clear data global lstOpcodesData lstOpcodesData = [] QtBind.clear(gui, lstOpcodes)
def loadDefaultConfig(): # Clear data QtBind.clear(gui,lstLeaders)
def load_default_config(): # Clear data QtBind.setChecked(gui, cbxAcceptAll, False) QtBind.setChecked(gui, cbxReplyAccept, True) QtBind.setChecked(gui, cbxReplyApprove, True) QtBind.clear(gui, lvwExchangers)
def loadDefaultConfig(): # Clear data QtBind.clear(gui, lstMobs)
def loadDefaultConfig(): # Clear data QtBind.setChecked(gui, cbxEnabled, False) QtBind.clear(gui, lvwLeaders) QtBind.setChecked(gui, cbxDefensive, False)
def loadDefaultConfig(): # Clear data QtBind.clear(gui, lstOpcodes)
def loadDefaultConfig(): # Clear data QtBind.setText(gui,btnScanMobs," Start Scanner ") QtBind.clear(gui,lstMobs) QtBind.clear(gui,lstAutoSelectMobs)
def disableFields(): QtBind.setEnabled(gui, emailTextbox, False) QtBind.setEnabled(gui, PasswordTextbox, False) QtBind.clear(gui, emailTextbox) QtBind.clear(gui, PasswordTextbox) QtBind.setText(gui, connectBtn, "Disconnect")
def btnClearChat_clicked(): QtBind.clear(gui,lstTranslatedMessages)