金狮镖局 Design By www.egabc.com

Python实现微信表情包炸群效果,具体代码如下所示;

# -*- coding = utf-8 -*-
# @Time : 2021/1/26 15:19
# @Author : 陈良兴
# @File : 微信表情包炸群.py
# @Software : PyCharm

# 运行程序 > 输入次数 > 回车 > 打开微信对话框 > 将鼠标放置在“发送”按钮处即可

from pynput.keyboard import Controller as KB        #控制键盘输入
from pynput.mouse import Controller,Button         #控制鼠标点击
import time
import random

Wechat_expression = [
  "[微笑]","[撇嘴]","[色]","[发呆]","[得意]","[流泪]","[害羞]","[闭嘴]","[睡]","[大哭]","[尴尬]",
  "[发怒]","[调皮]","[呲牙]","[惊讶]","[难过]","[囧]","[抓狂]","[吐]","[偷笑]","[愉快]","[白眼]",
  "[傲慢]","[困]","[惊恐]","[憨笑]","[悠闲]","[咒骂]","[疑问]","[嘘]","[晕]","[衰]","[骷髅]","[猪头]",
  "[敲打]","[再见]","[擦汗]","[抠鼻]","[鼓掌]","[坏笑]","[右哼哼]","[鄙视]","[委屈]","[快哭了]",
  "[阴险]","[亲亲]","[可怜]","[笑脸]","[生病]","[脸红]","[破涕为笑]","[恐惧]","[失望]","[无语]",
  "[嘿哈]","[捂脸]","[奸笑]","[机智]","[皱眉]","[耶]","[吃瓜]","[加油]","[汗]","[天啊]","[Emm]",
  "[社会社会]","[旺柴]","[好的]","[打脸]","[哇]","[翻白眼]","[666]","[让我看看]","[叹气]","[苦涩]",
  "[裂开]","[嘴唇]","[爱心]","[心碎]","[拥抱]","[强]","[弱]","[握手]","[胜利]","[抱拳]","[勾引]",
  "[拳头]","[OK]","[合十]","[啤酒]","[咖啡]","[蛋糕]","[玫瑰]","[凋谢]","[菜刀]","[便便]","[月亮]",
  "[太阳]","[礼物]","[红包]","[發]","[福]","[跳跳]","[发抖]","[转圈]","[炸弹]","[庆祝]","[烟花]"
]

#键盘控制函数
def keyboardInput(string):
  keyboard = KB()
  keyboard.type(string)

#鼠标控制函数
def mouseClick():
  mouse = Controller()
  mouse.press(Button.left)
  mouse.release(Button.left)

#响应函数
def response(number):
  time.sleep(5)             #延迟5s响应
  for i in range(number):
    sentence = random.choice(Wechat_expression)
    keyboardInput(sentence)
    mouseClick()
    time.sleep(0.4)           #每条消息间隔0.4秒


if __name__ == "__main__":
  while True:
  	print("\033[1;32m发动机已启动,随时可以出发!\033[0m")
    Num = input("\033[1;32m请输入轰炸次数:\033[0m")
    if Num.isdigit():
      response(int(Num))
      print("\033[1;33m报告长官,轰炸完毕,请求下一步作战计划!!!\033[0m")
    else:
      print("\033[1;31m输入错误,请重新输入一个整数!!!\033[0m")

    #询问是否继续
    answer = input("\033[1;34m是否执行下一次作战计划?(y 或者 n):\033[0m")
    if answer == "y":
      print("\033[1;33m继续轰炸!!!\033[0m")
      continue
    if answer == "n":
      print("\033[1;33m停止轰炸,给他们喘口气!!!\033[0m")
      break
    else:
      print("\033[1;31m输入错误,请输入“y”或者“n”!!!\033[0m")

操作如下:

首先,运行代码,输入次数。

Python实现微信表情包炸群功能

然后,打开微信对话框,将鼠标放置在“发送”按钮处,即可实现自动随机发送表情包。

Python实现微信表情包炸群功能

最后,根据自己的选择是否继续执行操作。

Python实现微信表情包炸群功能

到此这篇关于Python实现微信表情包炸群功能的文章就介绍到这了,更多相关Python微信表情包炸群内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

标签:
Python微信表情包炸群,Python表情包炸群

金狮镖局 Design By www.egabc.com
金狮镖局 免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
金狮镖局 Design By www.egabc.com

评论“Python实现微信表情包炸群功能”

暂无Python实现微信表情包炸群功能的评论...

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。