Skip to content

Codi33/miscrits-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Miscrits client

A flexible Go client library for building custom clients, bots and automation tools for the Miscrits game.

๐Ÿšง Project Status

WIP

  • The implementation is unfinished
  • Code is released early to help community build better tools
  • Breaking changes are expected

Installation

go get github.com/Codi33/miscrits-client

๐Ÿš€ Quick Start

Below 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

TODOs

  • Create documentation for the game rpc methods
  • Implement methods for better interaction instead of raw api calls

๐Ÿค Contributing

Contributors are wery welcome!

If you want to help:

  • Open an issue for bugs, ideas or questions
  • Create pull request with fixes or improvements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages