本帖最后由 刻下ing 于 2021-11-17 16:32 编辑
1.引用的库
import time
import pyautogui as pg
import pyperclip as pc
2.代码
[Asm] 纯文本查看 复制代码 class SendMsg(object):
def __init__(self):
self.name = '好友昵称'
self.msg = '发送的消息'
def send_msg(self):
# 左鍵 某个点
# pg.click(x=118, y=361, clicks=2, interval=0, button='left')
# 操作间隔为1秒
pg.PAUSE = 1.5
pg.hotkey('ctrl', 'alt', 'w')
pg.hotkey('ctrl', 'f')
# 找到狗彪子
pc.copy(self.name)
pg.hotkey('ctrl', 'v')
pg.press('enter')
# 发送消息
pc.copy(self.msg)
pg.hotkey('ctrl', 'v')
pg.press('enter')
# 隐藏微信
time.sleep(1)
pg.hotkey('ctrl', 'alt', 'w')
if __name__ == '__main__':
s = SendMsg()
while True:
# time.sleep(1)
s.send_msg() |