Advertisement
Guest User

error4

a guest
Jun 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. term.setTextColor(colors.lime)
  2.  
  3. rainbow = {
  4.   colors.white,
  5.   colors.lightGray,
  6.   colors.gray,
  7. --  colors.black,
  8.   colors.brown,
  9.   colors.red,
  10.   colors.orange,
  11.   colors.yellow,
  12.   colors.lime,
  13.   colors.green,
  14.   colors.cyan,
  15.   colors.lightBlue,
  16.   colors.blue,
  17.   colors.purple,
  18.   colors.magenta,
  19.   colors.pink
  20. }
  21. --for i=1,16 do
  22. --  rainbow[i] = 2^(i-1)
  23. --end
  24.  
  25. function spaces(c)
  26.   for i=0,c,1 do
  27.     write(" ")
  28.   end
  29. end
  30.  
  31. function offset(step,max)
  32.   return (math.sin(step/10 * math.pi)+1)/2 * max
  33. end
  34.  
  35. x,y = term.getSize()
  36. function writetext(n,step)
  37.   step = math.floor(step)
  38.   max = x-string.len(n)-1
  39.   xs,ys = term.getCursorPos()
  40.   term.setCursorPos(offset(step,max), ys)
  41.   --color = rainbow[1 + step % table.getn(rainbow)]
  42.   --term.setTextColor(color)
  43.   write(n)
  44. end
  45.  
  46. step = 0
  47. while true do
  48.  --local n = "I still think dawt is cheating" -- :thinking:" --math.random(0, 9)
  49.  local n = "dawt"
  50.  --write("hi")
  51.  color = rainbow[1 + math.floor(step/4) % table.getn(rainbow)]
  52.  term.setTextColor(color)
  53.  writetext("dawt", step+7)
  54.  writetext("cheating", step/3)
  55.  write("\n")
  56.  
  57.  os.queueEvent("someFakeEventName")
  58.  os.pullEvent("someFakeEventName")
  59.  
  60.  step = step+1
  61.  --write(string.len(n))
  62.  sleep(1/30)
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement