序言
技术是为了服务人类,切务拿技术来攻击他人服务器,也不能做危害计算机安全的事,一定要遵守法律法规。
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()
总结
用技术服务全人类,用技术来促进信息技术发展是我们的最终目的。本技术仅供学习。