Compare commits

..

2 Commits

Author SHA1 Message Date
b20a46cd37 Installation guide
Added installation steps to README file
2024-08-26 15:15:45 +02:00
0984a36f59 Minor improvements
- More general function to click
- Provided functions to press key and write string
- Prevent index error of user choice
2024-07-05 16:14:10 +02:00
2 changed files with 29 additions and 26 deletions

View File

@@ -1,3 +1,29 @@
# autoclick # autoclick
Go auto-clicker Go auto-clicker that stores groups of locations.
Based on [Robotgo](https://github.com/go-vgo/robotgo).
## Installation
Depending on your OS, you may require
[different dependencies](https://github.com/go-vgo/robotgo?tab=readme-ov-file#requirements).
If you are running MacOS, you just need to install Xcode Command Line Tools
and grant Go the accessibility permissions when prompted from the system.
```sh
xcode-select --install
```
Finally, once dependencies are met, to install autoclick run:
```bash
go install gogs.davte.it/Davte/autoclick@latest
```
To launch autoclick from any path, add this to your bash profile or bashrc:
```bash
export PATH="$PATH:/$HOME/go/bin"
```

View File

@@ -6,7 +6,6 @@ import (
"math" "math"
"os" "os"
"os/signal" "os/signal"
"strconv"
"strings" "strings"
"time" "time"
@@ -188,32 +187,10 @@ func ClickRepeatedly(s *SavedGroups, c chan os.Signal) {
} }
o := StringOscillator(".", 15) o := StringOscillator(".", 15)
var t int var t int
n := 1
var minDistance float64 var minDistance float64
for { for {
for i, p := range selection.Points { for _, p := range selection.Points {
if selection.Name == "akoya" { // hardcoded for Akoya presentation. #TODO: better handling (selection action list)
if i == 0 {
p.RightClick()
time.Sleep(100 * time.Millisecond)
press("v")
time.Sleep(500 * time.Millisecond)
} else if i == 1 {
time.Sleep(200 * time.Millisecond)
p.Click() p.Click()
time.Sleep(200 * time.Millisecond)
keyboardWrite(strconv.Itoa(n))
n++
time.Sleep(100 * time.Millisecond)
press("enter")
time.Sleep(500 * time.Millisecond)
} else {
p.Click()
time.Sleep(100 * time.Millisecond)
}
} else {
p.Click()
}
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
} }
fmt.Println(<-o) fmt.Println(<-o)