说说的远程发布和博客的后面我编不下去了

11490DX Re: Master Lv.15

 

前面几天搞出来的支持说说的远程发布脚本

以及支持家里自动和机房电脑连接的脚本集合

wechatspy.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import uiautomation as auto
import os
# 接收端
wechat_win = auto.WindowControl(searchDepth=1, Name='【数据删除】')

# input_edit = wechat_win.EditControl()
# print("当前输入框:" + input_edit.GetValuePattern().Value)
msg_list = wechat_win.ListControl(Name="消息")

items = msg_list.GetChildren()
lstf = open('D:\\File\\HexoBlogRdf\\source\\_data\\LstMessage.txt', 'r', encoding = 'utf-8')
lst_message = lstf.read()
lstf.close()
f = open('D:\\File\\HexoBlogRdf\\source\\_data\\CurMessage.txt', 'w', encoding = 'utf-8')
# print(items)
cur_message = ""
for i in items:
if i.Name != "":
# f.write(i.Name+"\n---\n")
cur_message = i.Name
# print(i.Name+"\n---")
# print("Last Message: \n" + cur_message)
f.write(cur_message)
f.close()
# print("Last Message: \n" + lst_message)
# print("Cur_Message: \n" + cur_message)
# print("Issame? " + str(lst_message == cur_message))
result = (lst_message == cur_message)
lstf = open('D:\\File\\HexoBlogRdf\\source\\_data\\LstMessage.txt', 'w', encoding = 'utf-8')
lstf.write(cur_message)
lstf.close()
if result == False:
print("CUR CHANGE!")
os.system('python D:\\File\\HexoBlogRdf\\source\\_data\\trans.py')
else:
print(".")

trans.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import datetime
import os
file = open('D:\\File\\HexoBlogRdf\\source\\_data\\CurMessage.txt', 'r', encoding = 'utf-8')
line = file.readline()
if line == "startcomputer" or line == "startcomputer\n":
os.system('python D:\\File\\HexoBlogRdf\\source\\_data\\QQautoaccept.py')
exit(0)
if line != "essays\n":
exit(0)
orifile = open("D:\\File\\HexoBlogRdf\\source\\_data\\essays.yml", "r", encoding = 'utf-8')
oricon = orifile.read()
orifile.close()
output = open('D:\\File\\HexoBlogRdf\\source\\_data\\essays.yml', 'w', encoding = 'utf-8')
output.write("- content: |\n")
while True:
line = file.readline()
if not line:
break
output.write(" " + line + "\n")
output.write(" date: " + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S\n'))
output.write(oricon)
output.close()
# os.system("start D:\\File\\HexoBlogRdf\\source\\_data\\process-py.exe")
os.system("cd D:\\File\\HexoBlogRdf")
# os.system("bash")
os.system("hexo clean && hexo g && hexo d")

QQautoaccept.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import uiautomation as auto
import time
import pyautogui as pg
# qq = auto.WindowControl(searchDepth=1, Name="X[4]")
# def printgraph(layer, cur):
# childlist = cur.GetChildren()
# id = 0
# for items in childlist:
# s = str(layer*" " + str(layer) + "-" + str(id) + ": " +items.Name + ' '+ items.ControlTypeName)
# f.write(s + '\n')
# printgraph(layer+1, items)
# id += 1
pg.click(x=1, y=1, button='left')
time.sleep(5)

allrwl = auto.PaneControl(searchDepth=1, Name = "任务栏")
rwl = allrwl.GetChildren()[2]

rwl_qq = rwl.ButtonControl(Name = "QQ - 1 个运行窗口")
idx = 2
while rwl_qq.Exists() == False:
rwl_qq = rwl.ButtonControl(Name = str("QQ - "+str(idx)+" 个运行窗口"))
idx += 1
rwl_qq.Click()

taskswitchprogram = auto.ListControl(searchDepth=1, Name="任务切换程序")
x4ui = taskswitchprogram.ListItemControl(Name = "X[4]")
x4ui.Click()
qq = auto.PaneControl(searchDepth=1, Name="X[4]")
qq.SetTopmost(1)
# print(" --- qq info ---")
# print(qq)
# print(" --- next ---")
# print(qq.GetChildren())
# inter = qq.GetChildren()[1]
# print(" --- Graph ---")
# f = open('QQControlTree.txt', 'w', encoding = 'utf-8')
# printgraph(0, qq)
# f.close()
# print(" --- Inter info --- ")
# print(layer1)
# button_omote = layer9
button_omote = qq.ButtonControl(Name = "远程协助弹出菜单")
print(button_omote)
# 我即将按下这个按钮
button_omote.Click()
# print(" --- Inner inter info ---")
# 实现按下这个按钮里面的按钮,需要不需要刷新?
# f = open('QQControlTree.txt', 'w', encoding = 'utf-8')
# printgraph(0, qq)
# f.close()

# 猜想成立,需要刷新。
# 刷新后根据表找到第 9-1 层

re_toolbar = qq.ToolBarControl().GetChildren()

re_com2com = re_toolbar[4]
button_ura = re_com2com.GetChildren()[1].GetChildren()[1].GetChildren()[0].GetChildren()[0]
button_ura.Click()
qq.SetTopmost(False)
# document = qq.DocumentControl()
# print(document)
# toolbar = qq.ToolBarControl(searchDepth=2, Name = '更多')
# print(toolbar)
# button_omote = toolbar.ButtonControl(searchDepth = 3, Name = "远程协助弹出菜单")
# print(button_omote)

range.py

1
2
3
4
5
6
7
8
9
10
import os
import time
while True:
os.system("python D:\\File\\HexoBlogRdf\\source\\_data\\wechatspy.py")
for i in range(30):
if i%10==0 or i >= 20:
os.system("cls")
print("Countdown: "+str(30-i))
time.sleep(1)

  • Title: 说说的远程发布和博客的后面我编不下去了
  • Author: 11490DX
  • Created at : 2025-07-08 16:16:19
  • Updated at : 2025-07-28 08:02:56
  • Link: https://11490dx.net/2025/07/08/blog-sys/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
说说的远程发布和博客的后面我编不下去了