-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leo
committed
Mar 25, 2024
1 parent
e4487b8
commit feeaa22
Showing
11 changed files
with
312 additions
and
22 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
""" | ||
小瓶RPA python版本(Beta) | ||
https:#gitee.com/pbottle/pbottle-rpa | ||
示例 | ||
""" | ||
|
||
import pbottleRPA #引入小瓶RPA模块 | ||
import time | ||
|
||
|
||
print("=== 微信朋友圈自动点赞 ===") | ||
current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) | ||
print(current_time) | ||
|
||
pbottleRPA.showMsg('流程已开始运行','请打开电脑声音,关注运行日志信息') | ||
pbottleRPA.tts('准备开始运行朋友圈批量点赞脚本,适配1920分辨率屏幕') | ||
pbottleRPA.sleep(1000*7) | ||
|
||
|
||
resolution = pbottleRPA.getResolution() | ||
print('当前电脑屏幕分辨率',resolution) | ||
if (resolution["w"] != 1920 or resolution["ratio"] !=1) : | ||
pbottleRPA.tts('错误:此demo只适配1920分辨率无缩放屏幕') | ||
print('错误:此demo只适配1920分辨率无缩放屏幕') | ||
pbottleRPA.sleep(1000*6) | ||
pbottleRPA.exit() | ||
|
||
|
||
|
||
color = pbottleRPA.getScreenColor(1,resolution["h"] - 1); | ||
print('系统任务栏色:',color); | ||
|
||
|
||
|
||
#输入路径中不要有自定义中文 | ||
rs = pbottleRPA.waitImage('./input/pengYouQuanDianZan/0.png',lambda:print('等待中,请先打开电脑版微信界面'),120) | ||
|
||
|
||
|
||
#打开微信朋友圈 | ||
pbottleRPA.moveMouseSmooth(rs["x"],rs["y"]); | ||
pbottleRPA.mouseClick() | ||
pbottleRPA.moveMouseSmooth(1920/2,1080/2); | ||
|
||
#点赞计数 | ||
n = 0 | ||
|
||
#开始任务 | ||
def loop() : | ||
print('进入') | ||
global n | ||
|
||
rs = pbottleRPA.findScreen('./input/pengYouQuanDianZan/1.png',0.99,100,100) | ||
if (rs == False) : | ||
print('下一页') | ||
# pbottleRPA.keyTap('page down') #微信bug,按键容易加载不成功 | ||
pbottleRPA.mouseWheel() | ||
pbottleRPA.sleep(500) | ||
loop() | ||
|
||
else: | ||
|
||
pbottleRPA.moveMouseSmooth(rs["x"],rs["y"]); | ||
pbottleRPA.mouseClick() | ||
|
||
pbottleRPA.sleep(100) | ||
|
||
pbottleRPA.moveMouseSmooth(rs["x"]-167,rs["y"]); | ||
pbottleRPA.mouseClick() | ||
|
||
#点1000个赞就行了,不要贪杯 | ||
n += 1 | ||
if (n>=1000) : | ||
pbottleRPA.exit("") | ||
|
||
pbottleRPA.sleep(100) | ||
loop() #重复 | ||
|
||
loop() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
小瓶RPA python版本(Beta) | ||
https:#gitee.com/pbottle/pbottle-rpa | ||
示例 | ||
""" | ||
|
||
import pbottleRPA #引入小瓶RPA模块 | ||
import os | ||
import shutil | ||
|
||
# 获取当前工作目录 | ||
__dirname = os.getcwd() | ||
|
||
|
||
pbottleRPA.tts('打开文件夹') | ||
print('打开文件夹'); | ||
#延迟5秒 | ||
pbottleRPA.sleep(1000*3) | ||
print(__dirname + '\\input\\'); | ||
pbottleRPA.openDir(__dirname + '\\input\\') | ||
pbottleRPA.sleep(1000*2) | ||
|
||
pbottleRPA.tts('打开图片') | ||
print('打开图片'); | ||
pbottleRPA.openDir(__dirname + '/input/RPAlogo128.png') | ||
pbottleRPA.sleep(1000*2) | ||
pbottleRPA.tts('关闭') | ||
pbottleRPA.keyTap('alt+f4') | ||
pbottleRPA.sleep(1000) | ||
|
||
|
||
pbottleRPA.tts('复制文件') | ||
print('复制文件'); | ||
shutil.copy(__dirname + '/input/RPAlogo128.png',__dirname + '/input/RPAlogo128-新复制.png') | ||
pbottleRPA.sleep(1000*3) | ||
|
||
pbottleRPA.tts('删除文件') | ||
print('删除文件') | ||
os.remove(__dirname + '/input/RPAlogo128-新复制.png') | ||
|
||
pbottleRPA.tts('演示结束') | ||
print('演示结束'); | ||
pbottleRPA.showMsg('演示结束','请查看运行日志') |
Oops, something went wrong.