init: mvp
This commit is contained in:
commit
e307989b9f
20 changed files with 835 additions and 0 deletions
53
main.go
Normal file
53
main.go
Normal file
|
@ -0,0 +1,53 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
_ "sync"
|
||||
"time"
|
||||
_ "time"
|
||||
|
||||
"github.com/wzrayyy/tappin/internal/clicker"
|
||||
)
|
||||
|
||||
func die_if(err error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
type account struct {
|
||||
Name string
|
||||
Phone string
|
||||
AuthKey string
|
||||
UserID int
|
||||
}
|
||||
|
||||
func main() {
|
||||
data, err := os.ReadFile("./accounts.json")
|
||||
die_if(err)
|
||||
|
||||
var accounts []account
|
||||
json.Unmarshal(data, &accounts)
|
||||
account := accounts[0]
|
||||
|
||||
c, err := clicker.NewClicker(account.AuthKey, account.UserID, clicker.Config{
|
||||
TapsPerSecond: 0,
|
||||
TapInterval: 2,
|
||||
UpdateFrequency: 3,
|
||||
})
|
||||
die_if(err)
|
||||
fmt.Println("a")
|
||||
|
||||
go c.Start()
|
||||
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
c.Config.TapInterval = 1
|
||||
time.Sleep(10 * time.Second)
|
||||
|
||||
err = c.Stop()
|
||||
|
||||
die_if(err)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue