Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- local basic load and play
- ]]--
- --[[
- local function loadImage(sPath) -- text image no color
- local file = fs.open(sPath,"r")
- local tOut = {}
- if file then
- local sLine = file.readLine()
- while sLine do
- tOut[#tOut + 1] = sLine
- sLine = file.readLine()
- end
- file.close()
- else
- error("unable to open file")
- end
- return tOut
- end
- ]]--
- local function displayImage(tImg)
- local termX,termY = term.getSize()
- for y = 1,termY do
- term.setCursorPos(1,y)
- term.write(tImg[y] or "")
- end
- end
- --local tArgs = {...}
- local tAnimation = {
- normal = {
- [[ O O
- | _ |
- [ ]
- ^ ^]],},
- blink = {
- [[ O O
- | _ |
- [ ]
- ^ ^]],
- [[ - -
- / _ \
- [ ]
- ^ ^]],},
- shuffel = {
- [[ O O
- | _ |
- [ ^
- ^ ]],
- [[ O O
- | _ |
- ^ ]
- ^]],
- [[
- O O
- | _ |
- ^ ^]],},
- snore = {
- [[ z
- O O
- | _ |
- ^ ^]],
- [[ z
- - -
- | _ |
- ^ ^]],
- [[ z
- - ~
- | _ |
- ^ ^]],
- [[ z Z
- ~ -
- | _ |
- ^ ^]],
- [[ z
- - -
- | _ |
- ^ ^]],
- [[ *
- - o
- | _ |
- ^ ^]],
- [[
- O O
- | _ |
- ^ ^]],},
- smile = {
- [[ O O
- | u |
- [ ]
- ^ ^]],
- [[ O O
- | U |
- [ ]
- ^ ^]],
- [[ O O
- | u |
- [ ]
- ^ ^]],},
- side = {
- [[ O O
- | _ |
- [ ]
- ^ ^]],
- [[ O O
- | _ |
- / /
- ^ ^]],
- [[ O O
- | _ |
- [ ]
- ^ ^]],
- [[ O O
- | _ |
- \ \
- ^ ^]],
- [[ O O
- | _ |
- [ ]
- ^ ^]],},
- flap = {
- [[ O O
- | _ |
- [ ]
- ^ ^]],
- [[ O O
- / _ \
- ^ ^
- ]],
- [[ _ O O _
- _
- ^ ^
- ]],
- [[ O O
- / _ \
- ^ ^
- ]],
- [[ _ O O _
- _
- ^ ^
- ]],
- [[ O O
- / _ \
- ^ ^
- ]],},
- }
- local tTypes = {}
- for key,value in pairs(tAnimation) do
- tTypes[#tTypes + 1] = key
- end
- while true do
- local nType = math.random(#tTypes)
- term.clear()
- term.setCursorPos(1,1)
- print("normal")
- write(tAnimation.normal[1])
- sleep(1)
- for i = 1,#tAnimation[tTypes[nType]] do
- term.clear()
- term.setCursorPos(1,1)
- print(tTypes[nType])
- write(tAnimation[tTypes[nType]][i])
- sleep(1)
- end
- end
- --[[
- if tArgs[1] then
- if fs.isDir(tArgs[1]) then
- local list = fs.list(tArgs[1])
- table.sort(list)
- for i = 1,#list do
- tPics[#tPics + 1] = loadImage(tArgs[1].."/"..list[i])
- end
- while true do
- for i = 1,#tPics do
- displayImage(tPics[i])
- sleep(1)
- end
- end
- else
- error("requires directory")
- end
- else
- error("usage <folder path>")
- end
- ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement