--local big = require("bigfont") local m = peripheral.find("monitor") m.setTextScale(1) term.redirect(m) term.setBackgroundColor(colors.black) term.clear() local shades = { colors.toBlit(colors.red), colors.toBlit(colors.purple), colors.toBlit(colors.magenta), colors.toBlit(colors.pink) } local mt = { __len = function(self) return #self.string end, __index = function(self, i) if tonumber(i) then return self.string:sub(i, i) else return self.string[i] end end, __newindex = function(self, i, v) rawset(self, "string", self.string:sub(1, i-1)..v..self.string:sub(i+1, -1)) end } local book = { "", " cccccccc", " cccccccccccc", " eecccccccccccccc", " cceeeecccccccccccccc", " cccccceeeecccccccccccccc", " cccccccccceeeeccccccccccccccc", " ccccccccccccceeeeccccccccccccccc", " cc00ccccccccccceeeeccccccccccc00", " cc0000ccccccccccceeeeccccccc00000", " cc0000cccccccccccee44ccc00000000", " cc0000ccccccccccc444400000000ccc", " cc0000cccccccccc444400000ccc", " cc0000cccccc000044e00ccc", " cc0000000000000eeecc", " cc00000000000cee", " cc0000000ccc", " cccccccc" } local function getBook() local out = {} table.foreachi(book, function(i, v) out[i] = setmetatable({string = v}, mt) end) return out end local function esc() --[[local exit = false while not exit do local _, k = os.pullEvent("key") if k == keys.space then return end end]] sleep(10) end local function run() local sx, sy = term.getSize() local offset = math.random(0, 100) while true do local book = getBook() for i = 1, #book do for j = 1, #book[i] do local sin1 = math.sin((i+(j*(math.cos(offset/100)))+offset)/4)-0.5 local shi1 = math.floor(sin1*7.2)+1 local sin2 = math.sin(((i*(math.cos(offset/150)+1))-j+(offset/2))/5)-0.5 local shi2 = math.floor(sin2*5)+2 if sin1 > 0 and book[i][j] ~= " " and shi1 > 1 and shi1 >= shi2 then book[i][j] = shades[shi1] end if sin2 > 0 and book[i][j] ~= " " and shi2 >= shi1 then book[i][j] = shades[shi2] end end term.setCursorPos(1, i) term.blit((" "):rep(#book[i]), (" "):rep(#book[i]), book[i].string) end offset = offset+1 sleep() end end term.setTextColor(colors.lime) term.setCursorPos(38, 2) big.bigWrite("Home of the \1645") term.setCursorPos(38, 5) big.bigWrite("Enchanted Book.") local sx, sy = term.getSize() local ax, ay, bx, by, cx, cy if sy == 19 then ax, ay = 46, 10 bx, by = 40, 17 cx, cy = 45, 15 else ax, ay = 30, 21 bx, by = 40, 14 cx, cy = 45, 12 end term.setCursorPos(ax, ay) term.setBackgroundColor(colors.gray) big.bigWrite("books.kst") paintutils.drawLine(ax-1,ay,ax-1,ay+2,colors.gray) term.setBackgroundColor(colors.black) term.setCursorPos(bx, by) term.write("Located @ 2F Coconut Mall | -30 80 -280") term.setCursorPos(cx, cy) term.write("Tools, Tome Gacha, and MORE") if sy > 19 then term.setCursorPos(44, 16) term.write("`/sethome books` while there!") term.setCursorPos(8, sy) term.setTextColor(colors.gray) term.write("books.kst is a supporter of open waterways and a member of the SCWPS.") end parallel.waitForAny(esc, run) --run() --term.redirect(term.native()) term.clear()