Помощь в луа

endy panda

Новичок
Автор темы
19
1
Версия MoonLoader
.026-beta
Помогите сделать кнопку при нажатие чтоб появлялась доп окно рядом.
я побывал, но у меня окно закрывается и все.
Добавьте туда если не сложно будет эти товары, скрин 2
1602359234132.png
1602359512544.png
1602359309664.png

Lua:
require "lib.moonloader"
local imgui = require "imgui"
local encoding = require 'encoding'
local inicfg = require 'inicfg'
local ev = require 'samp.events'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local proc=0
local itog=0
local al=false
local mainIni = inicfg.load({
config =
{
amount = 0,
lien = false,
hlopock = false,
goldrul = false,
silverrul = false,
bronzerul = false,
stone = false,
stalon = false,
podarok = false,
bronze = false,
silver = false,
gold = false,
narko = false,
metal = false,
gtalon = false,
skid= false,
otm=false,
tushka=false,
meat=false,

meatin=0,
meatpr=0,
tushkain=0,
tushkapr=0,
otmin=0,
otmpr=0,
skidin = 0,
skidn = 0,
gtalonin = 0,
gtaloninpr = 0,
lienin = 0,
lieninpr = 0,
hlopockin = 0,
hlopockinpr = 0,
goldrulin = 0,
goldrulpr = 0,
silverrulin = 0,
silverrulpr = 0,
bronzerulin = 0,
bronzerulpr = 0,
stonein = 0,
stonepr = 0,
stalonin = 0,
staloninpr = 0,
podarokin = 0,
podarokinpr = 0,
goldin = 0,
goldpr = 0,
silverin = 0,
silverpr = 0,
bronzein = 0,
bronzepr = 0,
narkoin = 0,
narkoinpr = 0,
metalin = 0,
metalinpr = 0,


tt = false,
supreme = false,
larek1 = false,
larek2 = false,
larek3 = false,

ttin = 0,
supremein = 0,
larek1in = 0,
larek2in = 0,
larek3in = 0,
}
}, "FastBuy")

local status = inicfg.load(mainIni, 'FastBuy.ini')
if not doesFileExist('moonloader/config/FastBuy.ini') then inicfg.save(mainIni, 'FastBuy.ini') end

metal = imgui.ImBool(mainIni.config.metal)
hlopock = imgui.ImBool(mainIni.config.hlopock)
lien = imgui.ImBool(mainIni.config.lien)
goldrul = imgui.ImBool(mainIni.config.goldrul)
silverrul = imgui.ImBool(mainIni.config.silverrul)
bronzerul = imgui.ImBool(mainIni.config.bronzerul)
stone = imgui.ImBool(mainIni.config.stone)
stalon = imgui.ImBool(mainIni.config.stalon)
podarok = imgui.ImBool(mainIni.config.podarok)
silver = imgui.ImBool(mainIni.config.silver)
gold = imgui.ImBool(mainIni.config.gold)
bronze = imgui.ImBool(mainIni.config.bronze)
narko = imgui.ImBool(mainIni.config.narko)
gtalon = imgui.ImBool(mainIni.config.gtalon)
skid = imgui.ImBool(mainIni.config.skid)
otm = imgui.ImBool(mainIni.config.otm)
meat = imgui.ImBool(mainIni.config.meat)
tushka = imgui.ImBool(mainIni.config.tushka)
tt = imgui.ImBool(mainIni.config.tt)
supreme = imgui.ImBool(mainIni.config.supreme)
larek1 = imgui.ImBool(mainIni.config.larek1)
larek2 = imgui.ImBool(mainIni.config.larek2)
larek3 = imgui.ImBool(mainIni.config.larek3)

ttin = imgui.ImBuffer(''..mainIni.config.ttin, 20)
supremein = imgui.ImBuffer(''..mainIni.config.supremein, 20)
larek1in = imgui.ImBuffer(''..mainIni.config.larek1in, 20)
larek2in = imgui.ImBuffer(''..mainIni.config.larek2in, 20)
larek3in = imgui.ImBuffer(''..mainIni.config.larek3in, 20)
tushkain = imgui.ImBuffer(''..mainIni.config.tushkain, 20)
tushkapr = imgui.ImBuffer(''..mainIni.config.tushkapr, 20)
meatin = imgui.ImBuffer(''..mainIni.config.meatin, 20)
meatpr = imgui.ImBuffer(''..mainIni.config.meatpr, 20)
otmin = imgui.ImBuffer(''..mainIni.config.otmin, 20)
otmpr = imgui.ImBuffer(''..mainIni.config.otmpr, 20)
skidin = imgui.ImBuffer(''..mainIni.config.skidin, 20)
skidn = imgui.ImBuffer(''..mainIni.config.skidn, 20)
gtalonin = imgui.ImBuffer(''..mainIni.config.gtalonin, 20)
gtaloninpr = imgui.ImBuffer(''..mainIni.config.gtaloninpr, 20)
metalin = imgui.ImBuffer(''..mainIni.config.metalin, 20)
metalinpr = imgui.ImBuffer(''..mainIni.config.metalinpr, 20)
lienin = imgui.ImBuffer(''..mainIni.config.lienin, 20)
lieninpr = imgui.ImBuffer(''..mainIni.config.lieninpr, 20)
hlopockin = imgui.ImBuffer(''..mainIni.config.hlopockin, 20)
hlopockinpr = imgui.ImBuffer(''..mainIni.config.hlopockinpr, 20)
goldrulin = imgui.ImBuffer(''..mainIni.config.goldrulin, 20)
goldrulpr = imgui.ImBuffer(''..mainIni.config.goldrulpr, 20)
silverrulin = imgui.ImBuffer(''..mainIni.config.silverrulin, 20)
silverrulpr = imgui.ImBuffer(''..mainIni.config.silverrulpr, 20)
bronzerulin = imgui.ImBuffer(''..mainIni.config.bronzerulin, 20)
bronzerulpr = imgui.ImBuffer(''..mainIni.config.bronzerulpr, 20)
stonein = imgui.ImBuffer(''..mainIni.config.stonein, 20)
stonepr = imgui.ImBuffer(''..mainIni.config.stonepr, 20)
stalonin = imgui.ImBuffer(''..mainIni.config.stalonin, 20)
staloninpr = imgui.ImBuffer(''..mainIni.config.staloninpr, 20)
podarokin = imgui.ImBuffer(''..mainIni.config.podarokin, 20)
podarokinpr = imgui.ImBuffer(''..mainIni.config.podarokinpr, 20)
silverin = imgui.ImBuffer(''..mainIni.config.silverin, 20)
silverpr = imgui.ImBuffer(''..mainIni.config.silverpr, 20)
goldin = imgui.ImBuffer(''..mainIni.config.goldin, 20)
goldpr = imgui.ImBuffer(''..mainIni.config.goldpr, 20)
bronzein = imgui.ImBuffer(''..mainIni.config.bronzein, 20)
bronzepr = imgui.ImBuffer(''..mainIni.config.bronzepr, 20)
narkoin = imgui.ImBuffer(''..mainIni.config.narkoin, 20)
narkoinpr = imgui.ImBuffer(''..mainIni.config.narkoinpr, 20)

local main_window_state = imgui.ImBool(false)

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage ("{60FF60}[FastBuy {DAA520}by {FF0000}NECTOR] {FFFFFF}Загружен успешно!", -1)
    sampAddChatMessage ("{60FF60}[FastBuy {DAA520}by {FF0000}NECTOR] {FFFFFF}Команда активации /busy.", -1)
    sampRegisterChatCommand("buuy", function() main_window_state.v = not main_window_state.v end)
    while true do
        wait(0)
        if main_window_state.v then
            imgui.ShowCursor = true
      imgui.Process = true
    else
      imgui.Process = false
    end
            imgui.Process = main_window_state.v
    end
end

function imgui.OnDrawFrame()
    if main_window_state.v then
        local sw, sh = getScreenResolution()
        imgui.SetNextWindowPos(imgui.ImVec2(sw / 2 , sh / 2), imgui.Cond.FirsUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.Begin(u8"FastBuy by NECTOR", main_window_state, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoCollapse)
        imgui.SetCursorPos(imgui.ImVec2(10,40))
        imgui.BeginChild("##skup", imgui.ImVec2(270, 50), true, imgui.WindowFlags.NoScrollbar)
        imgui.SetCursorPos(imgui.ImVec2(10, 8))
        if imgui.Button(u8"Начать скупку", imgui.ImVec2(250,35)) then
            skup()
        end
        imgui.EndChild()
        imgui.SetCursorPos(imgui.ImVec2(10, 89))
        imgui.BeginChild('##tovari', imgui.ImVec2(270, 469), true, imgui.WindowFlags.NoScrollbar)
        imgui.PushItemWidth(48)

        imgui.Checkbox("##0", narko)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. нарко", narkoin)
        imgui.InputText(u8"Процент на нарко", narkoinpr)

        imgui.Separator()

        imgui.Checkbox("##1",stalon)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. фам талона", stalonin)
        imgui.InputText(u8"Процент на фам талоны", staloninpr)

        imgui.Separator()

        imgui.Checkbox("##2",skid)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. скид талона", skidin)
        imgui.InputText(u8"Кол-во скид талонов", skidn)

        imgui.Separator()

        imgui.Checkbox("##3",podarok)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. подарка", podarokin)
        imgui.InputText(u8"Процент на подарки", podarokinpr)

        imgui.Separator()

        imgui.Checkbox("##4",bronzerul)
        imgui.SameLine()
        imgui.InputText(u8'Цена за ед. бронз рулетки', bronzerulin)
        imgui.InputText(u8'Процент на бронз рулетки', bronzerulpr)

        imgui.Separator()

        imgui.Checkbox("##5",silverrul)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. сереб рулетки", silverrulin)
        imgui.InputText(u8"Процент на сереб рулетки", silverrulpr)

        imgui.Separator()

        imgui.Checkbox("##6",goldrul)
        imgui.SameLine()
        imgui.InputText(u8'Цена за ед. gold рулетки',goldrulin)
        imgui.InputText(u8'Процент на gold рулетки',goldrulpr)

        imgui.Separator()

        imgui.Checkbox("##7",lien)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. льна", lienin)
        imgui.InputText(u8"Процент на лен", lieninpr)

        imgui.Separator()

        imgui.Checkbox("##8",hlopock)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. хлопка", hlopockin)
        imgui.InputText(u8"Процент на хлопок", hlopockinpr)

        imgui.Separator()

        imgui.Checkbox("##9",stone)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. каменя", stonein)
        imgui.InputText(u8"Процент на камень", stonepr)

        imgui.Separator()

        imgui.Checkbox("##10", metal)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. металла", metalin)
        imgui.InputText(u8"Процент на металл", metalinpr)

        imgui.Separator()

        imgui.Checkbox("##11",bronze)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. бронзы",bronzein)
        imgui.InputText(u8"Процент на бронзу",bronzepr)

        imgui.Separator()

        imgui.Checkbox("##12",silver)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. серебра", silverin)
        imgui.InputText(u8"Процент на серебро", silverpr)

        imgui.Separator()

        imgui.Checkbox("##13",gold)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. золота", goldin)
        imgui.InputText(u8"Процент на золото", goldpr)

        imgui.Separator()

        imgui.Checkbox("##14",meat)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. жар. мяса", meatin)
        imgui.InputText(u8"Процент на жар. мясо", meatpr)

        imgui.Separator()

        imgui.Checkbox("##15",tushka)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. тушки оленя", tushkain)
        imgui.InputText(u8"Процент на тушки оленя", tushkapr)

        imgui.Separator()

        imgui.Checkbox("##16",gtalon)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. гр талона", gtalonin)
        imgui.InputText(u8"Процент на гр талоны", gtaloninpr)

        imgui.Separator()

        imgui.Checkbox("##17",otm)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ед. отмычки", otmin)
        imgui.InputText(u8"Процент на отмычки", otmpr)

        imgui.Separator()

        imgui.Checkbox("##19", tt)
        imgui.SameLine()
        imgui.InputText(u8"Цена за Твин-Турбо", ttin)

        imgui.Separator()

        imgui.Checkbox("##20",supreme)
        imgui.SameLine()
        imgui.InputText(u8"Цена за SUPREME", supremein)

        imgui.Separator()

        imgui.Checkbox("##21",larek1)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ларек нарко (1)", larek1in)

        imgui.Separator()

        imgui.Checkbox("##22",larek2)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ларек яблоки (2)", larek2in)

        imgui.Separator()

        imgui.Checkbox("##23",larek3)
        imgui.SameLine()
        imgui.InputText(u8"Цена за ларек доллар (3)", larek3in)
        imgui.EndChild()
        imgui.SetCursorPos(imgui.ImVec2(10, 557))
        imgui.BeginChild('##save',imgui.ImVec2(270, 50), true, imgui.WindowFlags.NoScrollbar)
        imgui.SetCursorPos(imgui.ImVec2(10, 7))
        if imgui.Button(u8'Сохранить настройки',imgui.ImVec2(255,35)) then
            mainIni.config.skid = skid.v
            mainIni.config.tt = tt.v
            mainIni.config.supreme = supreme.v
            mainIni.config.larek1 = larek1.v
            mainIni.config.larek2 = larek2.v
            mainIni.config.larek3 = larek3.v
            mainIni.config.skidin = skidin.v
            mainIni.config.skidn = skidn.v
            mainIni.config.ttin = ttin.v
            mainIni.config.supremein = supremein.v
            mainIni.config.larek1in = larek1in.v
            mainIni.config.larek2in = larek2in.v
            mainIni.config.larek3in = larek3in.v

            mainIni.config.tushka = tushka.v
            mainIni.config.tushkain = tushkain.v
            mainIni.config.tushkapr = tushkapr.v
            mainIni.config.meat = meat.v
            mainIni.config.meatin = meatin.v
            mainIni.config.meatpr = meatpr.v
            mainIni.config.lien = lien.v
            mainIni.config.otm = otm.v
            mainIni.config.otmin = otmin.v
            mainIni.config.otmpr = otmpr.v
            mainIni.config.hlopock = hlopock.v
            mainIni.config.goldrul = goldrul.v
            mainIni.config.silverrul = silverrul.v
            mainIni.config.bronzerul = bronzerul.v
            mainIni.config.stone = stone.v
            mainIni.config.stalon = stalon.v
            mainIni.config.podarok = podarok.v
            mainIni.config.goldin = goldin.v
            mainIni.config.goldpr = goldpr.v
            mainIni.config.bronzein = bronzein.v
            mainIni.config.bronzepr = bronzepr.v
            mainIni.config.silverin = silverin.v
            mainIni.config.silverpr = silverpr.v
            mainIni.config.lienin = lienin.v
            mainIni.config.lieninpr = lieninpr.v
            mainIni.config.hlopockin = hlopockin.v
            mainIni.config.hlopockinpr = hlopockinpr.v
            mainIni.config.goldrulin = goldrulin.v
            mainIni.config.goldrulpr = goldrulpr.v
            mainIni.config.silverrulin = silverrulin.v
            mainIni.config.silverrulpr = silverrulpr.v
            mainIni.config.bronzerulin = bronzerulin.v
            mainIni.config.bronzerulpr = bronzerulpr.v
            mainIni.config.stonein = stonein.v
            mainIni.config.stonepr = stonepr.v
            mainIni.config.stalonin = stalonin.v
            mainIni.config.staloninpr = staloninpr.v
            mainIni.config.podarokin = podarokin.v
            mainIni.config.podarokinpr = podarokinpr.v
            mainIni.config.gold = gold.v
            mainIni.config.bronze = bronze.v
            mainIni.config.silver = silver.v
            mainIni.config.narko = narko.v
            mainIni.config.narkoin = narkoin.v
            mainIni.config.narkoinpr = narkoinpr.v
            mainIni.config.metal = metal.v
            mainIni.config.metalin = metalin.v
            mainIni.config.metalinpr = metalinpr.v
            mainIni.config.gtalon = gtalon.v
            mainIni.config.gtalonin = gtalonin.v
            mainIni.config.gtaloninpr = gtaloninpr.v
            inicfg.save(mainIni, 'FastBuy.ini')
            proc = 0
            superproc()
            if proc>1.0000000002 then
                sampAddChatMessage('{60FF60}[FastBuy {DAA520}by {FF0000}NECTOR] {ffffff}Успешно сохранено! {FF0000}Внимание{FFFAFA}, проценты привышают 1: {FF0000}'..proc,-1)
            else
                sampAddChatMessage('{60FF60}[FastBuy {DAA520}by {FF0000}NECTOR] {ffffff}Успешно сохранено! Проценты в норме: {00FF00}'..proc,-1)
            end
        end
        imgui.EndChild()
        imgui.End()
    end
end

function ev.onShowDialog(id, style, title, button1, button2, text)
    if id==3040 then
        al=true
    else
        al=false
  end
end

function skup()
    lua_thread.create(function()
        local money=getPlayerMoney(PLAYER_HANDLE)
        if tt.v and tonumber(ttin.v)~=0 then
            money=money-tonumber(ttin.v)
        end
        if supreme.v and tonumber(supremein.v)~=0 then
            money=money-tonumber(supremein.v)
        end
        if larek1.v and tonumber(larek1in.v)~=0 then
            money=money-tonumber(larek1in.v)
        end
        if larek2.v and tonumber(larek2in.v) ~= 0 then
            money=money-tonumber(larek2in.v)
        end
        if larek3.v and tonumber(larek3in.v) ~=0 then
            money=money-tonumber(larek3in.v)
        end
        if skid.v and tonumber(skidin.v) ~=0 then
            money=money-(tonumber(skidin.v)*tonumber(skidn.v))
        end
        proc=0
        superproc()
        if (money<0) then
            sampAddChatMessage('{FF0000}[Ошибка] {FFFAFA}Не хватает денег на скуп, убери несколько товаров.', -1)
        elseif proc >1.000002 then
            sampAddChatMessage('{FF0000}[Ошибка] {FFFAFA}Распределите проценты так, чтобы они не превосходили 1. Сейчас: {FF0000}'..proc, -1)
        elseif not al then
            sampAddChatMessage('{FF0000}[Ошибка] {FFFAFA}Нажмите alt.', -1)
        else
            if al then
                itog=0
                al=false
                if narko.v then
                    amount=math.floor(tonumber(narkoinpr.v)*money/tonumber(narkoin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 0, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..narkoin.v)
                    itog=itog+tonumber(amount)*tonumber(narkoin.v)
                end
                wait(10)
                if metal.v then
                    amount=math.floor(tonumber(metalinpr.v)*money/tonumber(metalin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 7, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..metalin.v)
                    itog=itog+tonumber(amount)*tonumber(metalin.v)
                end
                wait(10)
                if lien.v then
                    amount=math.floor(tonumber(lieninpr.v)*money/tonumber(lienin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 5, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..lienin.v)
                    itog=itog+tonumber(amount)*tonumber(lienin.v)
                 end
                 wait(10)
                if hlopock.v then
                    amount=math.floor(tonumber(hlopockinpr.v)*money/tonumber(hlopockin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 4, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..hlopockin.v)
                    itog=itog+tonumber(amount)*tonumber(hlopockin.v)
                end
                wait(10)
                if goldrul.v then
                    amount=math.floor(tonumber(goldrulpr.v)*money/tonumber(goldrulin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 12, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..goldrulin.v)
                    itog=itog+tonumber(amount)*tonumber(goldrulin.v)
                end
                wait(10)
                if silverrul.v then
                    amount=math.floor(tonumber(silverrulpr.v)*money/tonumber(silverrulin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 11, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..silverrulin.v)
                    itog=itog+tonumber(amount)*tonumber(silverrulin.v)
                end
                wait(10)
                if bronzerul.v then
                    amount=math.floor(tonumber(bronzerulpr.v)*money/tonumber(bronzerulin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 10, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..bronzerulin.v)
                    itog=itog+tonumber(amount)*tonumber(bronzerulin.v)
                end
                wait(10)
                 if stone.v then
                    amount=math.floor(tonumber(stonepr.v)*money/tonumber(stonein.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 6, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..stonein.v)
                    itog=itog+tonumber(amount)*tonumber(stonein.v)
                end
                wait(10)
                 if bronze.v then
                    amount=math.floor(tonumber(bronzepr.v)*money/tonumber(bronzein.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 8, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..bronzein.v)
                    itog=itog+tonumber(amount)*tonumber(bronzein.v)
                end
                 wait(10)
                if silver.v then
                    amount=math.floor(tonumber(silverpr.v)*money/tonumber(silverin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 9, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..silverin.v)
                    itog=itog+tonumber(amount)*tonumber(silverin.v)
                end
                wait(10)
                if gold.v then
                    amount=math.floor(tonumber(goldpr.v)*money/tonumber(goldin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 10, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..goldin.v)
                    itog=itog+tonumber(amount)*tonumber(goldin.v)
                end
                 wait(10)
                if stalon.v then
                    amount=math.floor(tonumber(staloninpr.v)*money/tonumber(stalonin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 12, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..stalonin.v)
                    itog=itog+tonumber(amount)*tonumber(stalonin.v)
                end
                 wait(10)
                if podarok.v then
                    amount=math.floor(tonumber(podarokinpr.v)*money/tonumber(podarokin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 7, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..podarokin.v)
                    itog=itog+tonumber(amount)*tonumber(podarokin.v)
                end
                wait(10)
                if gtalon.v then
                    amount=math.floor(tonumber(gtaloninpr.v)*money/tonumber(gtalonin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 7, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..gtalonin.v)
                    itog=itog+tonumber(amount)*tonumber(gtalonin.v)
                end
                wait(10)
                if otm.v then
                    amount=math.floor(tonumber(otmpr.v)*money/tonumber(otmin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 9, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..otmin.v)
                    itog=itog+tonumber(amount)*tonumber(otmin.v)
                end
                wait(10)
                if skid.v then
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 6, '')
                    sampSendDialogResponse(3060, 1, 0, skidn.v..' '..skidin.v)
                    itog=itog+tonumber(skidn.v)*tonumber(skidin.v)
                end
                wait(10)
                if tt.v then
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 9, '')
                    sampSendDialogResponse(3060, 1, 0, ttin.v)
                    itog=itog+tonumber(ttin.v)
                end
                wait(10)
                if supreme.v then
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 8, '')
                    sampSendDialogResponse(3060, 1, 0, supremein.v)
                    itog=itog+tonumber(supremein.v)
                end
                wait(10)
                if larek1.v then
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 16, '')
                    sampSendDialogResponse(3060, 1, 0, larek1in.v)
                    itog=itog+tonumber(larek1in.v)
                end
                wait(10)
                if larek2.v then
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 17, '')
                    sampSendDialogResponse(3060, 1, 0, larek2in.v)
                    itog=itog+tonumber(larek2in.v)
                end
                wait(10)
                if larek3.v then
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 18, '')
                    sampSendDialogResponse(3060, 1, 0, larek3in.v)
                    itog=itog+tonumber(larek3in.v)
                end
                wait(10)
                if tushka.v then
                    amount=math.floor(tonumber(tushkapr.v)*money/tonumber(tushkain.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 14, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..tushkain.v)
                    itog=itog+tonumber(amount)*tonumber(tushkain.v)
                end
                wait(10)
                if meat.v then
                    amount=math.floor(tonumber(meatpr.v)*money/tonumber(meatin.v))
                    sampSendDialogResponse(3040, 1, 0, '')
                    sampSendDialogResponse(3050, 1, 19, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 20, '')
                    sampSendDialogResponse(3050, 1, 17, '')
                    sampSendDialogResponse(3060, 1, 0, amount..' '..meatin.v)
                    itog=itog+tonumber(amount)*tonumber(meatin.v)
                end
                wait(500)
                sampAddChatMessage('{60FF60}[FastBuy {DAA520}by {FF0000}NECTOR] {ffffff}Товары успешно выставлены! Сумма скупа составила: {00FF00}'..itog, -1)
            end
        end
    end)
end

function superproc()
    if narko.v then proc = proc+tonumber(narkoinpr.v) end
    if metal.v then proc = proc + tonumber(metalinpr.v) end
    if lien.v then proc = proc + tonumber(lieninpr.v) end
    if hlopock.v then proc = proc + tonumber(hlopockinpr.v) end
    if goldrul.v then proc = proc + tonumber(goldrulpr.v) end
    if silverrul.v then proc = proc + tonumber(silverrulpr.v) end
    if bronzerul.v then proc = proc + tonumber(bronzerulpr.v) end
    if stone.v then proc = proc + tonumber(stonepr.v) end
    if bronze.v then proc = proc + tonumber(bronzepr.v) end
    if silver.v then proc = proc + tonumber(silverpr.v) end
    if gold.v then proc = proc + tonumber(goldpr.v) end
    if stalon.v then proc = proc + tonumber(staloninpr.v) end
    if podarok.v then proc = proc + tonumber(podarokinpr.v) end
    if gtalon.v then proc= proc + tonumber(gtaloninpr.v) end
    if otm.v then proc = proc + tonumber(otmpr.v) end
    if meat.v then proc = proc + tonumber(meatpr.v)end
    if tushka.v then proc = proc + tonumber(tushkapr.v) end
end


function applystyleN()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local clr = imgui.Col
    local ImVec4 = imgui.ImVec4
    local ImVec2 = imgui.ImVec2
    style.WindowPadding = ImVec2(15, 15)
    style.WindowRounding = 6.0
    style.FramePadding = ImVec2(5, 5)
    style.FrameRounding = 4.0
    style.ItemSpacing = ImVec2(12, 8)
    style.ItemInnerSpacing = ImVec2(8, 6)
    style.IndentSpacing = 25.0
    style.ScrollbarSize = 15.0
    style.ScrollbarRounding = 9.0
    style.GrabMinSize = 5.0
    style.GrabRounding = 3.0
    colors[clr.Text] = ImVec4(0.80, 0.80, 0.83, 1.00)
    colors[clr.TextDisabled] = ImVec4(0.24, 0.23, 0.29, 1.00)
    colors[clr.WindowBg] = ImVec4(0.06, 0.05, 0.07, 1.00)
    colors[clr.ChildWindowBg] = ImVec4(0.07, 0.07, 0.09, 1.00)
    colors[clr.PopupBg] = ImVec4(0.07, 0.07, 0.09, 1.00)
    colors[clr.Border] = ImVec4(0.80, 0.80, 0.83, 0.88)
    colors[clr.BorderShadow] = ImVec4(0.92, 0.91, 0.88, 0.00)
    colors[clr.FrameBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
    colors[clr.FrameBgHovered] = ImVec4(0.24, 0.23, 0.29, 1.00)
    colors[clr.FrameBgActive] = ImVec4(0.56, 0.56, 0.58, 1.00)
    colors[clr.TitleBg] = ImVec4(0.76, 0.31, 0.00, 1.00)
    colors[clr.TitleBgCollapsed] = ImVec4(1.00, 0.98, 0.95, 0.75)
    colors[clr.TitleBgActive] = ImVec4(0.80, 0.33, 0.00, 1.00)
    colors[clr.MenuBarBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
    colors[clr.ScrollbarBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
    colors[clr.ScrollbarGrab] = ImVec4(0.80, 0.80, 0.83, 0.31)
    colors[clr.ScrollbarGrabHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
    colors[clr.ScrollbarGrabActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
    colors[clr.ComboBg] = ImVec4(0.19, 0.18, 0.21, 1.00)
    colors[clr.CheckMark] = ImVec4(1.00, 0.42, 0.00, 0.53)
    colors[clr.SliderGrab] = ImVec4(1.00, 0.42, 0.00, 0.53)
    colors[clr.SliderGrabActive] = ImVec4(1.00, 0.42, 0.00, 1.00)
    colors[clr.Button] = ImVec4(0.10, 0.09, 0.12, 1.00)
    colors[clr.ButtonHovered] = ImVec4(0.24, 0.23, 0.29, 1.00)
    colors[clr.ButtonActive] = ImVec4(0.56, 0.56, 0.58, 1.00)
    colors[clr.Header] = ImVec4(0.10, 0.09, 0.12, 1.00)
    colors[clr.HeaderHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
    colors[clr.HeaderActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
    colors[clr.ResizeGrip] = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.ResizeGripHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
    colors[clr.ResizeGripActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
    colors[clr.CloseButton] = ImVec4(0.40, 0.39, 0.38, 0.16)
    colors[clr.CloseButtonHovered] = ImVec4(0.40, 0.39, 0.38, 0.39)
    colors[clr.CloseButtonActive] = ImVec4(0.40, 0.39, 0.38, 1.00)
    colors[clr.PlotLines] = ImVec4(0.40, 0.39, 0.38, 0.63)
    colors[clr.PlotLinesHovered] = ImVec4(0.25, 1.00, 0.00, 1.00)
    colors[clr.PlotHistogram] = ImVec4(0.40, 0.39, 0.38, 0.63)
    colors[clr.PlotHistogramHovered] = ImVec4(0.25, 1.00, 0.00, 1.00)
    colors[clr.TextSelectedBg] = ImVec4(0.25, 1.00, 0.00, 0.43)
    colors[clr.ModalWindowDarkening] = ImVec4(1.00, 0.98, 0.95, 0.73)
end
applystyleN()