Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu
- local transposer = component.transposer
- local term = require("term")
- local event = require("event")
- local unicode = require("unicode")
- local screen = component.screen
- local serialization = require("serialization")
- local sides = require("sides")
- local waitTime = 10 --Время ожидания цикла
- local areas = {}
- local lists = {main = {x=2, y=6, width=40, height=16, content={}, limit=160, top = false, posF = 1, sb={0x0000FA, true, length=0, shift=0, work=false}, cFore = 0xFAFA00, cBack = 0x000000},
- commands = {x=46, y=6, width=30, height=16, content={}, limit=160, top=true, posF = 1, sb={0x0000FA, true, length=0, shift=0, work=false}, cFore = 0xFAFA00, cBack = 0x000000},
- states = {x=2, y=2, width=74, height=3, content={}, limit=160, top = true, posF = 1, sb={0x00FA00, true, length=0, shift=0, work=false}, cFore = 0xFAFA00, cBack = 0x000000}}
- local modemAddress = "1"
- local robotModemAddress = "2"
- local messages = {}
- local xCursor, yCursor, xCursorMove = 2, 23, 2
- local q = 0
- local rawLen = 13
- local funcs = {}
- local wScreen, hScreen = gpu.maxResolution()
- local matWl = {}
- local matBl = {"leather", "emerald", "lapislazuli", "slime"} --Черный список материалов
- local matBrn = {"chainmail"}
- local items = {"helmet", "chestplate", "leggings", "boots", "sword", "shovel", "axe"}
- local encList = {}
- local itemsBl = {["friender pearl"]=1, ["patient bag"]=2}
- local modsBl = {}
- local ignoreEncList = false
- local mainSearch = false
- local enchSearch = false
- local ignoreItemsBl = false
- local ignoreModsList = false
- local mstr = true
- local sd = "src"
- local smb = unicode.char(167)
- local mainID = 3
- local autoBl = false
- local autoEnc = false
- local sidesFlag = {"src", "loot"}
- local workSides = {src=5, loot=0, del=2, brn=3, enc=1, rep=4} --Стороны
- local tf = {["true"]=true, ["false"]=false}
- local wtm = 72*waitTime
- local tm1, tm2 = 0, 0
- local newSides = {[0]="Низ", [1]="Верх", [2]="Север", [3]="Юг", [4]="Запад", [5]="Восток"}
- local numbers = {i=1, ii=2, iii=3, iv=4, v=5, vi=6, "i", "ii", "iii", "iv", "v", "vi"}
- local slots = {src=39, loot=39}
- local slot = {src=1, loot=1}
- local sidesNames = {src = "Сторона для основного инвентаря", loot = "Сторона инвентаря для лутбоксов", del = "Сторона для уничтожения предметов", enc = "Сторона для сохранения зачарований", brn = "Сторона для сжигания предметов", rep = "Сторона для переплавки восстанавливаемых предметов"}
- local commandList = {"start",
- "Начать сортировку предметов",
- " ",
- "F1",
- "Остановить сортировку предметов",
- " ",
- "get src|loot line column",
- "Получить значение предмета в слоте",
- "src - основной инвентарь",
- "loot - инвентарь для лутбоксов",
- "line - строка в инвентаре",
- "column - столбец в инвентаре",
- "Столбец можно не указывать, но в этом случае в значение line нужно записывать номер слота",
- " ",
- "side name newSide",
- "Указать новую сторону для инвентарей",
- "name: src, loot, rep, enc, del, brn",
- "src и loot аналогично; rep - сторона для ремонта и переплавки предметов; enc - сторона для сохранения зачарований; del - сторона для удаления предметов; brn - сторона для обычной переплавки предметов",
- "newSide: bottom, top, north, south, west, east",
- " ",
- "bl nil|mod",
- "Запросить значения черного списка. При nil (само nil писать не надо) - черный список предметов, при mod - черный список модов",
- "bl add src|loot line column|nil nil|mod",
- "Добавить в черный список предмет или мод. Если последним аргументом ничего не указано, то добавится предмет, если указано слово 'mod', то добавится мод. Значения столбца можно указывать или не указывать по аналогии с функцией 'get'.",
- "Например, чтобы добавить предмет из 4 строки и 5 колонки основного инвентаря, запрос будет следующим:",
- "bl add src 4 5",
- "Или чтобы добавить предмет из 8 слота инвентаря для лутбоксов:",
- "bl add loot 8",
- "Но чтобы добавить мод из 16 слота инвентаря для лутбоксов:",
- "bl add loot 16 _ mod",
- " ",
- "bl rmv value nil|mod",
- "Убрать из черного списка предмет или мод",
- "value - название предмета или его ID; nil|mod - по аналогии выше",
- " ",
- "bl ignore nil|mod",
- "Игнорировать черный список предметов или модов",
- " ",
- "bl save nil|mod",
- "Сохранить черный список предметов или модов",
- " ",
- "bl asv nil|true|false",
- "Автосохранение черных списков",
- "При nil - узнать текущее состояние; true или false - включить или выключить соответственно",
- " ",
- "enc",
- "Получить список сохраненных зачарований",
- " ",
- "enc add name",
- "Добавить в список зачарований имя зачарования. Силу указвать не требуется",
- " ",
- "enc rmv value",
- "Удалить зачарование из списка зачарований. value - название, как в списке или ID",
- " ",
- "enc list",
- "Переключает состояние поиска зачарований по списку на true или false",
- " ",
- "enc search",
- "Включает или выключает поиск зачарований",
- " ",
- "enc save",
- "Сохранить список зачарований в файл",
- " ",
- "enc asv nil|true|false",
- "Автосохранение списка зачарований в файл. Аналогично примерам выше",
- " ",
- "exit",
- "Выход из программы"}
- function add(list, data)
- local wList = lists[list]
- local cPos, shift = 1, wList.width
- local totalLines = #wList.content
- if data then
- local count = math.ceil(unicode.wlen(data) / wList.width)
- if totalLines + count > 160 then
- for i = 1, count do
- table.remove(wList.content, 1)
- end
- end
- for i = 1, count do
- table.insert(wList.content, unicode.sub(data, cPos, cPos+shift-1))
- cPos = cPos + shift
- end
- totalLines = #wList.content
- if totalLines > wList.height and wList.top == false then
- wList.posF = totalLines - wList.height + 1
- end
- end
- if wList.sb then
- local length = 0
- local q = 0
- if totalLines > wList.height then
- length = math.floor(wList.height/totalLines*wList.height)
- length = length > 0 and length or 1
- q = (wList.height - 1 - length)/(totalLines - 1 - wList.height)
- q = q > 0 and q or 1
- wList.sb.q = q
- -- wList.sb.thumbPosition = math.ceil(math.abs(q*wlist.posF-realLength))
- wList.sb.work = true
- else
- length = wList.height
- q = 0
- end
- wList.sb.q = q
- wList.sb.thumb = string.rep(" ", length)
- end
- if list == "main" then
- drawList(lists.main)
- end
- end
- function newID()
- mainID = mainID + 1
- return mainID
- end
- function drawAreas(area)
- gpu.setForeground(area.cFore or 0xFFFFFF)
- gpu.setBackground(area.cBack or 0x000000)
- gpu.fill(area.x, area.y, area.width, area.height, " ")
- if area.sList then
- drawList(area.sList)
- end
- if area.data then
- local firstY = area.y
- for i = 1, #area.data do
- gpu.set(area.x, firstY, area.data[i])
- firstY = firstY + 1
- end
- if area.data.outTbl then
- for k,v in pairs(area.data.outTbl) do
- gpu.set(area.x, firstY, tostring(k) .. " " .. tostring(v))
- firstY = firstY + 1
- end
- end
- end
- gpu.setBackground(0x000000)
- end
- function drawList(list)
- gpu.setForeground(list.cFore)
- gpu.setBackground(list.cBack)
- local allLines = #list.content
- local linesCount = list.height
- gpu.fill(list.x, list.y, list.width, list.height, " ")
- local shiftF = -1
- local fLine = allLines > linesCount and linesCount or allLines
- if not list.top and allLines < linesCount then
- shiftF = linesCount - allLines - 1
- end
- for i = 1, fLine do
- gpu.set(list.x, list.y+i+shiftF, list.content[i+list.posF-1])
- end
- if list.sb then
- gpu.setBackground(0x000044)
- gpu.fill(list.x+list.width, list.y, 1, list.height, " ")
- gpu.setBackground(list.sb[1])
- local thumbPosition = math.ceil(list.sb.q*(list.posF-1))
- gpu.set(list.x+list.width, list.y+thumbPosition, list.sb.thumb, list.sb[2])
- end
- gpu.setForeground(0xFAFA00)
- gpu.setBackground(0x000000)
- end
- function sidesInit()
- local sidesFile = io.open("workSides", "r")
- if sidesFile then
- for line in sidesFile:lines() do
- for k,v in line:gmatch("(%w+)=(%d+)") do
- workSides[k] = tonumber(v)
- end
- end
- sidesFile:close()
- else
- add("main", "[!]Файл с обозначением сторон не найден.")
- add("main", "Значения сторон будут взяты из внутренней таблицы")
- add("main", " ")
- end
- for k,v in pairs(workSides) do
- if v >= 0 and v < 6 then
- if not transposer.getInventorySize(v) then
- add("main", sidesNames[k].." -> не установлен инвентарь")
- end
- add("main", sidesNames[k].." -> "..newSides[v])
- else
- add("main", sidesNames[k].." указана неверно")
- end
- add("main", " ")
- end
- slots.src = transposer.getInventorySize(workSides.src)
- slots.loot = transposer.getInventorySize(workSides.loot)
- local fileBl = io.open("itemsBl", "r")
- if fileBl then
- itemsBl = {}
- for line in fileBl:lines() do
- for k,v in line:gmatch("(.+)=(%d+)") do itemsBl[k] = tonumber(v) end
- end
- mainID = getMaxValue(itemsBl)
- fileBl:close()
- add("main", "Значения черного списка загружены из файла")
- else
- add("main", "[!]Файл черного списка не найден")
- end
- add("main", " ")
- local fileMods = io.open("modsBl", "r")
- if fileMods then
- modsBl = {}
- for line in fileMods:lines() do
- for k,v in line:gmatch("(%w+)=(%d+)") do modsBl[k] = tonumber(v) end
- end
- mainID = getMaxValue(modsBl)
- fileMods:close()
- add("main", "Значения черного списка модов загружены из файла")
- else
- add("main", "[!]Файл черного списка модов не найден")
- end
- add("main", " ")
- local fileEnc = io.open("encList", "r")
- if fileEnc then
- encList = {}
- for line in fileEnc:lines() do
- for k,v in line:gmatch("(.+)=(%d+)") do encList[k] = tonumber(v) end
- end
- mainID = getMaxValue(encList)
- fileEnc:close()
- add("main", "Значения списка зачарований загружены из файла")
- else
- add("main", "[!]Файл списка зачарований не найден")
- end
- add("main", " ")
- add("main", "Если стороны верны, то введите команду 'start', чтобы начать работу программы")
- end
- function saveData(tbl, name)
- local file = io.open(name, "w")
- for k,v in pairs(tbl) do
- file:write(k .. "=" .. tostring(v) .. "\n")
- end
- file:close()
- end
- function funcs.bl(str)
- local data = getArgs(str)
- local raw = tonumber(data[3]) or nil
- local column = tonumber(data[4]) or nil
- local wSlot = 0
- if data[1] == nil then
- add("main", "Черный список:")
- add("main", " ")
- for k,v in pairs(itemsBl) do
- add("main", tostring(v).." "..k)
- end
- add("main", " ")
- elseif data[1] == "add" then
- if data[2] == "src" or data[2] == "loot" then
- if raw and column then
- wSlot = (raw-1)*rawLen+column
- elseif raw and not column then
- wSlot = raw
- end
- if wSlot > 0 and wSlot <= slots[data[2]] then
- if data[5] == nil then
- local lbl = unicode.lower(transposer.getStackInSlot(workSides[data[2]], wSlot).label)
- if itemsBl[lbl] then
- add("main", "Предмет "..lbl.." уже в черном списке")
- else
- itemsBl[lbl] = newID()
- if autoBl then
- saveData(itemsBl, "itemsBl")
- end
- add("main", "Предмет "..lbl.." добавлен в черный список")
- end
- elseif data[5] == "mod" then
- local modName
- local modTbl=transposer.getStackInSlot(workSides[data[2]], wSlot)
- if modTbl then
- modName = modTbl.name:match("%w+")
- if modsBl[modName] then
- add("main", "Мод " .. modName .. " уже в черном списке")
- else
- modsBl[modName] = newID()
- if autoBl then
- saveData(modsBl, "modsBl")
- end
- add("main", "Мод " .. modName .. " добавлен в черный список")
- end
- end
- else
- add("main", "Неверная команда")
- end
- else
- add("main", "Слот указан не верно")
- end
- else
- add("main", "Третье значение должно быть 'src' или 'loot'")
- end
- add("main", " ")
- elseif data[1] == "rmv" then
- local wItem = ""
- local mod = data[#data]
- for i = 2, #data-(mod == "mod" and 1 or 0) do wItem = wItem .. " " .. data[i] end
- local item = tonumber(wItem) or unicode.lower(wItem:sub(2))
- local lbl
- if type(item) == "number" then
- local wTbl1 = mod == "mod" and modsBl or itemsBl
- for k,v in pairs(wTbl1) do
- if item == v then
- lbl = k
- wTbl1[lbl] = nil
- break
- end
- end
- elseif type(item) == "string" then
- local wTbl2 = mod == "mod" and modsBl or itemsBl
- for k,v in pairs(wTbl2) do
- if k:match(item) then
- lbl = k
- wTbl2[lbl] = nil
- break
- end
- end
- end
- local wNm = mod == "mod" and "Мод" or "Предмет"
- if lbl then
- if autoBl then
- if mod == "mod" then
- saveData(modsBl, "modsBl")
- else
- saveData(itemsBl, "itemsBl")
- end
- end
- add("main", wNm..lbl.." больше не в черном списке")
- else
- add("main", wNm.."не найден")
- end
- elseif data[1] == "ignore" then
- if data[2] == nil then
- ignoreItemsBl = not ignoreItemsBl
- add("main", "Парамерт 'Игнорировать Черный список' теперь "..tostring(ignoreItemsBl))
- elseif data[2] == "mod" then
- ignoreModsList = not ignoreModsList
- add("main", "Параметр 'Игнорировать список модов' теперь "..tostring(ignoreModsList))
- end
- setStates()
- elseif data[1] == "save" then
- if data[2] == nil then
- saveData(itemsBl, "itemsBl")
- add("main", "Черный список сохранен в файл")
- elseif data[2] == "mod" then
- saveData(modsBl, "modsBl")
- add("main", "Черный список модов сохранен в файл")
- end
- elseif data[1] == "asv" then
- if tf[data[2]] ~= nil then
- autoBl = tf[data[2]]
- end
- add("main", "Автосохранение черного списка " .. (autoBl and "ON" or "OFF"))
- setStates()
- elseif data[1] == "mod" then
- add("main", "Список модов:")
- for k,v in pairs(modsBl) do
- add("main", tostring(v) .. " " .. k)
- end
- add("main", " ")
- else
- add("main", "Неверная команда")
- end
- end
- function funcs.get(str)
- local data = getArgs(str)
- local wSide = data[1]
- local raw = tonumber(data[2]) or nil
- local column = tonumber(data[3]) or nil
- local slot = 0
- if raw and column then
- slot = (raw-1)*rawLen+column
- elseif raw and not column then
- slot = raw
- end
- if wSide == "src" or wSide == "loot" then
- if slot > 0 and slot <= slots[wSide] then
- local slotData = transposer.getStackInSlot(workSides[wSide], slot)
- local label = slotData.label
- local name = slotData.name
- add("main", "В слоте "..tostring(slot).." находится:")
- add("main", label)
- add("main", name)
- else
- add("main", "Не верный слот")
- end
- add("main", " ")
- else
- add("main", "Сторона указана не верно")
- end
- end
- function funcs.enc(str)
- local data = getArgs(str)
- if data[1] == "add" then
- local wEnc = ""
- local result = false
- for i = 2, #data do wEnc = wEnc .. " " .. data[i] end
- wEnc = unicode.lower(wEnc:sub(2))
- for k,v in pairs(encList) do
- if wEnc == k then
- result = true
- break
- end
- end
- if not result then
- encList[wEnc] = newID()
- if autoEnc then
- saveData(encList, "encList")
- end
- add("main", "Зачарование добавлено в список")
- else
- add("main", "Зачарование уже в списке зачарований")
- end
- elseif data[1] == nil then
- add("main", "Список зачарований:")
- add("main", " ")
- for k,v in pairs(encList) do
- add("main", k .. " " .. tostring(v))
- end
- elseif data[1] == "rmv" then
- local wEnc = ""
- local enc
- local result = false
- for i = 2, #data do wEnc = wEnc .. " " .. data[i] end
- enc = tonumber(wEnc) or unicode.lower(wEnc:sub(2))
- if type(enc) == "number" then
- for k,v in pairs(encList) do
- if v == enc then
- encList[k] = nil
- enc = k
- result = true
- break
- end
- end
- elseif type(enc) == "string" then
- for k,v in pairs(encList) do
- if k == enc then
- encList[k] = nil
- result = true
- break
- end
- end
- end
- if result then
- if autoEnc then
- saveData(encList, "encList")
- end
- add("main", "Зачарование " .. enc .. " удалено из списка")
- else
- add("main", "Такого зачарования нет в списке")
- end
- elseif data[1] == "list" then
- ignoreEncList = not ignoreEncList
- add("main", "Состояние 'Игнорировать список зачарований' теперь " .. tostring(ignoreEncList))
- setStates()
- elseif data[1] == "search" then
- enchSearch = not enchSearch
- add("main", "Состояние 'Поиск зачарований' теперь " .. tostring(enchSearch))
- setStates()
- elseif data[1] == "save" then
- saveData(encList, "encList")
- add("main", "Список зачарований сохранен в файл")
- elseif data[1] == "asv" then
- if tf[data[2]] ~= nil then
- autoEnc = tf[data[2]]
- end
- add("main", "Автосохранение списка зачарований " .. (autoEnc and "ON" or "OFF"))
- setStates()
- else
- add("main", "Неверная команда")
- end
- end
- function funcs.side(str)
- local data = getArgs(str)
- local newSide = data[1]
- local nSide = sides[data[2]]
- if sidesNames[newSide] then
- if nSide then
- workSides[newSide] = nSide
- add("main", sidesNames[newSide].." -> "..newSides[nSide])
- else
- add("main", "Такой стороны не существует")
- end
- else
- add("main", "Инвентарь указан не верно")
- end
- local file = io.open("workSides", "w")
- for k,v in pairs(workSides) do
- file:write(k.."="..tostring(v).."\n")
- end
- file:close()
- end
- function main(strn)
- local label, name, ench, count
- local s = workSides[sd]
- local allSlots = transposer.getAllStacks(workSides[sd])
- local slts = slots[sd]
- if allSlots then
- for i = 1, slts do
- local result = false
- local resultSide = false
- local done = false
- label = unicode.lower(allSlots[i].label)
- name = allSlots[i].name
- ench = allSlots[i].enchantments
- count = allSlots[i].size
- if ench and enchSearch then
- if ignoreEncList then
- done = transposer.transferItem(s, workSides.enc, _, i)
- else
- for e = 1, ench.n do
- local enc = unicode.lower(ench[e].label)
- local wEnc = ""
- local tEnc = {}
- for w in enc:gmatch("%S+") do table.insert(tEnc, w) end
- if numbers[tEnc[#tEnc]] then tEnc[#tEnc] = nil end
- for l = 1, #tEnc do wEnc = wEnc .. " " .. tEnc[l] end
- enc = wEnc:sub(2)
- if encList[enc] then
- done = transposer.transferItem(s, workSides.enc, _, i)
- break
- end
- end
- end
- end
- if not done then
- if ignoreItemsBl == false then
- if itemsBl[label] then
- done = transposer.transferItem(s, workSides.del, _, i)
- end
- end
- end
- if not done then
- if not ignoreModsList then
- if modsBl[name:match("%w+")] then
- done = transposer.transferItem(s, workSides.del, _, i)
- end
- end
- end
- if done == false then
- for k,v in pairs(items) do
- if name:match(v) then
- result = true
- break
- end
- end
- if result then
- for k1,v1 in pairs(matBl) do
- if name:match(v1) then
- resultSide = "del"
- break
- end
- end
- if resultSide == false then
- for k2,v2 in pairs(matBrn) do
- if name:match(v2) then
- resultSide = "brn"
- break
- end
- end
- end
- if not resultSide then
- if not name:match("sword") then
- resultSide = "rep"
- else
- resultSide = "del"
- end
- end
- if resultSide then
- transposer.transferItem(s, workSides[resultSide], _, i)
- end
- end
- end
- end
- end
- if not mstr then tm1 = os.time() end
- mstr = not mstr
- end
- function getTableLength(tbl)
- local length = 0
- for k,v in pairs(tbl) do
- if k then length = length + 1 end
- end
- return length
- end
- function getMaxValue(tbl)
- local mv = mainID
- for k,v in pairs(tbl) do
- mv = math.max(mv, v)
- end
- return mv
- end
- gpu.setResolution(80, 25)
- gpu.setBackground(0x444444)
- term.clear()
- table.insert(areas, {x=lists.main.x, y=lists.main.y, width=lists.main.width, height=lists.main.height, sList=lists.main, cBack = lists.main.cBack})
- table.insert(areas, {x=lists.commands.x, y=lists.commands.y, width=lists.commands.width, height=lists.commands.height, sList=lists.commands, cBack = lists.commands.cBack})
- table.insert(areas, {x=lists.states.x, y=lists.states.y, width=lists.states.width, height=lists.states.height, sList=lists.states, cBack = lists.states.cBack})
- add("main")
- for i = 1, #commandList do
- add("commands", commandList[i])
- end
- add("states")
- for k,v in pairs(areas) do
- drawAreas(v)
- end
- gpu.setForeground(0xFAFA00)
- gpu.setBackground(0x000000)
- gpu.fill(xCursor, yCursor, lists.main.width, 1, " ")
- term.setCursor(xCursor, yCursor)
- local str = ""
- function getArgs(data)
- local gArgs = {}
- for arg in data:gmatch("%S+") do table.insert(gArgs, arg) end
- table.remove(gArgs, 1)
- return gArgs
- end
- function funcs.exit()
- gpu.setForeground(0xFFFFFF)
- gpu.setBackground(0x000000)
- term.clear()
- gpu.setResolution(wScreen, hScreen)
- os.exit()
- end
- sidesInit()
- function funcs.start()
- mainSearch = true
- tm1 = os.time()
- tm2 = os.time()+wtm
- add("main", "Сортировка предметов начата")
- end
- function setStates()
- lists.states.content = {}
- add("states", "Поиск предметов по черному списку " .. (not ignoreItemsBl and "ON" or "OFF"))
- add("states", "Поиск модов по черному списку " .. (not ignoreModsList and "ON" or "OFF"))
- add("states", "Поиск зачарований " .. (enchSearch and "ON" or "OFF"))
- add("states", "Учитывать список зачарований " .. (not ignoreEncList and "ON" or "OFF"))
- add("states", "Автосохранение черного списка " .. (autoBl and "ON" or "OFF"))
- add("states", "Автосохранение списка зачарований " .. (autoEnc and "ON" or "OFF"))
- drawList(lists.states)
- end
- setStates()
- while true do
- local event, address, char, port, distance, message, message1 = term.pull(0.5)
- if event == "key_down" then
- local addition = unicode.char(char):match("%C+") or ""
- str = str .. addition
- local newStr = unicode.sub(str, -40, unicode.wlen(str))
- gpu.set(xCursor, yCursor, newStr)
- xCursorMove = xCursorMove + (xCursorMove - xCursor < 40 and unicode.wlen(addition) or 0)
- term.setCursor(xCursorMove, yCursor)
- if char == 13 then
- add("main", str)
- drawList(lists.main)
- gpu.setForeground(0xFAFA00)
- gpu.setBackground(0x000000)
- gpu.fill(xCursor, yCursor, 40, 1, " ")
- xCursorMove = xCursor
- term.setCursor(xCursor, yCursor)
- local fnc = str:match("%w+")
- if funcs[fnc] then funcs[fnc](str) end
- str = ""
- elseif char == 8 then
- str = unicode.wtrunc(str, unicode.wlen(str))
- gpu.fill(xCursor, yCursor, 40, 1, " ")
- gpu.set(xCursor, yCursor, str)
- xCursorMove = xCursorMove - (xCursorMove > xCursor and 1 or 0)
- term.setCursor(xCursorMove, yCursor)
- elseif char == 0 and port == 59 then
- mainSearch = false
- add("main", "Сортировка предметов остановлена")
- end
- elseif event == "scroll" then
- local lst = false
- for k,v in pairs(areas) do
- if char >= v.x and char < v.x+v.width and port >= v.y and port < v.y+v.height and v.sList then
- lst = v.sList
- break
- end
- end
- if lst and lst.sb.work then
- if lst.content[(lst.posF - distance) + ((lst.height - 1) * ((1-distance)/2))] then
- lst.posF = lst.posF - distance
- end
- drawList(lst)
- end
- end
- if mainSearch then if tm2 - tm1 >= wtm then sd = sidesFlag[mstr and 1 or 2] main() end tm2=os.time() end
- end
Add Comment
Please, Sign In to add comment