CompareChannels
Publicado por Perfil removido 30/11/2004
[ Hits: 4.467 ]
Certo dia estava usando o Xchat e queria saber quais usuários estavam em dois canais ao mesmo tempo. Como os canais estavam muito cheios, não dava para ficar olhando um por um. Aí fiz esse script que compara a lista de usuários de dois canais, e imprime os usuários que estão nos dois canias. Está bem tosco, mas funciona. Para usar carregue o script e digite /compare canal1 [canal2]. O canal2 é opcional, se ele não for passado o script compara o canal em que você está no momento.
__module_name__ = "ChannelCompare" __module_version__ = "0.1" __module_description__ = "Supply two channel names and I find the users who are in both" import xchat message = __module_name__ + " " + __module_version__ + " successfully loaded" xchat.prnt(message) def compare(word, word_eol, userdata):    if len(word) < 2:      xchat.prnt("We need at least one channel name")      return xchat.EAT_NONE    channel1 = word[1]    if channel1[0] != '#':      channel1 = '#' + channel1    if len(word) < 3:      channel2 = xchat.get_info("channel")      if channel2 is None or channel2 == channel1 or channel2[0] != '#':        xchat.prnt("We can't find the second channel name. Please, give it to us.")        return xchat.EAT_NONE    else:      channel2 = word[2]      if channel2[0] != '#':        channel2 = '#' + channel2    context = xchat.find_context(None, channel1)    if context is None:      xchat.prnt("The given channel name '" + channel1 + " is not valid.")      return xchat.EAT_NONE    list1 = context.get_list("users")    context = xchat.find_context(None, channel2)    if context is None:      xchat.prnt("The given channel name '" + channel2 + " is not valid.")      return xchat.EAT_NONE    list2 = context.get_list("users")    if list1 and list2:      xchat.prnt("\nComparing " + channel1 + " x " + channel2)      xchat.prnt("The user we found are:")      count = 0      for i in list1:        for j in list2:          if i.nick == j.nick:            xchat.prnt(" " + i.nick)            count = count + 1      xchat.prnt(count.__str__() + " users found") xchat.hook_command("compare", compare, help = "/compare channel1 [channel2] Show users in the both channel")
Cotação do Dólar com requests_html
Script em Python 3.6 para fazer scrape de uma URL exportando métricas no formato Prometheus
CotDolar - Cotação do dólar em Python
Nenhum comentário foi encontrado.
Instalar e Configurar o Slackware Linux em 2025
Como configurar os repositórios do apt no Debian 12 em 2025
Passkeys: A Evolução da Autenticação Digital
Instalação de distro Linux em computadores, netbooks, etc, em rede com o Clonezilla
Configurando o Conky para iniciar corretamente no sistema
3 configurações básicas que podem melhorar muito a sua edição pelo editor nano
Como colorir os logs do terminal com ccze
Instalação Microsoft Edge no Linux Mint 22
Como configurar posicionamento e movimento de janelas no Lubuntu (Openbox) com atalhos de teclado
Jogando com Proton no LInux (1)
Linux Mint limitando rede a 20Mbps (6)
Ingress NGINX Controller CVSS base score of 9.8 (4)
Impossível corrigir problemas, você manteve (hold) pacotes quebrados. (2)