Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip AHK release files #7

Merged
merged 2 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
with:
in: AFB
build_dir: build
- name: Easy Zip Files
uses: vimtor/action-zip@v1
with:
files: AFB.ahk plugins/
dest: build/AFB.zip

- name: Release
uses: softprops/action-gh-release@v1
Expand All @@ -32,6 +37,6 @@ jobs:
files: |
build/AFB_64-bit.exe
build/AFB_32-bit.exe
AFB.ahk
build/AFB.zip
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
38 changes: 24 additions & 14 deletions AFB.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,40 @@ ONE_MIN := 1000 * 60
THREE_MINS := 3 * ONE_MIN
FIVE_MINS := 5 * ONE_MIN
SIXTEEN_MINS := 15 * ONE_MIN
DATA_DIR := A_ScriptDir . "\data"
RECONNECT_BUTTON_IMG := DATA_DIR . "\reconnect-button.png"
RECONNECT_TEXT_IMG := DATA_DIR . "\reconnect-text.png"
RECONNECT_IMG_SEARCH_ARRAY := [RECONNECT_BUTTON_IMG, RECONNECT_TEXT_IMG]

/*
globals
*/
IsRunning := false
DirCreate(DATA_DIR)
FileInstall(RECONNECT_BUTTON_IMG, RECONNECT_BUTTON_IMG, 1)
FileInstall(RECONNECT_TEXT_IMG, RECONNECT_TEXT_IMG, 1)

#MaxThreadsPerHotkey 2
F1:: {
global IsRunning := !IsRunning
While (IsRunning) {
if WinExist("Roblox") {
WinActivate ; defaults to WinExist
WinGetPos(&winX, &winY, &winWidth, &winHeight) ; defaults to WinExist
lastID := WinGetID("A")
robloxID := WinExist("Roblox")
if (robloxID) {
; BEGIN WORK
BlockInput(True)

WinActivate(robloxID)
WinGetPos(&winX, &winY, &winWidth, &winHeight, robloxID)

Reconnect(winWidth, winHeight)

BreakAFK()

WinActivate(lastID)
BlockInput(False)
; END OF WORK

antiKickInterval := GetIntervalMins()
sleep(antiKickInterval)
} else {
Expand All @@ -48,17 +64,11 @@ BreakAFK() {
*/
Reconnect(winWidth, winHeight) {
try {
searchImage := "plugins/roblox/reconnect-button.png"
if (ImageSearch(&foundX, &foundY, 0, 0, winWidth, winHeight, searchImage)) {
ClickImageMidPoint(searchImage, foundX, foundY)
return 1
}

; try with smaller image, this seems to be less reliable
searchImage := "plugins/roblox/reconnect-text.png"
if (ImageSearch(&foundX, &foundY, 0, 0, winWidth, winHeight, searchImage)) {
ClickImageMidPoint(searchImage, foundX, foundY)
return 1
for (searchImage in RECONNECT_IMG_SEARCH_ARRAY) {
if (ImageSearch(&foundX, &foundY, 0, 0, winWidth, winHeight, searchImage)) {
ClickImageMidPoint(searchImage, foundX, foundY)
return 1
}
}
} catch as exc {
MsgBox "Something went wrong when trying to check for reconnect button:`n" exc.Message
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ AutoHotkey scripts to specifically to help you when you're *Away From (Ro)Blox*

1. [Download latest release](/releases/latest)
2. Double-click to run
1. Optionally run as Administrator for input-blocking
3. Press `F1` to activate

## How to use (.ahk file)

1. **Install [AutoHotkey v2](https://www.autohotkey.com/download/ahk-v2.exe)** Beta or higher
2. [Download latest release](/releases/latest)
3. Double-click to run
1. Optionally run as Administrator for input-blocking
4. Press `F1` to activate

## TODO
Expand All @@ -24,11 +26,10 @@ AutoHotkey scripts to specifically to help you when you're *Away From (Ro)Blox*
* Eventually remove custom `ahk2exe` github action, once its been updated to support AHK v2 (watch [GitHub-Action-Ahk2Exe](https://github.com/nekocodeX/GitHub-Action-Ahk2Exe) repo)
* Modularity
* Support multiple games with unique AFK conditions and loops
* Swap back to last active window after executing anti-kick
* Startup config
* Options to select which modules/game actions to load
* Option for what the "AFK break action" is (default: space key)

## Contributing

See [contributing.md](contributing.md)
See [CONTRIBUTING.md](CONTRIBUTING.md)
File renamed without changes
File renamed without changes