Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
fix time issue and add custom warn and menu
Browse files Browse the repository at this point in the history
  • Loading branch information
SummonHIM committed Dec 14, 2022
1 parent 8e75560 commit 3931395
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 46 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ jobs:
Expand-Archive -Path "$env:TEMP\ahk2exe.zip" -DestinationPath "$env:LOCALAPPDATA\Programs\AutoHotkey\Compiler" -Force
Remove-Item -Path "$env:TEMP\autohotkey.zip" -Force
Remove-Item -Path "$env:TEMP\ahk2exe.zip" -Force
Write-Output ("$env:LOCALAPPDATA\Programs\AutoHotkey;" + "$env:LOCALAPPDATA\Programs\AutoHotkey\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Output ("$env:LOCALAPPDATA\Programs\AutoHotkey;" + "$env:LOCALAPPDATA\Programs\AutoHotkey\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding UTF8 -Append
- name: Set version number
shell: pwsh
run: (Get-Content AutoWeMeeting.ahk) -Replace '脚本源代码执行', 'Build-$env:GITHUB_RUN_NUMBER' | Set-Content AutoWeMeeting.ahk -Encoding UTF8

- name: Build x64 binary file
shell: pwsh
run: |
ahk2exe.exe /in AutoWeMeeting.ahk /out AutoWeMeeting64.exe /base $env:LOCALAPPDATA\Programs\AutoHotkey\AutoHotkey64.exe
run: ahk2exe.exe /in AutoWeMeeting.ahk /out AutoWeMeeting64.exe /base $env:LOCALAPPDATA\Programs\AutoHotkey\AutoHotkey64.exe

- name: Build x32 binary file
shell: pwsh
run: |
ahk2exe.exe /in AutoWeMeeting.ahk /out AutoWeMeeting32.exe /base $env:LOCALAPPDATA\Programs\AutoHotkey\AutoHotkey32.exe
run: ahk2exe.exe /in AutoWeMeeting.ahk /out AutoWeMeeting32.exe /base $env:LOCALAPPDATA\Programs\AutoHotkey\AutoHotkey32.exe

- name: Zip file
shell: pwsh
Expand All @@ -54,10 +56,10 @@ jobs:
- name: Generate release body
shell: pwsh
run: |
Write-Output "## 下载此版本" | Out-File -FilePath ReleaseBody.txt -Encoding utf8
Write-Output "[![下载@Build-$env:GITHUB_RUN_NUMBER](https://img.shields.io/github/downloads/SummonHIM/AutoWeMeeting/Build-$env:GITHUB_RUN_NUMBER/total?label=%E4%B8%8B%E8%BD%BD%40Build-$env:GITHUB_RUN_NUMBER&style=for-the-badge)](https://github.com/SummonHIM/AutoWeMeeting/releases/download/Build-$env:GITHUB_RUN_NUMBER/AutoWeMeeting-Build-$env:GITHUB_RUN_NUMBER.zip)" | Out-File -FilePath ReleaseBody.txt -Encoding utf8 -Append
Write-Output "## 更新日志" | Out-File -FilePath ReleaseBody.txt -Encoding utf8 -Append
Write-Output "https://github.com/SummonHIM/AutoWeMeeting/compare/Build-$($env:GITHUB_RUN_NUMBER-1)...Build-$env:GITHUB_RUN_NUMBER" | Out-File -FilePath ReleaseBody.txt -Encoding utf8 -Append
Write-Output "## 下载此版本" | Out-File -FilePath ReleaseBody.txt -Encoding UTF8
Write-Output "[![下载@Build-$env:GITHUB_RUN_NUMBER](https://img.shields.io/github/downloads/SummonHIM/AutoWeMeeting/Build-$env:GITHUB_RUN_NUMBER/total?label=%E4%B8%8B%E8%BD%BD%40Build-$env:GITHUB_RUN_NUMBER&style=for-the-badge)](https://github.com/SummonHIM/AutoWeMeeting/releases/download/Build-$env:GITHUB_RUN_NUMBER/AutoWeMeeting-Build-$env:GITHUB_RUN_NUMBER.zip)" | Out-File -FilePath ReleaseBody.txt -Encoding UTF8 -Append
Write-Output "## 更新日志" | Out-File -FilePath ReleaseBody.txt -Encoding UTF8 -Append
Write-Output "https://github.com/SummonHIM/AutoWeMeeting/compare/Build-$($env:GITHUB_RUN_NUMBER-1)...Build-$env:GITHUB_RUN_NUMBER" | Out-File -FilePath ReleaseBody.txt -Encoding UTF8 -Append
- name: Upload artifact to workflows
uses: actions/upload-artifact@v3
Expand Down
106 changes: 70 additions & 36 deletions AutoWeMeeting.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
GetWeMeetLocation() {
#SingleInstance Force

GetWeMeetLocation() {
; 若 HKCU\SOFTWARE\Tencent\WeMeet 存在则返回注册表值
Loop Reg, "HKCU\SOFTWARE\Tencent\WeMeet", "R V"
{
Expand Down Expand Up @@ -49,10 +51,74 @@ LoadCSVSchedule(ReqParams) {
Return False
}

StartWeMeet(ReqIndex) {
TrayTip "正在启动会议 ID " LoadCSVSchedule("MeetID")[ReqIndex] ",请不要移动鼠标或键盘…", FormatTime(CheckTime " R") " 到钟!", 1
If (ProcessExist("wemeetapp.exe")) {
ProcessClose "wemeetapp.exe"
Sleep SleepTime
}
WinMinimizeAll
Run GetWeMeetLocation() "\wemeetapp.exe"
While !WinExist("ahk_exe wemeetapp.exe") {
Sleep SleepTime * 10
}
WinMoveTop "ahk_exe wemeetapp.exe"
Sleep SleepTime
ImageSearch &xJoinMeet, &yJoinMeet, 0, 0, 1000, 1000, "AWM-JoinMeet.png"
Click xJoinMeet, yJoinMeet
Sleep SleepTime
Loop 6
{
Send "{Backspace}"
Sleep 10
}
Sleep SleepTime
SendText LoadCSVSchedule("MeetID")[ReqIndex]
Sleep SleepTime
Send "{Enter}"
If (LoadCSVSchedule("PassWD")[ReqIndex]) {
Sleep SleepTime
SendText LoadCSVSchedule("PassWD")[ReqIndex]
Sleep SleepTime
Send "{Enter}"
}
WinMinimizeAllUndo
TrayTip "等待 " (SleepTime * 10) / 1000 " 秒后程序将隐藏后台。", "启动向导执行完毕", 1
Sleep SleepTime * 10
}

A_TrayMenu.Delete()
A_TrayMenu.Add("关于", MenuAbout)
A_TrayMenu.Add()
A_TrayMenu.Add("重新启动", MenuReload)
A_TrayMenu.Add("退出", MenuExit)
Persistent

MenuAbout(ItemName, ItemPos, MyMenu) {
TrayTip "版本号:脚本源代码执行`n正在为你打开项目官网!", "关于", 4
Run "https://github.com/SummonHIM/AutoWeMeeting"
}
MenuReload(ItemName, ItemPos, MyMenu) {
Reload
}
MenuExit(ItemName, ItemPos, MyMenu) {
ExitApp
}

if not FileExist("Schedule.csv") {
TrayTip "时间表文件 Schedule.csv 不存在!退出。", "缺少必要文件!", 3
Exit
}

if not FileExist("AWM-JoinMeet.png") {
TrayTip "图片 AWM-JoinMeet.png 不存在!退出。", "缺少必要文件!", 3
Exit
}

If (CheckWeMeetLocation()) {
TrayTip "请注意前台尽量不要打开窗口!", "程序已在后台运行!", 1
} Else {
TrayTip , "没有检测到腾讯会议!退出。", 2
TrayTip , "没有检测到腾讯会议!退出。", 3
Exit
}

Expand All @@ -66,40 +132,8 @@ if FileExist("Configs\SleepTime.cfg") {

While True {
For Index, CheckTime in LoadCSVSchedule("sDateTime") {
If (Number(FormatTime(CheckTime, "yyyyMMddhhmmss")) = Number(FormatTime(, "yyyyMMddhhmmss"))) {
TrayTip "正在启动会议 ID " LoadCSVSchedule("MeetID")[Index] ",请不要移动鼠标或键盘…", FormatTime(CheckTime " R") " 到钟!", 1
If (ProcessExist("wemeetapp.exe")) {
ProcessClose "wemeetapp.exe"
Sleep SleepTime
}
WinMinimizeAll
Run GetWeMeetLocation() "\wemeetapp.exe"
While !WinExist("ahk_exe wemeetapp.exe") {
Sleep SleepTime * 10
}
WinMoveTop "ahk_exe wemeetapp.exe"
Sleep SleepTime
ImageSearch &xJoinMeet, &yJoinMeet, 0, 0, 1000, 1000, "AWM-JoinMeet.png"
Click xJoinMeet, yJoinMeet
Sleep SleepTime
Loop 6
{
Send "{Backspace}"
Sleep 10
}
Sleep SleepTime
SendText LoadCSVSchedule("MeetID")[Index]
Sleep SleepTime
Send "{Enter}"
If (LoadCSVSchedule("PassWD")[Index]) {
Sleep SleepTime
SendText LoadCSVSchedule("PassWD")[Index]
Sleep SleepTime
Send "{Enter}"
}
WinMinimizeAllUndo
TrayTip "等待 " (SleepTime * 10) / 1000 " 秒后程序将隐藏后台。", "启动向导执行完毕", 1
Sleep SleepTime * 10
If (Number(FormatTime(CheckTime, "yyyyMMddHHmmss")) = Number(FormatTime(, "yyyyMMddHHmmss"))) {
StartWeMeet(Index)
}
}
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
## 注意事项
- 当脚本运行中,即使编辑时间表,保存也能马上应用。可以不用重启。
- 若你的电脑启动腾讯会议较为卡顿。可在程序目录创建 Configs\SleepTime.cfg 文件(其中`Configs`为文件夹名)。并在文件内直接输入执行延迟数值。单位毫秒。
- 若重复打开本软件,旧的进程将会被自动杀死。

**若时间已到运行时请:**
- **不要**移动鼠标或点击键盘。
- 虽然脚本会最小化所有窗口。但还是**尽量不要**打开窗口。
- **可以**关闭电脑屏幕,但**不能**进入锁屏状态。
- **可以**关闭电脑屏幕,但**不能**进入锁屏或休眠状态。
- **最好不要**启用缩放。
- 若使用 RDP(远程桌面连接),则**不能**最小化窗口。

## 时间表编写指南
编辑时间表之前你可能需要设置 **A-C 列单元格**为文本格式。如果你觉得使用表格软件太麻烦了你可以直接使用记事本编辑`csv`文件。
- A 列 (sDateTime):填具体运行时间,格式如下:[点击查看](https://wyagd001.github.io/v2/docs/commands/FileSetTime.htm#YYYYMMDD),示例:202212081355 即为 2022年12月8日13点55分
- B 列 (MeetID):填腾讯会议号
- C 列 (PassWD):填会议密码(可选)
Expand Down

0 comments on commit 3931395

Please sign in to comment.