Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local font = require("font")
- local mod = peripheral.wrap("back")
- local function send(digit, char, tp)
- tp = tp or 2
- if type(char) == "string" then char = string.upper(char) end
- local toSend = font[char]
- if toSend == nil then
- error("Invalid character: " .. tostring(char), 2)
- end
- local isIn = {}
- for i = 1, 13 do
- if not toSend[i] then break end
- isIn[toSend[i]] = true
- end
- for i = 1, 13 do
- mod.transmit(1, 1, {
- pos = i,
- tp = isIn[i] and tp or 1,
- digit = digit
- })
- end
- end
- local function sendWord(word, tpOverride)
- for i = 1, #word do
- send(i, string.sub(word, i, i), tpOverride or 2)
- end
- end
- return {
- sendWord = sendWord,
- send = send
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement