鼠标模拟真人滑动操作,滑条频繁出现是因为运动轨迹有异常,还有可能是模拟滑动毕竟不是真人操作,所以滑动一定要让鼠标真实移动,干货满满。【强烈建议收藏】

序言

技术是为了服务人类,切务拿技术来攻击他人服务器,也不能做危害计算机安全的事,一定要遵守法律法规。

python代码如下:

# coding:utf-8
import sys

import pyautogui as pg

def get_track(distance):
    """
    根据偏移量获取移动轨迹
    :param distance: 偏移量
    :return: 移动轨迹
    """
    # 移动轨迹
    track = []
    # 当前位移
    current = 0
    # 减速阈值
    mid = distance * 3 / 4
    # 计算间隔
    t = 1
    # 初速度
    v = 0

    while current < distance:
        if current < mid:
            # 加速度为正 2
            a = 2
        else:
            # 加速度为负 3
            a = -3

        a = 4 if current < mid / 2 else (5 if current < mid else -3)

        # 初速度 v0
        v0 = v
        # 当前速度 v = v0 + at
        v = v0 + a * t
        move = v0 * t + 1 / 2 * a * t * t
        # 当前位移
        current += move
        # 加入轨迹
        track.append(round(move))
        # print '轨迹    ', track
    return track

def move_hk(x,y,data,_tracks):
    move_distance = 0

    for long in _tracks:
        move_distance=move_distance+long
        pg.moveTo(x + move_distance, y, 0.1)


    move_distance=move_distance+2
    pg.moveTo(x + move_distance, y, 0.081)

    move_distance=move_distance-2
    pg.moveTo(x + move_distance, y, 0.075)


def main():
    #print("第一个传入的参数为:", sys.argv[1])
    distance = sys.argv[1]

    x = sys.argv[2]
    y = sys.argv[3]

    distance = int(distance)
    x = float(x)
    y = float(y)
    #x - -----------> 822.0
    #y - -----------> 688.5

    _tracks = get_track(distance)
    new_1 = _tracks[-1] - (sum(_tracks) - distance)
    _tracks.pop()

    _tracks.append(new_1)

    # 四个节点合并一个节点记得 节点总和-3
    get_1 = _tracks[-1]
    get_2 = _tracks[-2]
    get_3 = _tracks[-3]
    get_4 = _tracks[-4]
    get_two = get_1 + get_2 + get_3 + get_4 - 7
    _tracks.pop()
    _tracks.pop()
    _tracks.pop()
    _tracks.pop()
    _tracks.append(get_two)

    _tracks.append(3)
    _tracks.append(4)

    # python让数据只有八个节点  [2, 4, 8, 10, 14, 17, 21, 21, 17] 变成[2, 4, 8, 10, 14, 54, 3, 4]
    my_8_dict = {
        "1": 2,
        "2": 2,
        "3": 2,
        "4": 2,
        "5": 2,
        "6": 2
    }

    _new_tracks = []
    # _tracks = [2, 4, 8, 10, 14, 17, 21, 21, 17]
    mylen = len(_tracks)
    cha_len = mylen - 6
    step = 0
    he = 0
    my_index = 2
    if cha_len > 0:
        for i in range(0, len(_tracks)):
            if step <= cha_len:
                he += _tracks[i]
                my_8_dict["1"] = he
                step = step + 1

            else:
                my_8_dict[f"{my_index}"] = _tracks[i]
                my_index = my_index + 1

        for long in my_8_dict.values():
            _new_tracks.append(long)


    else:
        for long in _tracks:
            _new_tracks.append(long)

    move_hk(x, y, distance, _new_tracks)
    print(_new_tracks)
    print(distance,x,y)

if __name__ == "__main__":
    # python .\tiktok_mouse_move.py 160 822.0 688.5
    #python -m nuitka  --standalone tiktok_mouse_move.py
    main()

总结

用技术服务全人类,用技术来促进信息技术发展是我们的最终目的。本技术仅供学习。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

逆向导师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值