猫史档案馆


【Python3】连点器(开源)

用户:边城过客边城过客查看:35 回复:14 评论:35 创建时间:2022-12-15T15:08:38


嗨嗨!

emotion_星能猫_hi

最近狐狸出新作了)))

center_image

https://shequ.codemao.cn/work/171301000

———————————————————————————————————————

很好,又是一个费肝的作品。

我玩了以后进行了思考,

———这个世界没有手速是不行的

 

于是我看到了Python中的pyautogui库,

整活时间到!!

emotion_编程猫_嗨起来

1.连续点击

def mouse():
    b = input('请问需要点击多少下?')
    b = int(b)
    c = input('点击左键还是右键?\n左键请输入0,右键输入1:')
    c = int(c)
    print('请注意:您需要在10秒内将鼠标移动到需要连点的地方,然后不要动,等待开始快速连点。')
    sleep(10)
    print('开始点击!')
    x, y = pag.position()
    d = 'left'
    if c:
        d = 'right'
    e = time()
    for i in range(0, b):
        pag.click(x, y, button=d)
    f = time() - e
    input('完成。用时%f秒。' % f)

 

2.连续输入

def key():
    print('请在以下支持的按键中挑选点需要的键。')
    for i in pag.KEYBOARD_KEYS:
        print(r'%s' % i, end=' ')
    b = input('\n请输入您需要快速输入的字符:')
    if b in pag.KEYBOARD_KEYS:
        c = input('请输入您需要多少次输入:')
        c = int(c)
        print('请注意,您需要在10秒内切换到需要输入的窗口。')
        sleep(10)
        print('开始工作!')
        e = time()
        for i in range(0, c):
            pag.press(b)
        f = time() - e
        input('完成。用时%f秒。' % f)
    else:
        input('输入的字符不属于支持字符,请修改。')


try:
    a = input('输入您需要的服务(数字):\n1:快速连点\n2:快速输入\n>>> ')
    a = int(a)
    if a == 1:
        mouse()
    elif a == 2:
        key()
    else:
        input('不好意思,没有找到您需要的服务。\n')
except Exception as e:
    print('错误;\n', e)

 

3.优化(全部源码)

import pyautogui as pag
from time import sleep, time

pag.PAUSE = 0


def mouse():
    b = input('请问需要点击多少下?')
    b = int(b)
    c = input('点击左键还是右键?\n左键请输入0,右键输入1:')
    c = int(c)
    print('请注意:您需要在10秒内将鼠标移动到需要连点的地方,然后不要动,等待开始快速连点。')
    sleep(10)
    print('开始点击!')
    x, y = pag.position()
    d = 'left'
    if c:
        d = 'right'
    e = time()
    for i in range(0, b):
        pag.click(x, y, button=d)
    f = time() - e
    input('完成。用时%f秒。' % f)


def key():
    print('请在以下支持的按键中挑选点需要的键。')
    for i in pag.KEYBOARD_KEYS:
        print(r'%s' % i, end=' ')
    b = input('\n请输入您需要快速输入的字符:')
    if b in pag.KEYBOARD_KEYS:
        c = input('请输入您需要多少次输入:')
        c = int(c)
        print('请注意,您需要在10秒内切换到需要输入的窗口。')
        sleep(10)
        print('开始工作!')
        e = time()
        for i in range(0, c):
            pag.press(b)
        f = time() - e
        input('完成。用时%f秒。' % f)
    else:
        input('输入的字符不属于支持字符,请修改。')


try:
    a = input('输入您需要的服务(数字):\n1:快速连点\n2:快速输入\n>>> ')
    a = int(a)
    if a == 1:
        mouse()
    elif a == 2:
        key()
    else:
        input('不好意思,没有找到您需要的服务。\n')
except Exception as e:
    print('错误;\n', e)

你学会了吗?


回复

上一页1 页 / 共 1下一页
林夕狐林夕狐

好,我现在就去试试)))

点赞1


评论


超级无敌编程大神超级无敌编程大神

报告!没有学会!

点赞1


评论


猫站YYDS猫站YYDS

emotion_雷电猴_围观

点赞1


评论


边城过客边城过客

import pyautogui as pag
from time import sleep, time

pag.PAUSE = 0


def mouse():
    b = input('请问需要点击多少下?')
    b = int(b)
    c = input('点击左键还是右键?\n左键请输入0,右键输入1:')
    c = int(c)
    print('请注意:您需要在10秒内将鼠标移动到需要连点的地方,然后不要动,等待开始快速连点。')
    sleep(10)
    print('开始点击!')
    x, y = pag.position()
    d = 'left'
    if c:
        d = 'right'
    e = time()
    for i in range(0, b):
        sleep(0.2)
        pag.click(x, y, button=d)
    f = time() - e
    input('完成。用时%f秒。' % f)


def key():
    print('请在以下支持的按键中挑选点需要的键。')
    for i in pag.KEYBOARD_KEYS:
        print(r'%s' % i, end=' ')
    b = input('\n请输入您需要快速输入的字符:')
    if b in pag.KEYBOARD_KEYS:
        c = input('请输入您需要多少次输入:')
        c = int(c)
        print('请注意,您需要在10秒内切换到需要输入的窗口。')
        sleep(10)
        print('开始工作!')
        e = time()
        for i in range(0, c):
            pag.press(b)
        f = time() - e
        input('完成。用时%f秒。' % f)
    else:
        input('输入的字符不属于支持字符,请修改。')


try:
    a = input('输入您需要的服务(数字):\n1:快速连点\n2:快速输入\n>>> ')
    a = int(a)
    if a == 1:
        mouse()
    elif a == 2:
        key()
    else:
        input('不好意思,没有找到您需要的服务。\n')
except Exception as e:
    print('错误;\n', e)

数米专用:

点赞2


评论


CapZenithCapZenith

awa

点赞1


评论


稚气的蓝雀-Jpm稚气的蓝雀-Jpm

wc

点赞1


评论


一粒工具米一粒工具米

报告!没有学会!请问怎么用!emotion_雷电猴_举手

点赞0


评论


人人都要保护草方块人人都要保护草方块

学……废了

点赞1


评论


星河中的一缕微尘星河中的一缕微尘

呃6

点赞1


评论


虚伪_der_面具虚伪_der_面具

哇哦!

点赞1


评论


温顺的咪噜gBgE温顺的咪噜gBgE

恭喜我,和你的代码不太一样,。,。

点赞2


评论


Al巴格LYFAl巴格LYF

挖坟,但谢谢你,陌生人,这就去逝(试)

点赞2


评论


花生编程花生编程

连点器怎么那么卡

点赞0


评论


无邪a无邪a

我学废了

点赞0


评论