Advertisement
Guest User

info

a guest
Dec 17th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. --parallel.waitForAll(scroll, readIn)
  2. function scroll()
  3.   u = 0
  4.   boarder = "++++++++++++++++++++++++++"
  5.   filler = "=========================="
  6.   n = "ComputerCraft==========================Lapitos Galacticraft==========================JAC Gaming"
  7.   local w, h = term.getSize()
  8.   while true do
  9.            
  10.     if u == w + 1 then
  11.         u = 0 - string.len(n)
  12.     end
  13.       sleep(0.10)
  14.       term.clear()
  15.       u = u + 1
  16.       term.setTextColor(colors.red)
  17.       term.setCursorPos(1, 1)
  18.       term.write(boarder)
  19.       term.setCursorPos(1, 3)
  20.       term.write(boarder)
  21.       term.setTextColor(colors.blue)
  22.       term.setCursorPos(u-26, 2)
  23.       term.write(filler)
  24.       term.setCursorPos(u+string.len(n), 2)
  25.       term.write(filler)
  26.       --term.setTextColor(colors.blue)
  27.       term.setCursorPos(u, 2)
  28.       term.write(n)
  29.      
  30.      
  31.      
  32.   end  
  33. end      
  34.      
  35. function getKey()
  36.   --coroutine.yield()      
  37.       local sEvent, param = os.pullEvent("key")
  38.         if sEvent == "key" then
  39.           if param == 205 then
  40.             print("key detected")
  41.           elseif param >= 206 then
  42.          
  43.           elseif param <= 204 then
  44.             u = u + 1
  45.           end
  46.         else
  47.           term.setCursorPos(u, 2)
  48.           term.write(n)
  49.         end
  50.  
  51. end
  52. --scroll()
  53. while true do
  54.   parallel.waitForAny(getKey, scroll)
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement