MoonBot

Neil_

Активный
Автор темы
200
29
Версия MoonLoader
Другое
Какой раз пробую что-то сделать с помощью этой библиотеки, и постоянно возникают проблемы спавна бота

Lua:
function onBotIncomingRPC(bot, rpcId, bs)
    if (rpcId == 61) then
        local dialogId, style, title, b1, b2 = bs:readInt16(), bs:readInt8(), bs:readString8(), bs:readString8(), bs:readString8()
        if string.find(title, '%(1/4%)') then
            bot:sendDialogResponse(dialogId, 1, 0, '123123')
            print('BotReg 1')
        elseif string.find(title, '%[2/4%]') or string.find(title, '%[3/4%]') or string.find(title, '%[4/4%]') then
            bot:sendDialogResponse(dialogId, 1, 0, '')
            print('bot zaregalsa')
        end
        if string.find(title, 'Авторизация') then
            bot:sendDialogResponse(dialogId, 1, 0, '123123')
            print('botAvtorisirovalsa')
        end
    end
    if (rpcId == 134) then
        local tId = bs:readInt16()
        if (tId == 419) then
            bot:sendClickTextdraw(419)
            for k, lBot in pairs(bots) do
                if (bot.index == lBot.index) then
                    lBot.logined = true
                end
            end
            print('bot virbal skin')
        end
    end
    if rpcId == 68 then
        for k, lBot in pairs(bots) do
            if lBot.index == bot.index then
                lBot.logined = true
                bot:sendRequestSpawn()
                bot:sendSpawn()
                sendMessage(string.format('Бот[%s] %s[%s] появился на спавне.', bot.index, bot.name, bot.playerID))
            end
        end
    end
    if (rpcId == 93) then
        local color, msg = bs:readInt32(), bs:readString32()
        print(msg)
    end
end

Он попросту зависает на выборе скина и всё, айди текстдрава правильный, как пофиксить?
 
Решение
Какой раз пробую что-то сделать с помощью этой библиотеки, и постоянно возникают проблемы спавна бота

Lua:
function onBotIncomingRPC(bot, rpcId, bs)
    if (rpcId == 61) then
        local dialogId, style, title, b1, b2 = bs:readInt16(), bs:readInt8(), bs:readString8(), bs:readString8(), bs:readString8()
        if string.find(title, '%(1/4%)') then
            bot:sendDialogResponse(dialogId, 1, 0, '123123')
            print('BotReg 1')
        elseif string.find(title, '%[2/4%]') or string.find(title, '%[3/4%]') or string.find(title, '%[4/4%]') then
            bot:sendDialogResponse(dialogId, 1, 0, '')
            print('bot zaregalsa')
        end
        if string.find(title, 'Авторизация') then...

хуега)

РП игрок
Модератор
2,566
2,262
Какой раз пробую что-то сделать с помощью этой библиотеки, и постоянно возникают проблемы спавна бота

Lua:
function onBotIncomingRPC(bot, rpcId, bs)
    if (rpcId == 61) then
        local dialogId, style, title, b1, b2 = bs:readInt16(), bs:readInt8(), bs:readString8(), bs:readString8(), bs:readString8()
        if string.find(title, '%(1/4%)') then
            bot:sendDialogResponse(dialogId, 1, 0, '123123')
            print('BotReg 1')
        elseif string.find(title, '%[2/4%]') or string.find(title, '%[3/4%]') or string.find(title, '%[4/4%]') then
            bot:sendDialogResponse(dialogId, 1, 0, '')
            print('bot zaregalsa')
        end
        if string.find(title, 'Авторизация') then
            bot:sendDialogResponse(dialogId, 1, 0, '123123')
            print('botAvtorisirovalsa')
        end
    end
    if (rpcId == 134) then
        local tId = bs:readInt16()
        if (tId == 419) then
            bot:sendClickTextdraw(419)
            for k, lBot in pairs(bots) do
                if (bot.index == lBot.index) then
                    lBot.logined = true
                end
            end
            print('bot virbal skin')
        end
    end
    if rpcId == 68 then
        for k, lBot in pairs(bots) do
            if lBot.index == bot.index then
                lBot.logined = true
                bot:sendRequestSpawn()
                bot:sendSpawn()
                sendMessage(string.format('Бот[%s] %s[%s] появился на спавне.', bot.index, bot.name, bot.playerID))
            end
        end
    end
    if (rpcId == 93) then
        local color, msg = bs:readInt32(), bs:readString32()
        print(msg)
    end
end

Он попросту зависает на выборе скина и всё, айди текстдрава правильный, как пофиксить?
Попробуй отправить пакет онфут синхры
 
  • Нравится
Реакции: Lance_Sterling