Spamming yields would technically "work", but it'd be at no where
near the frame rate you're hoping for. The underlying problem is that the code is too slow.
oh damn how would I do that xD wouldn't there be an easier way like adding a os.sleep(0) somewhere?
What do you mean, "easier"? There are plenty of code examples through the link I provided you; term.blit() is a very straight-forward function to use.
But let's say you had a line in your table like this:
"###################'''''@$-$$$$$$'***.'****.'**',,,,,,,,,,,,,,,,",
You'd translate it to the corresponding
"paint" values (just use the Replace All function in your text editor of choice for each of the sixteen hues):
"5555555555555555555fffff862666666f7770f77770f77fbbbbbbbbbbbbbbbb",
Then just rig your code to output whole rows at a time:
local out = term.isColour() and term.current() or peripheral.find("monitor", function(side, ob) return ob.isColour() end)
if not out then error("No colorful output device detected, meow :(/>") end
term.redirect(out)
local sizeX, sizeY = out.getSize()
local min_row = math.floor((sizeY - 64) / 2 )
local min_col = math.floor((sizeX - 64) / 2 ) + 1
local spaces = string.rep(" ", 64)
while true do
for frame = 1, #nyans do
local curFrame = nyans[frame]
for y = 1, 64 do
term.setCursorPos(min_col, min_row + y)
term.blit(spaces, spaces, curFrame[y])
end
sleep(fps)
end
end
For bonus points, stick a
Neural Interface on a cat, use a Neural Connector to place a note block into its modules panel, then do:
pastebin get Zs0JAs1b note
pastebin run cUYTGbpb get CYRmLz78 Songs
note "Songs\Nyan Cat" -r