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

 
Ответить в эту темуОткрыть новую тему
> I need you help About Inventory Cleaning
mandixX
сообщение 7.2.2020, 1:06
Сообщение #1


*

Registred
Сообщений: 6
Регистрация: 7.2.2020
Группа: Пользователи
Наличность: 0
Пользователь №: 19.541
Возраст: 21



Hello guys, so as I see this is a Russian Forum but as I don't know russian I will try to explain what I need help for on English.

The game is Talisman Online.
I would like the bot to clean my inventory from unwanted items. My idea is to scan each of my slots and check if this slot is = to a .bmp picture. If this picture isn't my item - REMOVE IT.

Tell me if you have any questions I'm a programmer but I'm learning how to code on UOPilot now please help .

(IMG:https://i.imgur.com/dTsDHge.png)


Эскизы прикрепленных изображений
Прикрепленное изображение
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
DarkMaster
сообщение 7.2.2020, 1:30
Сообщение #2


***********

Модератор UOPilot
Сообщений: 9.460
Регистрация: 2.12.2008
Группа: Супермодераторы
Наличность: 27707
Пользователь №: 11.279



All what you need - it findimage and left(mabe kleft if left dont work in this game).
Uopilot have 2 syntax. I strongly recommend to use lua syntax.
Код
--lua

-- it just example.
-- you need to undrestand it.


local images = { -- array
    "image1.bmp",
    "image2.bmp",
    "image3.bmp",
    "image4.bmp",
}

for image_number = 1, #images do
    local result = findimage(startX, startY, endX, endY,{images[imager_number]}, 2, 80, -1, 2)
    if result then
        for trash_in_inventory = 1, #result do
            -- idk how remove items in this game,
            -- but it must be here
            -- like example:
            -- click on item
            left(result[trash_in_inventory][1],result[trash_in_inventory][2])
            -- pres delete
            send217("{Delete}")
        end
    end
end



--------------------
Скрипты UOPilot под заказ.
Консультации по UOpilot 15$/час.
Услуги Lua разработчика (не пилот, проекты, постоянка)
Disсоrd:
Kov____
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
mandixX
сообщение 7.2.2020, 2:03
Сообщение #3


*

Registred
Сообщений: 6
Регистрация: 7.2.2020
Группа: Пользователи
Наличность: 0
Пользователь №: 19.541
Возраст: 21



Код
for image_number = 1, #images do
    local result = findimage(startX, startY, endX, endY,{images[imager_number]}, 2, 80, -1, 2)
    if result then
        for trash_in_inventory = 1, #result do
            -- idk how remove items in this game,
            -- but it must be here
            -- like example:
            -- click on item
            left(result[trash_in_inventory][1],result[trash_in_inventory][2])
            -- pres delete
            send217("{Delete}")
        end
    end
end



i have a qustion about this rows so startX, startY is the left top point of the square of the slot and endX, endY is the bottom right point of the square ?


Also what this row do ?
Код

send217("{Delete}")


Is that how you call a second function or what? I mean i need to have a delete function to delete the file and just call it like that ?
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
DarkMaster
сообщение 7.2.2020, 2:59
Сообщение #4


***********

Модератор UOPilot
Сообщений: 9.460
Регистрация: 2.12.2008
Группа: Супермодераторы
Наличность: 27707
Пользователь №: 11.279



Цитата
i have a qustion about this rows so startX, startY is the left top point of the square of the slot and endX, endY is the bottom right point of the square ?

yes
Цитата
Is that how you call a second function or what? I mean i need to have a delete function to delete the file and just call it like that ?

It press button "delete" on keyboard. It just for example. You need to write code or function and call it in this place for delete item.

Сообщение отредактировал DarkMaster - 7.2.2020, 3:00


--------------------
Скрипты UOPilot под заказ.
Консультации по UOpilot 15$/час.
Услуги Lua разработчика (не пилот, проекты, постоянка)
Disсоrd:
Kov____
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
mandixX
сообщение 7.2.2020, 14:42
Сообщение #5


*

Registred
Сообщений: 6
Регистрация: 7.2.2020
Группа: Пользователи
Наличность: 0
Пользователь №: 19.541
Возраст: 21



Код
 local images = { -- array
    "image1.bmp",
    "image2.bmp",
    "image3.bmp",
    "image4.bmp",
}


What is the path which i need to specify ? Do i need to input C\Desktop ....
or if i just do "image1.bmp" this is gonna be the file directory where my UOPilot.exe is ?




Also when i try to start the script it says
Код
 Unrecognized command: local
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
DarkMaster
сообщение 7.2.2020, 17:34
Сообщение #6


***********

Модератор UOPilot
Сообщений: 9.460
Регистрация: 2.12.2008
Группа: Супермодераторы
Наличность: 27707
Пользователь №: 11.279



Цитата

What is the path which i need to specify ? Do i need to input C\Desktop ....
or if i just do "image1.bmp" this is gonna be the file directory where my UOPilot.exe is ?

It can be relative path from pilot's exe or absolute path.
Цитата
Unrecognized command: local

are you keep "--lua" as first string? its a flag of lua syntax.


--------------------
Скрипты UOPilot под заказ.
Консультации по UOpilot 15$/час.
Услуги Lua разработчика (не пилот, проекты, постоянка)
Disсоrd:
Kov____
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
mandixX
сообщение 7.2.2020, 18:12
Сообщение #7


*

Registred
Сообщений: 6
Регистрация: 7.2.2020
Группа: Пользователи
Наличность: 0
Пользователь №: 19.541
Возраст: 21



I can't find any information about lua syntax on English

Also when I try to start it now it says


Код
15: '=' expected near '1'
--lua

-- it just example.
-- you need to undrestand it.
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения

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

 

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