A flexible Go client library for building custom clients, bots and automation tools for the Miscrits game.
WIP
- The implementation is unfinished
- Code is released early to help community build better tools
- Breaking changes are expected
go get github.com/Codi33/miscrits-clientBelow is minimal working example showing your in-game balance
package main
import (
"context"
"fmt"
"os"
"os/signal"
"time"
miscrits "github.com/Codi33/miscrits-client/pkg"
)
func main() {
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt)
rpcCtx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
client := miscrits.New()
if err := client.AuthenticateEmail("your_username", "your_password"); err != nil {
panic(err)
}
if err := client.Start(); err != nil {
panic(err)
}
balance, err := client.RpcCallId(rpcCtx, "get_balance", nil)
if err != nil {
panic(err)
}
/*
balance, err := client.RpcCall(rpcCtx, &api.Rpc{
Id: "get_balance",
})
*/
fmt.Println(balance)
<-interrupt
_ = client.Stop()
fmt.Println("Exit")
}More examples can be found in the examples directory, including:
- Authentication
- RPC usage patterns
- Long-running clients/bots
- Create documentation for the game rpc methods
- Implement methods for better interaction instead of raw api calls
Contributors are wery welcome!
If you want to help:
- Open an issue for bugs, ideas or questions
- Create pull request with fixes or improvements