diff --git a/Applications/MultiScreen/1.pic b/Applications/MultiScreen/1.pic deleted file mode 100644 index de2059d4..00000000 Binary files a/Applications/MultiScreen/1.pic and /dev/null differ diff --git a/Applications/MultiScreen/10.pic b/Applications/MultiScreen/10.pic deleted file mode 100644 index c7a26dff..00000000 Binary files a/Applications/MultiScreen/10.pic and /dev/null differ diff --git a/Applications/MultiScreen/11.pic b/Applications/MultiScreen/11.pic deleted file mode 100644 index 9f958d30..00000000 Binary files a/Applications/MultiScreen/11.pic and /dev/null differ diff --git a/Applications/MultiScreen/12.pic b/Applications/MultiScreen/12.pic deleted file mode 100644 index beefb4a5..00000000 Binary files a/Applications/MultiScreen/12.pic and /dev/null differ diff --git a/Applications/MultiScreen/13.pic b/Applications/MultiScreen/13.pic deleted file mode 100644 index 4807b910..00000000 Binary files a/Applications/MultiScreen/13.pic and /dev/null differ diff --git a/Applications/MultiScreen/14.pic b/Applications/MultiScreen/14.pic deleted file mode 100644 index c36df42d..00000000 Binary files a/Applications/MultiScreen/14.pic and /dev/null differ diff --git a/Applications/MultiScreen/15.pic b/Applications/MultiScreen/15.pic deleted file mode 100644 index ea91e08d..00000000 Binary files a/Applications/MultiScreen/15.pic and /dev/null differ diff --git a/Applications/MultiScreen/16.pic b/Applications/MultiScreen/16.pic deleted file mode 100644 index d2850383..00000000 Binary files a/Applications/MultiScreen/16.pic and /dev/null differ diff --git a/Applications/MultiScreen/2.pic b/Applications/MultiScreen/2.pic deleted file mode 100644 index 7bfe7dc9..00000000 Binary files a/Applications/MultiScreen/2.pic and /dev/null differ diff --git a/Applications/MultiScreen/3.pic b/Applications/MultiScreen/3.pic deleted file mode 100644 index 31f56519..00000000 Binary files a/Applications/MultiScreen/3.pic and /dev/null differ diff --git a/Applications/MultiScreen/4.pic b/Applications/MultiScreen/4.pic deleted file mode 100644 index 82953bcd..00000000 Binary files a/Applications/MultiScreen/4.pic and /dev/null differ diff --git a/Applications/MultiScreen/5.pic b/Applications/MultiScreen/5.pic deleted file mode 100644 index 30d7e34d..00000000 Binary files a/Applications/MultiScreen/5.pic and /dev/null differ diff --git a/Applications/MultiScreen/6.pic b/Applications/MultiScreen/6.pic deleted file mode 100644 index b1ef6c9b..00000000 Binary files a/Applications/MultiScreen/6.pic and /dev/null differ diff --git a/Applications/MultiScreen/7.pic b/Applications/MultiScreen/7.pic deleted file mode 100644 index 2712d08a..00000000 Binary files a/Applications/MultiScreen/7.pic and /dev/null differ diff --git a/Applications/MultiScreen/8.pic b/Applications/MultiScreen/8.pic deleted file mode 100644 index 38ae941a..00000000 Binary files a/Applications/MultiScreen/8.pic and /dev/null differ diff --git a/Applications/MultiScreen/9.pic b/Applications/MultiScreen/9.pic deleted file mode 100644 index efaeea7e..00000000 Binary files a/Applications/MultiScreen/9.pic and /dev/null differ diff --git a/Applications/MultiScreen/Big.pic b/Applications/MultiScreen/Big.pic new file mode 100644 index 00000000..e4ef264f Binary files /dev/null and b/Applications/MultiScreen/Big.pic differ diff --git a/Applications/MultiScreen/MultiScreen.lua b/Applications/MultiScreen/MultiScreen.lua index 5f2c4ff1..ff6ba26c 100644 --- a/Applications/MultiScreen/MultiScreen.lua +++ b/Applications/MultiScreen/MultiScreen.lua @@ -229,18 +229,19 @@ function multiScreen.set(x, y, text) for i = 1, unicode.len(text) do local xMonitor, yMonitor, xPos, yPos = getMonitorAndCoordinates(x + i - 1, y) - if currentAddress ~= monitors[xMonitor][yMonitor].address then - gpu.bind(monitors[xMonitor][yMonitor].address) - currentAddress = monitors[xMonitor][yMonitor].address - gpu.setResolution(monitors.screenResolutionByWidth, monitors.screenResolutionByHeight) + if monitors[xMonitor] and monitors[xMonitor][yMonitor] then + if currentAddress ~= monitors[xMonitor][yMonitor].address then + gpu.bind(monitors[xMonitor][yMonitor].address) + currentAddress = monitors[xMonitor][yMonitor].address + gpu.setResolution(monitors.screenResolutionByWidth, monitors.screenResolutionByHeight) + end + + if gpu.getBackground ~= currentBackground then gpu.setBackground(currentBackground) end + if gpu.getForeground ~= currentForeground then gpu.setForeground(currentForeground) end + + gpu.set(xPos, yPos, unicode.sub(text, i, i)) end - - if gpu.getBackground ~= currentBackground then gpu.setBackground(currentBackground) end - if gpu.getForeground ~= currentForeground then gpu.setForeground(currentForeground) end - - gpu.set(xPos, yPos, unicode.sub(text, i, i)) end - end function multiScreen.image(x, y, picture) @@ -270,6 +271,38 @@ function multiScreen.image(x, y, picture) end end +local function drawBigImageFromOCIFRawFile(x, y, path) + local file = io.open(path, "r") + file:lines() + + local lineLength, background, foreground, alpha, symbol + local xPos, yPos = x, y + + for line in file:lines() do + local lineLength = unicode.len(line) + + for i = 1, lineLength, 19 do + background = tonumber("0x" .. unicode.sub(line, i, i + 5)) + foreground = tonumber("0x" .. unicode.sub(line, i + 7, i + 12)) + alpha = tonumber("0x" .. unicode.sub(line, i + 14, i + 15)) + symbol = unicode.sub(line, i + 17, i + 17) + + if alpha ~= 0xff then + multiScreen.setBackground(background) + multiScreen.setForeground(foreground) + multiScreen.set(xPos, yPos, symbol) + end + + xPos = xPos + 1 + end + + xPos = x + yPos = yPos + 1 + end + + file:close() +end + -------------------------------------------------------------------------------------------------------------------------------------------- loadConfig() @@ -278,23 +311,25 @@ loadConfig() -- multiScreen.setForeground(ecs.colors.white) multiScreen.clear(0x000000) +drawBigImageFromOCIFRawFile(1, 1, "Big.pic") + -- local picture = image.load("Girl.pic") -local x, y = 1, 1 -local w, h = 4, 4 +-- local x, y = 1, 1 +-- local w, h = 4, 4 -local picture +-- local picture -local counter = 1 -for j = 1, h do - for i = 1, w do - picture = image.load( counter .. ".pic") - multiScreen.image(x, y, picture) - x = x + 160 - counter = counter + 1 - end - x = 1 - y = y + 50 -end +-- local counter = 1 +-- for j = 1, h do +-- for i = 1, w do +-- picture = image.load( counter .. ".pic") +-- multiScreen.image(x, y, picture) +-- x = x + 160 +-- counter = counter + 1 +-- end +-- x = 1 +-- y = y + 50 +-- end -- multiScreen.set(130, 2, "Сука мать ебал, пидор ты ебаный, хыыы!") diff --git a/Applications/Robot/Experience.lua b/Applications/Robot/Experience.lua new file mode 100644 index 00000000..e8e6896d --- /dev/null +++ b/Applications/Robot/Experience.lua @@ -0,0 +1,43 @@ + +local component = require("component") +local robot = require("robot") +local currentToolSlot = 1 +local counter = 0 +local inventorySize = robot.inventorySize() + + +robot.select(1) +local success +while true do + success = robot.swing() + if success then + robot.place() + end + counter = counter + 1 + if counter > 50 then + local durability = robot.durability() or 500000000 + counter = 0 + print("Текущая экспа: " .. robot.level()) + print("Текущий слот: " .. currentToolSlot) + print("Текущая прочность: " .. durability) + print(" ") + if durability < 0.1 then + currentToolSlot = currentToolSlot + 1 + if currentToolSlot > inventorySize then currentToolSlot = inventorySize end + robot.select(currentToolSlot) + component.inventory_controller.equip() + robot.select(1) + end + end +end + + + + + + + + + + +