diff --git a/src/main/resources/assets/opencomputers/doc/en_us/block/microcontroller.md b/src/main/resources/assets/opencomputers/doc/en_us/block/microcontroller.md index f99ea3fbe..a5385a6ef 100644 --- a/src/main/resources/assets/opencomputers/doc/en_us/block/microcontroller.md +++ b/src/main/resources/assets/opencomputers/doc/en_us/block/microcontroller.md @@ -2,6 +2,6 @@ ![Don't belittle it.](block:OpenComputers:microcontroller) -Microcontrollers are built using a [microcontroller case](../item/microcontrollerCase1.md) in the [assembler](assembler.md). They have less functionality compared to [computers](../general/computer.md), but are cheaper to build. In particular, the *can not* interact with external components. +Microcontrollers are built using a [microcontroller case](../item/microcontrollerCase1.md) in the [assembler](assembler.md). They have less functionality compared to [computers](../general/computer.md), but are cheaper to build. In particular, they *can not* interact with external components. Microcontrollers can take various components, such as [CPUs](../item/cpu1.md), [memory (RAM)](../item/ram1.md), and Expansion cards. Microcontrollers are unable to contain a [hard disk drive](../item/hdd1.md), but do contain a slot for an [EEPROM](../item/eeprom.md), which can be programmed for very specific tasks. They have an advantage over [computer cases](case1.md), in that they can also make use of some upgrades, such as the [piston upgrade](../item/pistonUpgrade.md). diff --git a/src/main/resources/assets/opencomputers/loot/network/.prop b/src/main/resources/assets/opencomputers/loot/network/.prop index cea2062f9..5c7c608fc 100644 --- a/src/main/resources/assets/opencomputers/loot/network/.prop +++ b/src/main/resources/assets/opencomputers/loot/network/.prop @@ -1 +1 @@ -{fromDir="/data/"} +{label="Network", reboot=true, fromDir="/data/"} diff --git a/src/main/resources/assets/opencomputers/loot/network/installNetwork.lua b/src/main/resources/assets/opencomputers/loot/network/installNetwork.lua deleted file mode 100644 index 817e3c840..000000000 --- a/src/main/resources/assets/opencomputers/loot/network/installNetwork.lua +++ /dev/null @@ -1,6 +0,0 @@ -local filesystem = require "filesystem" -local shell = require "shell" -local process = require "process" - -shell.execute("install --noboot --nolabelset --name=Network --fromDir=/data/ --from="..filesystem.get(process.running()).address) -print("You must reboot to start network services.") diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua index 90cd2e9ba..ca2f8e199 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua @@ -178,8 +178,8 @@ local function getCursor() end local function line() - local cbx, cby = getCursor() - return buffer[cby] + local _, cby = getCursor() + return buffer[cby] or "" end local function getNormalizedCursor() @@ -269,12 +269,12 @@ local function highlight(bx, by, length, enabled) end local function home() - local cbx, cby = getCursor() + local _, cby = getCursor() setCursor(1, cby) end local function ende() - local cbx, cby = getCursor() + local _, cby = getCursor() setCursor(unicode.wlen(line()) + 1, cby) end @@ -299,8 +299,8 @@ local function right(n) n = n or 1 local cbx, cby = getNormalizedCursor() local be = unicode.wlen(line()) + 1 - local wide, right = isWideAtPosition(line(), cbx + n) - if wide and right then + local wide, isRight = isWideAtPosition(line(), cbx + n) + if wide and isRight then n = n + 1 end if cbx + n <= be then @@ -327,7 +327,7 @@ local function down(n) end local function delete(fullRow) - local cx, cy = term.getCursor() + local _, cy = term.getCursor() local cbx, cby = getCursor() local x, y, w, h = getArea() local function deleteRow(row) @@ -370,7 +370,6 @@ local function insert(value) return end term.setCursorBlink(false) - local cx, cy = term.getCursor() local cbx, cby = getCursor() local x, y, w, h = getArea() local index = lengthToChars(line(), cbx) @@ -384,7 +383,7 @@ end local function enter() term.setCursorBlink(false) - local cx, cy = term.getCursor() + local _, cy = term.getCursor() local cbx, cby = getCursor() local x, y, w, h = getArea() local index = lengthToChars(line(), cbx) @@ -404,8 +403,7 @@ end local findText = "" local function find() - local x, y, w, h = getArea() - local cx, cy = term.getCursor() + local _, _, _, h = getArea() local cbx, cby = getCursor() local ibx, iby = cbx, cby while running do @@ -464,11 +462,11 @@ local keyBindHandlers = { home = home, eol = ende, pageUp = function() - local x, y, w, h = getArea() + local _, _, _, h = getArea() up(h - 1) end, pageDown = function() - local x, y, w, h = getArea() + local _, _, _, h = getArea() down(h - 1) end, @@ -513,13 +511,13 @@ local keyBindHandlers = { local f, reason = io.open(filename, "w") if f then local chars, firstLine = 0, true - for _, line in ipairs(buffer) do + for _, bline in ipairs(buffer) do if not firstLine then - line = "\n" .. line + bline = "\n" .. bline end firstLine = false - f:write(line) - chars = chars + unicode.len(line) + f:write(bline) + chars = chars + unicode.len(bline) end f:close() local format @@ -600,14 +598,13 @@ end local function onClipboard(value) value = value:gsub("\r\n", "\n") - local cbx, cby = getCursor() local start = 1 local l = value:find("\n", 1, true) if l then repeat - local line = string.sub(value, start, l - 1) - line = text.detab(line, 2) - insert(line) + local next_line = string.sub(value, start, l - 1) + next_line = text.detab(next_line, 2) + insert(next_line) enter() start = l + 1 l = value:find("\n", start, true) @@ -632,9 +629,9 @@ do if f then local x, y, w, h = getArea() local chars = 0 - for line in f:lines() do - table.insert(buffer, line) - chars = chars + unicode.len(line) + for fline in f:lines() do + table.insert(buffer, fline) + chars = chars + unicode.len(fline) if #buffer <= h then drawLine(x, y, w, h, #buffer) end