Rewrite to Go: engine, plugin system, D2R plugin, API, loot filter
This commit is contained in:
parent
e0282a7111
commit
3b363192f2
60 changed files with 1576 additions and 3407 deletions
47
plugins/d2r/reader.go
Normal file
47
plugins/d2r/reader.go
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Screen reader for D2R — extracts game information from screenshots.
|
||||
package d2r
|
||||
|
||||
import (
|
||||
"image"
|
||||
|
||||
"git.cloonar.com/openclawd/iso-bot/pkg/plugin"
|
||||
)
|
||||
|
||||
// Reader implements plugin.ScreenReader for D2R.
|
||||
type Reader struct {
|
||||
config Config
|
||||
}
|
||||
|
||||
// NewReader creates a D2R screen reader.
|
||||
func NewReader(config Config) *Reader {
|
||||
return &Reader{config: config}
|
||||
}
|
||||
|
||||
// FindItems detects item labels on the ground.
|
||||
func (r *Reader) FindItems(frame image.Image) []plugin.DetectedItem {
|
||||
// TODO: Detect colored item text labels
|
||||
// - Gold text = unique
|
||||
// - Green text = set
|
||||
// - Yellow text = rare
|
||||
// - Orange text = runeword / crafted
|
||||
// - White/grey = normal/magic
|
||||
return nil
|
||||
}
|
||||
|
||||
// FindPortal locates a town portal on screen.
|
||||
func (r *Reader) FindPortal(frame image.Image) (image.Point, bool) {
|
||||
// TODO: Detect blue portal glow
|
||||
return image.Point{}, false
|
||||
}
|
||||
|
||||
// FindEnemies detects enemy positions.
|
||||
func (r *Reader) FindEnemies(frame image.Image) []image.Point {
|
||||
// TODO: Enemy health bar detection
|
||||
return nil
|
||||
}
|
||||
|
||||
// ReadText extracts text from a screen region.
|
||||
func (r *Reader) ReadText(frame image.Image, region image.Rectangle) string {
|
||||
// TODO: OCR on the given region
|
||||
return ""
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue