Compare commits
No commits in common. "b20a46cd3758a6f8ae2c48c8a8c3b962fdc227d9" and "b21e09cbb78339184215a00693e9c0e8e07939ac" have entirely different histories.
b20a46cd37
...
b21e09cbb7
28
README.md
28
README.md
@ -1,29 +1,3 @@
|
|||||||
# autoclick
|
# autoclick
|
||||||
|
|
||||||
Go auto-clicker that stores groups of locations.
|
Go auto-clicker
|
||||||
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"
|
|
||||||
```
|
|
@ -22,17 +22,9 @@ func (p Point) String() string {
|
|||||||
return fmt.Sprintf("(%v, %v)", p.X, p.Y)
|
return fmt.Sprintf("(%v, %v)", p.X, p.Y)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p Point) Click(button ...string) {
|
func (p Point) Click() {
|
||||||
buttonToClick := "left"
|
|
||||||
if len(button) > 0 && (button[0] == "left" || button[0] == "right") {
|
|
||||||
buttonToClick = button[0]
|
|
||||||
}
|
|
||||||
robotgo.Move(p.X, p.Y)
|
robotgo.Move(p.X, p.Y)
|
||||||
robotgo.Click(buttonToClick, false)
|
robotgo.Click("left", false)
|
||||||
}
|
|
||||||
|
|
||||||
func (p Point) RightClick() {
|
|
||||||
p.Click("right")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p1 *Point) GetDistance(p2 *Point) float64 {
|
func (p1 *Point) GetDistance(p2 *Point) float64 {
|
||||||
@ -153,15 +145,6 @@ func StringOscillator(s string, amplitude int) chan string {
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
func press(key string) {
|
|
||||||
robotgo.KeyTap(key)
|
|
||||||
}
|
|
||||||
|
|
||||||
func keyboardWrite(s string) {
|
|
||||||
robotgo.TypeStr(s)
|
|
||||||
robotgo.MilliSleep(100)
|
|
||||||
}
|
|
||||||
|
|
||||||
func ClickRepeatedly(s *SavedGroups, c chan os.Signal) {
|
func ClickRepeatedly(s *SavedGroups, c chan os.Signal) {
|
||||||
for index, g := range s.Groups {
|
for index, g := range s.Groups {
|
||||||
fmt.Printf("- Press %v to select %v\n", index+1, g.Name)
|
fmt.Printf("- Press %v to select %v\n", index+1, g.Name)
|
||||||
@ -176,9 +159,6 @@ func ClickRepeatedly(s *SavedGroups, c chan os.Signal) {
|
|||||||
fmt.Scanln(&discard)
|
fmt.Scanln(&discard)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if choice > len(s.Groups) {
|
|
||||||
choice = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
selection := s.Groups[choice-1]
|
selection := s.Groups[choice-1]
|
||||||
fmt.Printf("You selected %v. I'll be clicking in the following positions:\n", selection.Name)
|
fmt.Printf("You selected %v. I'll be clicking in the following positions:\n", selection.Name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user