utils

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDir added in v1.3.0

func CreateDir(path string) error

func FindCurrentCharacter

func FindCurrentCharacter(hWnd win.HWND, coords []Rect) int32

FindCurrentCharacter This function check the brightness of the pixels in the given coordinates to determine the current character

func GetAppPath added in v1.3.0

func GetAppPath() (string, error)

func GetPixelColor

func GetPixelColor(hWnd win.HWND, rect Rect) (color.RGBA, error)

func GetWindowsAccentColor added in v1.3.0

func GetWindowsAccentColor() (string, error)

func InitOcr

func InitOcr(cfg OCRConfig, hWnd win.HWND)

func LoadGameData

func LoadGameData()

func PanicRecover

func PanicRecover(r interface{}, guiApp ...fyne.App)

func SaveImg

func SaveImg(img image.Image, fileName string) error

Types

type Data

type Data struct {
	AssetID   string
	Value     string
	Message   string
	Region    string
	SubRegion string
}

func FindClosestCorrespondence

func FindClosestCorrespondence(text string, candidates []Data) Data

FindClosestCorrespondence This function is useful to mitigate OCR errors by finding the closest correspondence to the given text

type GameDataStruct

type GameDataStruct struct {
	Characters []Data
	Locations  []Data
	Menus      []Data
	SubMenus   []Data
	Bosses     []Data
}
var GameData *GameDataStruct

type OCRConfig

type OCRConfig struct {
	ExecutablePath      *string
	PreprocessThreshold *int
}

type OCRManager

type OCRManager struct {
	HWND win.HWND
	// contains filtered or unexported fields
}
var OcrManager *OCRManager

func (*OCRManager) StartOcr

func (m *OCRManager) StartOcr(path string) (string, error)

func (*OCRManager) WindowOcr

func (m *OCRManager) WindowOcr(rect Rect, job string, preprocess bool) (string, image.Image)

type PlayerInfo added in v1.4.0

type PlayerInfo struct {
	Player struct {
		UID      string `json:"uid"`
		Level    int    `json:"level"`
		Nickname string `json:"nickname"`
	} `json:"player"`
}

func GetPlayerInfos added in v1.4.0

func GetPlayerInfos(uuid string) (*PlayerInfo, error)

type Rect

type Rect struct {
	X, Y, Width, Height int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL