Advertisement
natie3

Display

Oct 7th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. term.setBackgroundColor(colors.black)
  2. term.clear()
  3. term.setBackgroundColor(colors.yellow)
  4. term.setTextColor(colors.blue)
  5. display = {}
  6. table.insert(display,"#0000#")
  7. table.insert(display,"####      ####")
  8. table.insert(display,"##              ##")
  9. table.insert(display,"#  ^^          ^^  #")
  10. table.insert(display,"#   ^^          ^^   #")
  11. table.insert(display,"#        ######        #")
  12. table.insert(display,"#      ##      ##      #")
  13. table.insert(display,"#      #          #      #")
  14. table.insert(display,"0     #                  0")
  15. table.insert(display,"0     #                  0")
  16. for k, v in pairs(display) do
  17.   xpos = 14 - (string.len(v)/2)
  18.   term.setCursorPos(xpos,k)
  19.   term.write(v)
  20.   term.setCursorPos(xpos,(20-k))
  21.   term.write(v)
  22. end
  23.  
  24. x, y ,z = gps.locate()
  25. x = x - 2
  26. z = math.abs((z + 166))
  27. if (x/68) < 35 then
  28.   xpos = math.ceil((x/68) * 18) + 1
  29. else
  30.   xpos = (x/68) * 18 + 1
  31. end
  32. if (z/68) < 35 then
  33.   ypos = math.ceil((z/68) * 24) + 1
  34. else
  35.   ypos = (z/68) * 2 + 1
  36. end
  37. term.setCursorPos(ypos,xpos)
  38. term.write("P")
  39. os.pullEvent("key")
  40. term.setBackgroundColor(colors.black)
  41. term.setTextColor(colors.white)
  42. term.clear()
  43. term.setCursorPos(1,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement