op

package module
v0.0.0-...-656716b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 2 Imported by: 0

README

WIP 活跃开发中...

  • 实现op所有的方法调用 截至2021-06-03 op wiki中所有提到的接口都已实现
  • 详细简洁的注释文档
  • 一键打包所有静态文件
  • 包含基本功能的图形界面api

例子

package main

import (
	"fmt"
	"github.com/kekeimiku/op-go"
)

func main() {
	op, _ := op.Load()
	fmt.Println("当前版本", op.Ver())
}

一个低配版后台鼠标模式的“自瞄”小游戏例子 aimbooster

视频里的小游戏是 http://www.aimbooster.com/

ChangeLog

2021-07-10

删除了大部分注释和cgo相关代码,注释是根据wiki生成的错误太多,准备抽时间重写,mavc的cgo有点难搞,放弃了,cgo和com感觉性能开销影响不大。(2021-07-12)基本确定了标准cgo性能开销暂时不如com...

!!!2021-06-11

发现op-go注释里面不少东西都写错啦!!!不建议看注释,简直直接看op的wiki,我会尽快修复

2021-06-11

尝试使用cgo方式调用

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opsoft

type Opsoft struct {
	// contains filtered or unexported fields
}

func Load

func Load() (*Opsoft, error)

加载op

func (*Opsoft) AStarFindPath

func (com *Opsoft) AStarFindPath(mapWidth, mapHeight int, disable_points string, beginX, beginY, endX, endY int) int

func (*Opsoft) BindWindow

func (com *Opsoft) BindWindow(hwnd int, display string, mouse string, keypad string, mode int) int

func (*Opsoft) Capture

func (com *Opsoft) Capture(x1, y1, x2, y2 int, file string) int

func (*Opsoft) CapturePre

func (com *Opsoft) CapturePre(file string) int

func (*Opsoft) ClientToScreen

func (com *Opsoft) ClientToScreen(hwnd int, x, y *int) int

func (*Opsoft) CmpColor

func (com *Opsoft) CmpColor(x int, y int, color string, sim float32) int

func (*Opsoft) EnableDisplayDebug

func (com *Opsoft) EnableDisplayDebug(enableDebug int) int

func (*Opsoft) EnableGetColorByCapture

func (com *Opsoft) EnableGetColorByCapture(enable int) int

func (*Opsoft) EnablePicCache

func (com *Opsoft) EnablePicCache(enable int) int

func (*Opsoft) EnumProcess

func (com *Opsoft) EnumProcess(name string) string

func (*Opsoft) EnumWindow

func (com *Opsoft) EnumWindow(parent int, title, className string, filter int) string

func (*Opsoft) EnumWindowByProcessId

func (com *Opsoft) EnumWindowByProcessId(pid int, title, className string, filter int) string

func (*Opsoft) EnumWindowSuper

func (com *Opsoft) EnumWindowSuper(spec1 string, flag1, type1 int, spec2 string, flag2, type2, sort int) string

func (*Opsoft) FindColor

func (com *Opsoft) FindColor(x1, y1, x2, y2 int, color string, sim float32, dir int, intX *int, intY *int) int

func (*Opsoft) FindColorEx

func (com *Opsoft) FindColorEx(x1, y1, x2, y2 int, color string, sim float32, dir int) string

func (*Opsoft) FindMultiColor

func (com *Opsoft) FindMultiColor(x1, y1, x2, y2 int, firstColor string, offsetColor string, sim float32, dir int, intX, intY *int) int

func (*Opsoft) FindMultiColorEx

func (com *Opsoft) FindMultiColorEx(x1, y1, x2, y2 int, firstColor string, offsetColor string, sim float32, dir int) string

func (*Opsoft) FindPic

func (com *Opsoft) FindPic(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int, intX, intY *int) int

func (*Opsoft) FindPicEx

func (com *Opsoft) FindPicEx(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int) string

func (*Opsoft) FindStr

func (com *Opsoft) FindStr(x1, y1, x2, y2 int, str string, colorFormat string, sim float32, intX *int, intY *int) int

func (*Opsoft) FindStrEx

func (com *Opsoft) FindStrEx(x1, y1, x2, y2 int, str, colorFormat string, sim float32) string

func (*Opsoft) FindWindow

func (com *Opsoft) FindWindow(class, title string) int

func (*Opsoft) FindWindowByProcess

func (com *Opsoft) FindWindowByProcess(processName, class, title string) int

func (*Opsoft) FindWindowByProcessId

func (com *Opsoft) FindWindowByProcessId(processId int, class, title string) int

func (*Opsoft) FindWindowEx

func (com *Opsoft) FindWindowEx(parent int, class, title string) int

func (*Opsoft) FindWindowSuper

func (com *Opsoft) FindWindowSuper(spec1 string, flag1, type1 int, spec2 string, flag2, type2 int) int

func (*Opsoft) GetBasePath

func (com *Opsoft) GetBasePath() string

func (*Opsoft) GetClientRect

func (com *Opsoft) GetClientRect(hwnd int, x1, y1, x2, y2 *int) int

func (*Opsoft) GetClientSize

func (com *Opsoft) GetClientSize(hwnd int, width, height *int) int

func (*Opsoft) GetCmdStr

func (com *Opsoft) GetCmdStr(path string, time int) string

func (*Opsoft) GetCursorPos

func (com *Opsoft) GetCursorPos(x, y *int) int

func (*Opsoft) GetForegroundFocus

func (com *Opsoft) GetForegroundFocus() int

func (*Opsoft) GetForegroundWindow

func (com *Opsoft) GetForegroundWindow() int

func (*Opsoft) GetID

func (com *Opsoft) GetID() int

func (*Opsoft) GetKeyState

func (com *Opsoft) GetKeyState(vkCode int) int

func (*Opsoft) GetLastError

func (com *Opsoft) GetLastError() int

func (*Opsoft) GetMousePointWindow

func (com *Opsoft) GetMousePointWindow() int

func (*Opsoft) GetPath

func (com *Opsoft) GetPath() string

func (*Opsoft) GetPointWindow

func (com *Opsoft) GetPointWindow(x, y int) int

func (*Opsoft) GetProcessInfo

func (com *Opsoft) GetProcessInfo(pid int) string

func (*Opsoft) GetScreenData

func (com *Opsoft) GetScreenData(x1, y1, x2, y2 int) int

func (*Opsoft) GetScreenDataBmp

func (com *Opsoft) GetScreenDataBmp(x1, y1, x2, y2 int, data, size *int) int

func (*Opsoft) GetSpecialWindow

func (com *Opsoft) GetSpecialWindow(flag int) int

func (*Opsoft) GetWindowClass

func (com *Opsoft) GetWindowClass(hwnd int) string

func (*Opsoft) GetWindowProcessId

func (com *Opsoft) GetWindowProcessId(hwnd int) int

func (*Opsoft) GetWindowProcessPath

func (com *Opsoft) GetWindowProcessPath(hwnd int) string

func (*Opsoft) GetWindowRect

func (com *Opsoft) GetWindowRect(hwnd int, x1, y1, x2, y2 *int) int

func (*Opsoft) GetWindowState

func (com *Opsoft) GetWindowState(hwnd, flag int) int

func (*Opsoft) GetWindowTitle

func (com *Opsoft) GetWindowTitle(hwnd int) string

func (*Opsoft) KeyDown

func (com *Opsoft) KeyDown(vkCode int) int

func (*Opsoft) KeyDownChar

func (com *Opsoft) KeyDownChar(keyStr string) int

func (*Opsoft) KeyPress

func (com *Opsoft) KeyPress(vkCode int) int

func (*Opsoft) KeyPressChar

func (com *Opsoft) KeyPressChar(keyStr string) int

func (*Opsoft) KeyUp

func (com *Opsoft) KeyUp(vkCode int) int

func (*Opsoft) KeyUpChar

func (com *Opsoft) KeyUpChar(keyStr string) int

func (*Opsoft) LeftClick

func (com *Opsoft) LeftClick() int

func (*Opsoft) LeftDoubleClick

func (com *Opsoft) LeftDoubleClick() int

func (*Opsoft) LeftDown

func (com *Opsoft) LeftDown() int

func (*Opsoft) LeftUp

func (com *Opsoft) LeftUp() int

func (*Opsoft) MiddleClick

func (com *Opsoft) MiddleClick() int

func (*Opsoft) MiddleDown

func (com *Opsoft) MiddleDown() int

func (*Opsoft) MiddleUp

func (com *Opsoft) MiddleUp() int

func (*Opsoft) MoveR

func (com *Opsoft) MoveR(rx, ry int) int

func (*Opsoft) MoveTo

func (com *Opsoft) MoveTo(x, y int) int

func (*Opsoft) MoveToEx

func (com *Opsoft) MoveToEx(x, y, w, h int) string

func (*Opsoft) MoveWindow

func (com *Opsoft) MoveWindow(hwnd, x, y int) int

func (*Opsoft) Ocr

func (com *Opsoft) Ocr(x1, y1, x2, y2 int, colorFormat string, sim float32) string

func (*Opsoft) OcrAuto

func (com *Opsoft) OcrAuto(x1, y1, x2, y2 int, sim float32) string

func (*Opsoft) OcrAutoFromFile

func (com *Opsoft) OcrAutoFromFile(colorFormat string, sim float32) string

func (*Opsoft) OcrEx

func (com *Opsoft) OcrEx(x1, y1, x2, y2 int, colorFormat string, sim float32) string

func (*Opsoft) OcrFromFile

func (com *Opsoft) OcrFromFile(fileName, colorFormat string, sim float32) string

func (*Opsoft) Release

func (com *Opsoft) Release()

释放

func (*Opsoft) RightClick

func (com *Opsoft) RightClick() int

func (*Opsoft) RightDown

func (com *Opsoft) RightDown() int

func (*Opsoft) RightUp

func (com *Opsoft) RightUp() int

func (*Opsoft) RunApp

func (com *Opsoft) RunApp(path string, mode int) int

func (*Opsoft) ScreenToClient

func (com *Opsoft) ScreenToClient(hwnd int, x, y *int) int

func (*Opsoft) SendPaste

func (com *Opsoft) SendPaste(hwnd int) int

func (*Opsoft) SendString

func (com *Opsoft) SendString(hwnd int, str string) int

func (*Opsoft) SetClientSize

func (com *Opsoft) SetClientSize(hwnd, width, height int) int

func (*Opsoft) SetDict

func (com *Opsoft) SetDict(index int, file string) int

func (*Opsoft) SetDisplayInput

func (com *Opsoft) SetDisplayInput(mode string) int

func (*Opsoft) SetPath

func (com *Opsoft) SetPath(path string) int

func (*Opsoft) SetShowErrorMsg

func (com *Opsoft) SetShowErrorMsg(show int) int

func (*Opsoft) SetWindowSize

func (com *Opsoft) SetWindowSize(hwnd, width, height int) int

func (*Opsoft) SetWindowState

func (com *Opsoft) SetWindowState(hwnd, flag int) int

func (*Opsoft) SetWindowText

func (com *Opsoft) SetWindowText(hwnd int, title string) int

func (*Opsoft) SetWindowTransparent

func (com *Opsoft) SetWindowTransparent(hwnd, trans int) int

func (*Opsoft) UnBindWindow

func (com *Opsoft) UnBindWindow() int

func (*Opsoft) UseDict

func (com *Opsoft) UseDict(index int) int

func (*Opsoft) Ver

func (com *Opsoft) Ver() string

func (*Opsoft) WaitKey

func (com *Opsoft) WaitKey(vkCode, timeOut int) int

func (*Opsoft) WheelDown

func (com *Opsoft) WheelDown() int

func (*Opsoft) WheelUp

func (com *Opsoft) WheelUp() int

func (*Opsoft) WinExec

func (com *Opsoft) WinExec(path string, dis int) int

Jump to

Keyboard shortcuts

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