Lua [ARZ] | gruzchik - бот для работы грузчика

fokichevskiy

Участник
Автор темы
102
21
Версия SA-MP
  1. 0.3.7-R3

gruzchik​

бот для работы грузчика на Аризона рп
Зависимости:
mimgui

Активация: /gruz
Также нужно сломать мусорку, куда будет упираться бот. (ломается за пару ударов кулаком).​
 

Вложения

  • gruzchik.lua
    8.4 KB · Просмотры: 57
Последнее редактирование:

cloused2

Активный
310
92
imgui.OnInitialize(function()
themeexam()
imgui.GetIO().IniFilename = nil
local glyph_ranges = imgui.GetIO().Fonts:GetGlyphRangesCyrillic()
imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 14.0, nil, glyph_ranges)
smal = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 10.0, _, glyph_ranges)
big = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 18.0, _, glyph_ranges)
end)

зачем это в боте? ну океееей
 

fokichevskiy

Участник
Автор темы
102
21
imgui.OnInitialize(function()
themeexam()
imgui.GetIO().IniFilename = nil
local glyph_ranges = imgui.GetIO().Fonts:GetGlyphRangesCyrillic()
imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 14.0, nil, glyph_ranges)
smal = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 10.0, _, glyph_ranges)
big = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 18.0, _, glyph_ranges)
end)

зачем это в боте? ну океееей
это нужно для размеров текста в окне с интерфейсом и для темы
 

Char

Потрачен
329
103
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
опять?...
 

fokichevskiy

Участник
Автор темы
102
21
удалить объект нет?
Нет, просто кулаками бьешь по ней, и она ломается
Просто так маршрут короче намного

А, я наверное не так понял. Если ты про то чтобы удалить объект, то сегодня попробую и если получится обновлю
 
Последнее редактирование:
D

deleted-user-532248

Гость
BeginToPoint еще разве актуален? его же палят за три секунды
 

Tectrex

Активный
97
103
бро ты молодец, но код такой себе.
Вот бот грузчик от другого чувака:

Lua:
local enabled = false

require "lib.moonloader"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    sampRegisterChatCommand("gruzlo", function()
        enabled = not enabled
        local status = enabled and "Включен" or "Выключен"
        local color = enabled and 0x40FF40 or 0xFF4040
        sampAddChatMessage(string.format("[%s]: Бот %s", thisScript().name, status), -1)
    end)

    while not isSampAvailable() do wait(100) end

    sampAddChatMessage("[r1lawerScripts] GruzchikBot", -1)

    while true do
        wait(0)
        if enabled then
            moveToPoints()
        end
    end
end

function MovePlayer(move_code, isSprint)
    setGameKeyState(1, move_code)
    if isSprint then setGameKeyState(16, 255) end
end

function BeginToPoint(x, y, z, radius, move_code, isSprint)
    repeat
        local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
        SetAngle(x, y, z)
        MovePlayer(move_code, isSprint)
        local dist = getDistanceBetweenCoords3d(x, y, z, posX, posY, z)
        wait(0)
    until not enabled or dist < radius
end

function moveToPoints()
    local points = {
        {2033.359985, -1965.869995, 14.460000, 1000, -255, false},
        {2033.489990, -1958.329956, 14.420000, 680, -255, false},
        {2033.569946, -1964.030029, 14.460000, 11, -255, false},
        {2041.020020, -1964.880005, 14.460000, 11, -255, false},
        {2040.699951, -1975.660034, 13.580000, 11, -255, false},
        {2013.569946, -1978.910034, 13.570000, 11, -255, false},
        {2011.979980, -1989.640015, 13.570000, 11, -255, false},
        {2015.880005, -1973.800049, 13.580000, 11, -255, false}
    } 

    for i, point in ipairs(points) do
        BeginToPoint(point[1], point[2], point[3], 1.0, point[5], point[6])
        wait(point[4])
        if point[1] == 2033.489990 and point[2] == -1958.329956 and point[3] == 14.420000 then
            wait(600)
            sampSendClickTextdraw(528)
        end
    end
    setGameKeyState(14, 1)
    wait(20)
    setGameKeyState(14, 0)
end

function SetAngle(x, y, z)
    local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
    local pX = x - posX
    local pY = y - posY
    local zAngle = getHeadingFromVector2d(pX, pY)

    setCharHeading(PLAYER_PED, zAngle)

    restoreCameraJumpcut()
end
На будущее, не пихай везде imgui, оно не везде нужно
 
  • Ха-ха
Реакции: VanoKLR

fokichevskiy

Участник
Автор темы
102
21
как минимум, он не отоборажает в реконе эмуляцию клавиш
понял, изменю на другой к
бро ты молодец, но код такой себе.
Вот бот грузчик от другого чувака:

Lua:
local enabled = false

require "lib.moonloader"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    sampRegisterChatCommand("gruzlo", function()
        enabled = not enabled
        local status = enabled and "Включен" or "Выключен"
        local color = enabled and 0x40FF40 or 0xFF4040
        sampAddChatMessage(string.format("[%s]: Бот %s", thisScript().name, status), -1)
    end)

    while not isSampAvailable() do wait(100) end

    sampAddChatMessage("[r1lawerScripts] GruzchikBot", -1)

    while true do
        wait(0)
        if enabled then
            moveToPoints()
        end
    end
end

function MovePlayer(move_code, isSprint)
    setGameKeyState(1, move_code)
    if isSprint then setGameKeyState(16, 255) end
end

function BeginToPoint(x, y, z, radius, move_code, isSprint)
    repeat
        local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
        SetAngle(x, y, z)
        MovePlayer(move_code, isSprint)
        local dist = getDistanceBetweenCoords3d(x, y, z, posX, posY, z)
        wait(0)
    until not enabled or dist < radius
end

function moveToPoints()
    local points = {
        {2033.359985, -1965.869995, 14.460000, 1000, -255, false},
        {2033.489990, -1958.329956, 14.420000, 680, -255, false},
        {2033.569946, -1964.030029, 14.460000, 11, -255, false},
        {2041.020020, -1964.880005, 14.460000, 11, -255, false},
        {2040.699951, -1975.660034, 13.580000, 11, -255, false},
        {2013.569946, -1978.910034, 13.570000, 11, -255, false},
        {2011.979980, -1989.640015, 13.570000, 11, -255, false},
        {2015.880005, -1973.800049, 13.580000, 11, -255, false}
    }

    for i, point in ipairs(points) do
        BeginToPoint(point[1], point[2], point[3], 1.0, point[5], point[6])
        wait(point[4])
        if point[1] == 2033.489990 and point[2] == -1958.329956 and point[3] == 14.420000 then
            wait(600)
            sampSendClickTextdraw(528)
        end
    end
    setGameKeyState(14, 1)
    wait(20)
    setGameKeyState(14, 0)
end

function SetAngle(x, y, z)
    local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
    local pX = x - posX
    local pY = y - posY
    local zAngle = getHeadingFromVector2d(pX, pY)

    setCharHeading(PLAYER_PED, zAngle)

    restoreCameraJumpcut()
end
На будущее, не пихай везде imgui, оно не везде нужно
ты вообще про что? я конечно понимаю что mimgui не всегда нужно, но как минимум я практикуюсь создавая интерфейсы. и + так все интуитивно понятно, нежели каждый раз залезать в тему, чтобы посмотреть команды. да и вообще зачем ты здесь код на другого бота оставил