|
|
|
I need help with a healing automation script |
|
|
Matheusochoa |
6.7.2023, 8:07
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
I'll start by apologizing for using the translator, I play an online game similar to tibia called LAWL MMORPG, and in it I've already managed to create a script to use manapotion and automated healing, in this game there's a function similar to tibia in the "exura sio" where I heal an ally, in this game I write in the chat bar /heal "nick" and it saves a hotkey to heal an ally, I would like a tip, or someone who could help me to assemble a script to automate this cure, it would be: identify my friend on the screen, because he doesn't have a fixed place where I can look for his life bar (which is making it difficult) locating him, to locate his life bar, and finally identify the amount of HP he has to automate healing for my ally, can anyone help me with this script in UoPilot? I'll leave the print of The game
Эскизы прикрепленных изображений
|
|
|
|
Matheusochoa |
6.7.2023, 17:01
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
What I thought of doing is that when the person is a Party leader, he has a blue symbol under the life bar, I thought of using this pixel to capture the coordinates, but I don't know how to store these coordinates to find the my ally's life bar, I'll leave an example of how it looks below Цитата(Matheusochoa @ 6.7.2023, 17:00) What I thought of doing is that when the person is a Party leader, he has a blue symbol under the life bar, I thought of using this pixel to capture the coordinates, but I don't know how to store these coordinates to find the my ally's life bar, I'll leave an example of how it looks below
Прикрепленные файлы
barra_de_vida.bmp ( 3,66 килобайт )
Кол-во скачиваний: 73
barra_de_vida.bmp ( 3,66 килобайт )
Кол-во скачиваний: 61
barra_de_vida.bmp ( 3,66 килобайт )
Кол-во скачиваний: 66
|
|
|
|
nykep |
7.7.2023, 2:31
|
Apprentice
Сообщений: 233
Регистрация: 1.9.2012 Группа: Пользователи Наличность: 1213
Пользователь №: 15.246
Возраст: 25
|
the logic could be like this - first you use findimage to find the blue icon. Just use findimage directly on the image you uploaded to get the exact coordinates of the blue icon. Then you need to select a point on the hp bar, for example, on the half when you already need to use the heal. Then calculate the difference in X and Y coordinates between the blue icon and the point on the hp bar. For example, the difference in X is 30, and in Y is 20. These values will be needed for the final script. Next, try to find the blue icon already in the game itself, if it works, then you can start searching for the hp bar. To do this, you need to use findcolor, in which the search area will consist of a single point. The coordinates of which will be taken from the findimage array, but adjusted, for example Код set #x %arr[1][1] + 30 set #y %arr[1][2] - 20
findcolor would be something like Код set #hp findcolor (#x, #y #x, #y 1 1 (1234-4321) %arr2 2 1 20) if #hp <> 1 sendex 5 // press 5 end_if
Since there is transparency, I recommend using a range in this findcolor and trying different deviations. https://uopilot.uokit.com/wiki/index.php?title=Findimagehttps://uopilot.uokit.com/wiki/index.php?title=Findcolor
|
|
|
|
Matheusochoa |
8.7.2023, 19:09
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
Thank you for helping me, so it's not in blue because the ally didn't want to be the leader of the party, but it's this blue that is above my name in the leader, so you can see better what I want to do? I want to look for the blue part of the leader, after searching try to capture where the life bar is, put a print of the life bar, how it gets low on life, will it participate in this method of yours that you've been giving me, will it Is there anything more efficient we can think of doing?
Прикрепленные файлы
TESTE1.bmp ( 3 мегабайт )
Кол-во скачиваний: 58
TESTE2.bmp ( 3 мегабайт )
Кол-во скачиваний: 56
TESTE3.bmp ( 3 мегабайт )
Кол-во скачиваний: 75
teste5.bmp ( 15,67 килобайт )
Кол-во скачиваний: 63
|
|
|
|
Matheusochoa |
9.7.2023, 6:01
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
set #icon findcolor (13, 36 1111, 712 (4001536-15744772) %icon 2 90 1 15) if #icon > 0 set #x1 %icon[1 1] set #x2 %icon[1 1] + 25 set #y1 %icon[1 2] - 12 set #y2 %icon[1 2] - 8 set #hp findcolor (#x1, #y1 #x2, #y2 1 1 (184067-710668) %hp 2 5 2 ) if_not #hp > 3 send F1 end_if end_if
-------------------------------------------------------------------------------------------------- this way worked best, I'm having trouble looking for the icon, can you give me a picture of the icon without the background? then I test its form, because if there is someone in blue on the map, it keeps healing, and I also have a problem that when the person walks, it seems that it takes time to process and is picking up the wrong pixel, there is a way to take one screen print, then it analyzes the print? In this way, it is already at a result of 65% good, but I wanted to adapt it to be better
|
|
|
|
Matheusochoa |
9.7.2023, 19:52
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
Now FindImage is working perfectly, but I'm having a problem with the life bar when I put it to find the green one, when I put it to find the Icon, and my ally is walking, he finds another coordinate other than the green one, because he is in motion, then it happens that he always heals, if he has stopped, he does not heal, so the script is at a 75% chance of success, I wanted to know if you can help me to locate when the life bar goes down, or when the dark part appears of it, but I'm having a problem because the bar is transparent, and it covers a lot when the background is light and the background is dark and ends up taking all the color codes (263172 dark) (4868167 light), I'll leave 2 prints below the backgrounds , and see how you can help me that way, or we are looking for another mechanic for this condition, or is there some way for us to access the game's settings, and remove the effect of the bar being transparent
Прикрепленные файлы
teste_1.bmp ( 13,03 килобайт )
Кол-во скачиваний: 57
teste_2.bmp ( 11,48 килобайт )
Кол-во скачиваний: 63
|
|
|
|
Matheusochoa |
9.7.2023, 22:52
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
today searching I came across printscreen #printscreen 0 0 0 0 C:\Users\Marcela\Desktop\picture2.bmp A solution came to me, could we use this screenshot to extract the data? before looking for the icon, does he take the print, find the icon in the print and analyze the life bar in the print?
set #icon findimage (13, 36 1111, 712 (C:\Users\Marcela\Desktop\icon.bmp) %icon 2 90 1 15) if #icon > 0 set #x1 %icon[1 1] + 20 set #x2 %icon[1 1] + 25 set #y1 %icon[1 2] - 12 set #y2 %icon[1 2] - 8
move #x1, #y1 get mouse_pos #startx #starty [abs] move #x2, #y2 get mouse_pos #endx #endy [abs]
set %a GetImage (#startx #starty #endx #endy [abs]) // ????????? ? ?????? ????? ???????? ??????? set $bmp SaveImage (%a [1 1] C:\Users\Marcela\Desktop\picture2.bmp) // ????????? ? ???? ?? ???? C:\
set #hp findcolor (#x1, #y1 #x2, #y2 1 1 (118273 - 973325 ) %ARR 2 80 1 5 ) if_not #hp > 3 send {F1} end_if set $b DeleteImage (%a [1 1]) end_if ----------------------------------------------------------------------------------------------------------------- I am also testing this code, it gives me a getimage of the end of the life bar, and in it I analyze if it still has the green, if it has the green it does not heal, if it does not find the green it will release the healing magic of my ally, but I'm having trouble putting Findcolor to analyze picture2.bmp. Do you know how to use findcolor in this image?
Прикрепленные файлы
picture2.bmp ( 78 байт )
Кол-во скачиваний: 58
|
|
|
|
nykep |
10.7.2023, 2:36
|
Apprentice
Сообщений: 233
Регистрация: 1.9.2012 Группа: Пользователи Наличность: 1213
Пользователь №: 15.246
Возраст: 25
|
|
|
|
|
Matheusochoa |
11.7.2023, 20:40
|
Neophyte
Сообщений: 11
Регистрация: 6.7.2023 Группа: Пользователи Наличность: 0
Пользователь №: 20.565
Возраст: 28
|
Цитата set linedelay 0 :start set #icon findimage (413, 200 941, 470 (C:\Users\Marcela\Desktop\icon.bmp) %icon 2 90 1 15) if #icon > 0 set #x1 %icon[1 1] +20 set #x2 %icon[1 1] + 25 set #y1 %icon[1 2] - 12 set #y2 %icon[1 2] - 8
set #hp findcolor (#x1, #y1 #x2, #y2 1 1 ( 118273 - 1039375 ) %ARR 2 80 1 5 ) if_not #hp > 3 send {F1} wait 200 end_if end_if goto start that way it was good, however as the doll walks fast on the screen when he goes to do the first Icon check he finds, when he goes to look for the life bar he is already in another space, and heals without need. The current syntax is like this: Search Icon> save coordinates and add coordinates to locate life bar> Finding life bar> Find if green is present in that pixel> If not found Heals, if not found Heals> Loop. I would like to try to do: Printscreen > Locate Icon (On printscreen) > Get the coordinates of the icon (On Printscreen) > Locate the life bar (On printscreen) > See if there is green (On printscreen) > Loop. That way, it wouldn't be a problem for my ally to keep moving, as he would analyze the printscreen (everything would be stable) Could we do it this way?
|
|
|
|
|
|
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0
|
|