Здравствуйте, гость ( Вход | Регистрация )

> FindColor in image
kaltorak
сообщение 19.3.2024, 21:10
Сообщение #1


**

Neophyte
Сообщений: 21
Регистрация: 12.10.2021
Группа: Пользователи
Наличность: 0
Пользователь №: 20.106
Возраст: 30



Hey guys.

I would like to know if it is possible to search for a color in an image. I'm using printscreen to capture a part of a minimized window:

Код
printscreen #handle #x #y 465 465 c:\monster.png


Then I needed to identify whether the color 66047 is present in this monster.png image. If so, Uopilot will know that there are targets within range and will use the area skill to eliminate them.

I looked at the Wiki and some threads and couldn't find anything along those lines.
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
 
Ответить в эту темуОткрыть новую тему
Ответов
nykep
сообщение 20.3.2024, 16:42
Сообщение #2


****

Apprentice
Сообщений: 234
Регистрация: 1.9.2012
Группа: Пользователи
Наличность: 1231
Пользователь №: 15.246
Возраст: 25



Код
--lua
local screen = loadimage([[E:\screen.bmp]]) -- screen - address in memory
local a = findcolor (0, 0 ,1920, 1080, 66047, '%arr', screen, 1, 0)
if a then
    move (arr[1][1], arr[1][2])
end
deleteimage(screen)

I think this is what you need, BUT some coordinate shifts are possible here. I don't know how exactly this works.
https://uopilot.uokit.com/wiki/index.php?title=LoadImage
https://uopilot.uokit.com/wiki/index.php?ti...Loadimage_(Lua)
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения

Сообщений в этой теме


Ответить в эту темуОткрыть новую тему
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 

- Текстовая версия | Версия для КПК Сейчас: 19.6.2024, 17:30
Designed by Nickostyle